# OpenAPI Validator API
> Validate and summarise an OpenAPI / Swagger API definition. Supply the spec inline (?spec=), as a request body, or fetched from a URL (?url=, SSRF-guarded) — in JSON or YAML. The validator detects the version (Swagger 2.0, OpenAPI 3.0.x or 3.1.x), checks the required structure (info.title and info.version, the presence of paths/components, and every operation's responses), and lints for common problems — duplicate or missing operationIds, operations without a summary or description, tags used but not declared, and malformed paths — returning a valid flag, counts of paths, operations, schemas, tags and servers, and separate error and warning lists. A summary endpoint inventories the whole API: every endpoint with its method, path, operationId, summary and tags, plus the declared servers, tags and component schemas. Built for CI gates on API contracts, API-catalogue ingestion, documentation pipelines and design review. An OpenAPI definition validator and linter — distinct from the JSON-Schema validator (jsonschema), the JSON/YAML/XML converters and the on-page HTML/SEO tools. No upstream key, no cache.

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

## Pricing
- **Free** (Free) — 2,360 calls/Mo, 2 req/s
- **Starter** ($7/Mo) — 47,000 calls/Mo, 8 req/s
- **Pro** ($22/Mo) — 240,000 calls/Mo, 20 req/s
- **Mega** ($57/Mo) — 880,000 calls/Mo, 50 req/s

## Endpoints

### OpenAPI

#### `GET /v1/summary` — Inventory a spec's endpoints

**Parameters:**
- `spec` (query, optional, string) — Inline OpenAPI/Swagger JSON or YAML Example: `{"openapi":"3.0.0","info":{"title":"Example API","version":"1.0.0"},"paths":{"\/ping":{"get":{"operationId":"ping","summary":"Ping","responses":{"200":{"description":"ok"}}}}}}`
- `url` (query, optional, string) — URL to fetch the spec from

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/openapi-api/v1/summary?spec=%7B%22openapi%22%3A%223.0.0%22%2C%22info%22%3A%7B%22title%22%3A%22Example+API%22%2C%22version%22%3A%221.0.0%22%7D%2C%22paths%22%3A%7B%22%5C%2Fping%22%3A%7B%22get%22%3A%7B%22operationId%22%3A%22ping%22%2C%22summary%22%3A%22Ping%22%2C%22responses%22%3A%7B%22200%22%3A%7B%22description%22%3A%22ok%22%7D%7D%7D%7D%7D%7D"
```

**Response:**
```json
{
    "data": {
        "tags": [],
        "title": "Example API",
        "schemas": [],
        "servers": [],
        "version": "OpenAPI 3.0.0",
        "endpoints": [
            {
                "path": "/ping",
                "tags": [],
                "method": "GET",
                "summary": "Ping",
                "operation_id": "ping"
            }
        ],
        "api_version": "1.0.0",
        "operation_count": 1
    },
    "meta": {
        "timestamp": "2026-06-01T23:40:49.956Z",
        "request_id": "2b40d927-64ff-4f33-9e2c-c41bc79000ad"
    },
    "status": "ok",
    "message": "Spec summarised",
    "success": true
}
```

#### `GET /v1/validate` — Validate & lint a spec

**Parameters:**
- `spec` (query, optional, string) — Inline OpenAPI/Swagger JSON or YAML Example: `{"openapi":"3.0.0","info":{"title":"Example API","version":"1.0.0"},"paths":{"\/ping":{"get":{"operationId":"ping","summary":"Ping","responses":{"200":{"description":"ok"}}}}}}`
- `url` (query, optional, string) — URL to fetch the spec from

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/openapi-api/v1/validate?spec=%7B%22openapi%22%3A%223.0.0%22%2C%22info%22%3A%7B%22title%22%3A%22Example+API%22%2C%22version%22%3A%221.0.0%22%7D%2C%22paths%22%3A%7B%22%5C%2Fping%22%3A%7B%22get%22%3A%7B%22operationId%22%3A%22ping%22%2C%22summary%22%3A%22Ping%22%2C%22responses%22%3A%7B%22200%22%3A%7B%22description%22%3A%22ok%22%7D%7D%7D%7D%7D%7D"
```

**Response:**
```json
{
    "data": {
        "title": "Example API",
        "valid": true,
        "counts": {
            "tags": 0,
            "paths": 1,
            "schemas": 0,
            "servers": 0,
            "operations": 1
        },
        "errors": [],
        "methods": {
            "get": 1
        },
        "version": "OpenAPI 3.0.0",
        "warnings": [],
        "api_version": "1.0.0",
        "error_count": 0,
        "warning_count": 0
    },
    "meta": {
        "timestamp": "2026-06-01T23:40:50.061Z",
        "request_id": "c297dfd1-d18e-4a2f-9f26-aed1ed9b83ce"
    },
    "status": "ok",
    "message": "Spec validated",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Supported versions & inputs

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

**Response:**
```json
{
    "data": {
        "note": "Validate and summarise an OpenAPI / Swagger API definition. Supply the spec inline via ?spec=, as a POST body, or fetched from a ?url= (JSON or YAML; private targets refused). /v1/validate detects the version (Swagger 2.0, OpenAPI 3.0.x or 3.1.x), checks the required structure (info.title/version, paths/components, every operation's responses), lints for common problems (duplicate or missing operationIds, missing summaries, undeclared tags, malformed paths) and returns valid plus counts of paths, operations, schemas, tags and servers with separate error and warning lists. /v1/summary inventories the API: every endpoint with its method, path, operationId, summary and tags, plus the declared servers, tags and component schemas. Ideal for CI gates on API contracts, API-catalogue ingestion, documentation tooling and design review. An OpenAPI definition validator/linter — distinct from the JSON-Schema validator (jsonschema), the JSON/YAML converters and the on-page SEO/HTML tools. No key, no cache.",
        "input": [
            "?spec= (inline JSON/YAML)",
            "?url= (fetched, SSRF-guarded)",
            "POST body (JSON/YAML)"
        ],
        "supports": [
            "Swagger 2.0",
            "OpenAPI 3.0.x",
            "OpenAPI 3.1.x"
        ],
        "endpoints": [
            "/v1/validate",
            "/v1/summary",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T23:40:50.135Z",
    
…(truncated, see openapi.json for full schema)
```


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