# JSON Pointer API
> Address values inside a JSON document by JSON Pointer (RFC 6901) — the /a/b/0 path syntax used by JSON Patch (RFC 6902), JSON Schema and OpenAPI $ref. The get endpoint resolves the value at a pointer (and tells you whether it exists); set writes a value at a pointer and returns the modified document (use - as the final array token to append); and list enumerates every pointer in a document, optionally only the leaf values. Token escaping (~0 for ~, ~1 for /) is handled for you. Perfect for surgically reading and patching deep JSON, building config and form tooling, and walking API responses. Pure local computation — no key, no third-party service, instant; up to 2 MB via POST. Live, nothing stored. 4 endpoints. Distinct from JSONPath querying, JSON diff/patch and dot-notation flattening.

## 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/jsonpointer-api/..."
```

## Pricing
- **Free** (Free) — 1,065 calls/Mo, 2 req/s
- **Starter** ($1/Mo) — 9,050 calls/Mo, 8 req/s
- **Pro** ($21/Mo) — 141,500 calls/Mo, 20 req/s
- **Mega** ($59/Mo) — 745,000 calls/Mo, 50 req/s

## Endpoints

### JSON Pointer

#### `GET /v1/get` — Resolve a JSON Pointer

**Parameters:**
- `json` (query, required, string) — JSON document Example: `{"users":[{"name":"Alice"},{"name":"Bob"}],"meta":{"tags":["x","y"]}}`
- `pointer` (query, required, string) — Pointer (e.g. /users/0/name) Example: `/users/0/name`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/jsonpointer-api/v1/get?json=%7B%22users%22%3A%5B%7B%22name%22%3A%22Alice%22%7D%2C%7B%22name%22%3A%22Bob%22%7D%5D%2C%22meta%22%3A%7B%22tags%22%3A%5B%22x%22%2C%22y%22%5D%7D%7D&pointer=%2Fusers%2F0%2Fname"
```

**Response:**
```json
{
    "data": {
        "found": true,
        "value": "Alice",
        "pointer": "/users/0/name"
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:45.713Z",
        "request_id": "209cebca-82f6-4322-8e51-d3e7c810ed94"
    },
    "status": "ok",
    "message": "Resolve a JSON Pointer",
    "success": true
}
```

#### `GET /v1/list` — List all pointers

**Parameters:**
- `json` (query, required, string) — JSON document Example: `{"users":[{"name":"Alice"},{"name":"Bob"}],"meta":{"tags":["x","y"]}}`
- `leaves_only` (query, optional, string) — true to list only scalar values

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/jsonpointer-api/v1/list?json=%7B%22users%22%3A%5B%7B%22name%22%3A%22Alice%22%7D%2C%7B%22name%22%3A%22Bob%22%7D%5D%2C%22meta%22%3A%7B%22tags%22%3A%5B%22x%22%2C%22y%22%5D%7D%7D"
```

**Response:**
```json
{
    "data": {
        "count": 10,
        "pointers": [
            {
                "type": "object",
                "pointer": ""
            },
            {
                "type": "array",
                "pointer": "/users"
            },
            {
                "type": "object",
                "pointer": "/users/0"
            },
            {
                "type": "string",
                "pointer": "/users/0/name"
            },
            {
                "type": "object",
                "pointer": "/users/1"
            },
            {
                "type": "string",
                "pointer": "/users/1/name"
            },
            {
                "type": "object",
                "pointer": "/meta"
            },
            {
                "type": "array",
                "pointer": "/meta/tags"
            },
            {
                "type": "string",
                "pointer": "/meta/tags/0"
            },
            {
                "type": "string",
                "pointer": "/meta/tags/1"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:45.810Z",
        "request_id": "f6304d90-44b0-4ea6-b2bd-82026c886b61"
    },
    "status": "ok",
    "message": "List all pointers",
    "success": true
}
```

#### `GET /v1/set` — Set a value at a pointer

**Parameters:**
- `json` (query, required, string) — JSON document Example: `{"users":[{"name":"Alice"},{"name":"Bob"}],"meta":{"tags":["x","y"]}}`
- `pointer` (query, required, string) — Target pointer Example: `/users/0/name`
- `value` (query, required, string) — Value (JSON or string) Example: `"Alicia"`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/jsonpointer-api/v1/set?json=%7B%22users%22%3A%5B%7B%22name%22%3A%22Alice%22%7D%2C%7B%22name%22%3A%22Bob%22%7D%5D%2C%22meta%22%3A%7B%22tags%22%3A%5B%22x%22%2C%22y%22%5D%7D%7D&pointer=%2Fusers%2F0%2Fname&value=%22Alicia%22"
```

**Response:**
```json
{
    "data": {
        "result": {
            "meta": {
                "tags": [
                    "x",
                    "y"
                ]
            },
            "users": [
                {
                    "name": "Alicia"
                },
                {
                    "name": "Bob"
                }
            ]
        },
        "pointer": "/users/0/name"
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:45.909Z",
        "request_id": "79fb1dcb-8c75-4ba1-800b-1d189d77f6c3"
    },
    "status": "ok",
    "message": "Set a value at a pointer",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/jsonpointer-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "name": "JSON Pointer API",
        "notes": "Tokens are escaped per RFC 6901 (~0 = ~, ~1 = /). Use - as the last array token in set to append. Nothing is stored.",
        "version": "v1",
        "endpoints": [
            {
                "path": "/v1/get",
                "params": {
                    "json": "the document (required)",
                    "pointer": "e.g. /users/0/name (\"\" = whole doc)"
                },
                "returns": "the value and whether it was found"
            },
            {
                "path": "/v1/set",
                "params": {
                    "json": "the document (required)",
                    "value": "the value (JSON or string)",
                    "pointer": "target (required)"
                },
                "returns": "the modified document"
            },
            {
                "path": "/v1/list",
                "params": {
                    "json": "the document (required)",
                    "leaves_only": "true to list only scalar values"
                },
                "returns": "every pointer in the document"
            },
            {
                "path": "/v1/meta",
                "params": [],
                "returns": "this document"
            }
        ],
        "description": "Resolve, set and enumerate values inside a JSON document by JSON Pointer (RFC 6901) — the /a/b/0 path syntax used by JSON Patch, JSON Schema and OpenAPI $ref. Get the
…(truncated, see openapi.json for full schema)
```


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