# JSONPath API
> Query and extract from JSON with JSONPath, server-side. Run any JSONPath expression — wildcards, recursive descent, array slices and filter expressions like [?(@.price>10)] — against a JSON document and get back the matched values, the normalized paths and JSON Pointers of every match, or just the first match. Filter expressions are evaluated in a safe sandbox with no access to globals, and inputs can be sent as a JSON POST body or a query parameter. Pure local compute with no third-party upstream, so responses are instant and the service is always available. Ideal for no-code and automation platforms, ETL and data pipelines, API integrations, testing and config extraction.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/jsonpath-api/..."
```

## Pricing
- **Free** (Free) — 1,000 calls/Mo, 2 req/s
- **Basic** ($2/Mo) — 60,000 calls/Mo, 5 req/s
- **Pro** ($7/Mo) — 400,000 calls/Mo, 15 req/s
- **Mega** ($18/Mo) — 2,000,000 calls/Mo, 40 req/s

## Endpoints

### JSONPath

#### `GET /v1/first` — First matching value

**Parameters:**
- `json` (query, required, string) — JSON document (object or JSON string) Example: `{"store":{"book":[{"title":"A","price":8},{"title":"B","price":13}]}}`
- `path` (query, required, string) — JSONPath expression Example: `$..price`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/jsonpath-api/v1/first?json=%7B%22store%22%3A%7B%22book%22%3A%5B%7B%22title%22%3A%22A%22%2C%22price%22%3A8%7D%2C%7B%22title%22%3A%22B%22%2C%22price%22%3A13%7D%5D%7D%7D&path=%24..price"
```

**Response:**
```json
{
    "data": {
        "path": "$..price",
        "found": true,
        "value": 8
    },
    "meta": {
        "timestamp": "2026-05-30T18:16:51.883Z",
        "request_id": "53d0977a-6ca2-4840-a6ac-a772a3df5723"
    },
    "status": "ok",
    "message": "OK",
    "success": true
}
```

#### `GET /v1/paths` — Paths & pointers of matches

**Parameters:**
- `json` (query, required, string) — JSON document (object or JSON string) Example: `{"store":{"book":[{"title":"A","price":8},{"title":"B","price":13}]}}`
- `path` (query, required, string) — JSONPath expression Example: `$..title`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/jsonpath-api/v1/paths?json=%7B%22store%22%3A%7B%22book%22%3A%5B%7B%22title%22%3A%22A%22%2C%22price%22%3A8%7D%2C%7B%22title%22%3A%22B%22%2C%22price%22%3A13%7D%5D%7D%7D&path=%24..title"
```

**Response:**
```json
{
    "data": {
        "path": "$..title",
        "count": 2,
        "results": [
            {
                "path": "$['store']['book'][0]['title']",
                "pointer": "/store/book/0/title"
            },
            {
                "path": "$['store']['book'][1]['title']",
                "pointer": "/store/book/1/title"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-05-30T18:16:51.957Z",
        "request_id": "573a1ee4-b518-4cc9-aae5-eec00f26a672"
    },
    "status": "ok",
    "message": "OK",
    "success": true
}
```

#### `GET /v1/query` — Query JSON with JSONPath

**Parameters:**
- `json` (query, required, string) — JSON document (object or JSON string) Example: `{"store":{"book":[{"title":"A","price":8},{"title":"B","price":13}]}}`
- `path` (query, required, string) — JSONPath expression Example: `$..book[?(@.price>10)].title`
- `type` (query, optional, string) — value | path | pointer | parent (default value) Example: `value`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/jsonpath-api/v1/query?json=%7B%22store%22%3A%7B%22book%22%3A%5B%7B%22title%22%3A%22A%22%2C%22price%22%3A8%7D%2C%7B%22title%22%3A%22B%22%2C%22price%22%3A13%7D%5D%7D%7D&path=%24..book%5B%3F%28%40.price%3E10%29%5D.title&type=value"
```

**Response:**
```json
{
    "data": {
        "path": "$..book[?(@.price>10)].title",
        "type": "value",
        "count": 1,
        "matches": [
            "B"
        ]
    },
    "meta": {
        "timestamp": "2026-05-30T18:16:52.044Z",
        "request_id": "00560872-01bc-42b2-84ff-50c398653f3c"
    },
    "status": "ok",
    "message": "OK",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/jsonpath-api
OpenAPI spec: https://www.oanor.com/api/jsonpath-api/openapi.json
