# Query String API
> Parse and build URL query strings — with full support for nested objects and arrays. Turn a query string like a[b][c]=1&tags[]=x&tags[]=y into a clean nested JSON object, and turn any JSON object back into a properly-encoded query string. Choose how arrays are serialised (indices, brackets, repeated keys or comma-separated) and whether to URL-encode. Far beyond a flat key=value encoder — it handles the deep structures real web frameworks (Rails, PHP, Express/qs) use. Pure local processing — no key, no third-party service, instant. Live. 3 endpoints. Built for API request construction, parsing complex links and redirects, form-encoded bodies and webhook payloads.

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

## Pricing
- **Free** (Free) — 1,260 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 16,000 calls/Mo, 8 req/s
- **Pro** ($24/Mo) — 158,000 calls/Mo, 20 req/s
- **Mega** ($60/Mo) — 810,000 calls/Mo, 50 req/s

## Endpoints

### QueryString

#### `GET /v1/parse` — Parse a query string to an object

**Parameters:**
- `query` (query, required, string) — Query string (with or without ?) Example: `a[b][c]=1&tags[]=x&tags[]=y`
- `depth` (query, optional, string) — Max nesting depth (default 5)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/querystring-api/v1/parse?query=a%5Bb%5D%5Bc%5D%3D1%26tags%5B%5D%3Dx%26tags%5B%5D%3Dy"
```

**Response:**
```json
{
    "data": {
        "parsed": {
            "a": {
                "b": {
                    "c": "1"
                }
            },
            "tags": [
                "x",
                "y"
            ]
        }
    },
    "meta": {
        "timestamp": "2026-06-02T16:51:54.430Z",
        "request_id": "a61af415-21d6-42eb-85f1-f5f3c0ea9e15"
    },
    "status": "ok",
    "message": "Parse a query string",
    "success": true
}
```

#### `GET /v1/stringify` — Build a query string from an object

**Parameters:**
- `json` (query, required, string) — JSON object Example: `{"a":{"b":1},"tags":["x","y"]}`
- `array_format` (query, optional, string) — indices|brackets|repeat|comma
- `encode` (query, optional, string) — false to disable URL-encoding

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/querystring-api/v1/stringify?json=%7B%22a%22%3A%7B%22b%22%3A1%7D%2C%22tags%22%3A%5B%22x%22%2C%22y%22%5D%7D"
```

**Response:**
```json
{
    "data": {
        "query": "a%5Bb%5D=1&tags%5B0%5D=x&tags%5B1%5D=y"
    },
    "meta": {
        "timestamp": "2026-06-02T16:51:54.506Z",
        "request_id": "b9c4fd82-6e2d-4b81-94ba-5948c54dc4be"
    },
    "status": "ok",
    "message": "Build a query string",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "auth": "none upstream; this gateway requires x-api-key",
        "name": "Query String API",
        "note": "Parse and build URL query strings with full nested support. /v1/parse?query=a[b][c]=1&x[]=2&x[]=3 returns a nested object (optional ?depth=); /v1/stringify?json={...} builds a query string (options: array_format=indices|brackets|repeat|comma, encode=true|false). Distinct from a flat URL-encoder. Instant, nothing stored.",
        "source": "Local query-string processing (qs) — no key, no upstream",
        "endpoints": 3
    },
    "meta": {
        "timestamp": "2026-06-02T16:51:54.587Z",
        "request_id": "4bf35060-1e67-4738-b29b-f917288a8ac3"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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