Vai al contenuto principale
CuteJSON
↑↓ Naviga Enter Seleziona Esc Chiudi

Query Workbench

Write a JSONPath or JMESPath query, pick the language you meant, and see exactly what it computes.

Torna a tutti gli strumenti

Scorciatoie da tastiera

Funzionano dove l'azione corrispondente esiste in questa pagina.

Apri la tavolozza comandi
Ctrl/Cmd + K
Esegui l'azione principale
Ctrl/Cmd + Enter
Formatta
Ctrl/Cmd + Shift + F
Minifica
Ctrl/Cmd + Shift + M
Copia output
Ctrl/Cmd + Shift + C
Apri file
Ctrl/Cmd + Shift + O
Scarica output
Ctrl/Cmd + S
Chiudi questa finestra
Esc
Apri questa finestra
F1 / ?

Dati locali

Tutto qui sotto e memorizzato solo in questo browser.

Bozze non salvate
Strumenti con opzioni ricordate

File aperti di recente

    Nessun file aperto ancora.

    Condividi via link

    Il contenuto e impacchettato nella parte dopo il #.

    Condivide la prima input in questa pagina.

    Niente da condividere ancora.

    Esempi

    Input

    Carica da un URL

    Recupera l'URL dal tuo browser.

    Result

    Il risultato appare qui.

    Funziona interamente nel tuo browser.

    Su questo strumento

    JSONPath and JMESPath answer different questions, so this tool never guesses which one a query is written in, the switch above the query box picks the language. JSONPath finds locations inside a document: every match keeps the shape it already had. JMESPath computes a new value instead: a pipe, a multi-select or a function call can reshape the data into something the document never literally contained, a list of just the fields you asked for, a single number, a document sorted by a field that only appears buried three levels down. This page implements the whole JMESPath 1.0 language, including every function in its standard library, listed below. It does not implement JSONata or jq-style expressions, both of which are their own considerably larger languages, and says so rather than quietly falling back to something else. The JSONPath mode reuses the same engine as the dedicated JSONPath Tester on this site; reach for that tool instead when you want to click a match and see it highlighted inside your document, since this page always prints a computed result rather than a browsable list of locations.

    Come usare

    1. Paste your JSON into the editor, or load the sample.
    2. Choose JSONPath or JMESPath, then write a query or press one of the examples.
    3. Read the result on the right. A JMESPath query computes a new value; a JSONPath query lists every match.

    JMESPath functions

    The whole standard library, the same 25 functions the specification defines.

    abs(number) Absolute value.
    avg(array) Average of the numbers, null if empty.
    ceil(number) Rounds up.
    contains(subject, value) True if the string or array contains it.
    ends_with(string, suffix) True if the string ends with it.
    floor(number) Rounds down.
    join(glue, array) Joins strings with a separator.
    keys(object) The object's own keys.
    length(value) Character, element or key count.
    map(&expr, array) Applies an expression to every element.
    max(array) The largest value, null if empty.
    max_by(array, &expr) The element with the largest computed value.
    merge(object, ...) Shallow merges objects, left to right.
    min(array) The smallest value, null if empty.
    min_by(array, &expr) The element with the smallest computed value.
    not_null(value, ...) The first argument that is not null.
    reverse(value) Reverses a string or an array.
    sort(array) Sorts numbers or strings, ascending.
    sort_by(array, &expr) Sorts by a computed value, stably.
    starts_with(string, prefix) True if the string starts with it.
    sum(array) Adds up the numbers.
    to_array(value) Wraps a non-array in one, keeps an array as is.
    to_string(value) The value as a string.
    to_number(value) The value as a number, null if it cannot be read as one.
    type(value) The JMESPath type name.
    values(object) The object's own values.

    Need the full JSONPath syntax table, or want to click a match to see it highlighted in your document? Use the dedicated JSONPath Tester instead.