> For the complete documentation index, see [llms.txt](https://kb.stoque.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.stoque.com.br/zeev/apis/como-funcionam-as-apis-rest-no-zeev/json-path.md).

# JSON Path

Para transformar os dados trazidos, no Zeev utilizamos o JSON Path

Para transformar os dados trazidos, no Zeev utilizamos o **JSONPath** que é uma linguagem usada para **localizar e extrair dados específicos dentro de um objeto JSON** - retorno de APIs do tipo Rest.

A função do JSON Path é manipular e filtrar dados dentro de retornos originais do JSON, que costumam ser complexos.

#### Tabela de operadores JSON Path

**Operadores JSONPath** são os símbolos e expressões que permitem navegar, selecionar e filtrar dados dentro de uma estrutura JSON. Eles definem *como* você percorre o objeto e *quais* elementos quer extrair.

Abaixo estão os principais operadores e o que cada um faz:

<table><thead><tr><th width="114.20001220703125">SÍMBOLO / SINTAXE</th><th>NOME</th><th>FUNÇÃO</th><th>APLICAÇÃO</th></tr></thead><tbody><tr><td>$</td><td>Raiz</td><td>Representa o início do JSON</td><td>$</td></tr><tr><td>.</td><td>Navegação direta</td><td>Desce um nível hierárquico</td><td>$.cliente.nome</td></tr><tr><td>..</td><td>Descida recursiva</td><td>Procura o campo em qualquer nível da hierarquia (não importa onde esteja)</td><td>$..email</td></tr><tr><td>*</td><td>Coringa</td><td>Seleciona todos os elementos em um objeto ou array</td><td>$.cliente.*</td></tr><tr><td>[]</td><td>Índice ou chave</td><td>Seleciona um campo específico (por índice ou nome)</td><td>$.cliente['contatos'] ou $.cliente.pedidos[0]</td></tr><tr><td>[*]</td><td>Todos os índices de um array</td><td>Itera sobre todos os itens da lista</td><td>$.cliente.pedidos[*].valor</td></tr><tr><td>[0,2]</td><td>Índices múltiplos</td><td>Seleciona elementos específicos por posição</td><td>$.cliente.pedidos[0,2]</td></tr><tr><td>[start:end]</td><td>Intervalo (slice)</td><td>Seleciona intervalo de índices (como em Python)</td><td>$.cliente.pedidos[0:2]</td></tr><tr><td>?()</td><td>Filtro</td><td>Aplica condição booleana para filtrar itens</td><td>$.cliente.pedidos[?(@.valor > 200)]</td></tr><tr><td>@</td><td>Contexto atual</td><td>Refere-se ao elemento sendo avaliado em um filtro</td><td>?(@.status == 'ativo')</td></tr><tr><td>()</td><td>Expressão de script</td><td>Permite cálculo simples dentro da expressão</td><td>$.pedidos[?(@.valor + 10 > 300)]</td></tr><tr><td>['campo']</td><td>Nome literal</td><td>Alternativa ao ponto — útil para chaves com espaços, números ou caracteres especiais</td><td>$['dados do cliente'].nome</td></tr></tbody></table>

{% embed url="<https://youtu.be/8KxHoCxifN8>" %}

#### Exemplo prático

{% embed url="<https://youtu.be/9DomLkvzu4Y>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://kb.stoque.com.br/zeev/apis/como-funcionam-as-apis-rest-no-zeev/json-path.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
