# Schema Mock API
> Generate realistic mock data from a JSON Schema. Send any JSON Schema and get back data that conforms to it — honouring types, formats (email, uuid, date-time, uri, ipv4 and more), minimum/maximum, string length and patterns, enums, required fields, and nested objects and arrays. Ask for a single object or an array of up to 100. Add a "faker" keyword on a property (e.g. "faker":"person.fullName" or "commerce.product") to get specific realistic values powered by Faker. Unlike fixed-entity fake-data generators, the shape is entirely driven by your schema — perfect for API mocking, test fixtures, database seeding, prototyping and contract testing. Pure local generation — no key, no third-party service, instant. Live. 2 endpoints. Distinct from JSON Schema validation and from canned mock-data entities.

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

## Pricing
- **Free** (Free) — 1,420 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 24,000 calls/Mo, 8 req/s
- **Pro** ($26/Mo) — 174,000 calls/Mo, 20 req/s
- **Mega** ($62/Mo) — 890,000 calls/Mo, 50 req/s

## Endpoints

### Mock

#### `GET /v1/generate` — Generate mock data from a JSON Schema

**Parameters:**
- `schema` (query, required, string) — A JSON Schema Example: `{"type":"object","properties":{"id":{"type":"integer","minimum":1},"name":{"type":"string","faker":"person.fullName"},"email":{"type":"string","format":"email"}},"required":["id","name","email"]}`
- `count` (query, optional, string) — Number of items 1-100 (array)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/schemamock-api/v1/generate?schema=%7B%22type%22%3A%22object%22%2C%22properties%22%3A%7B%22id%22%3A%7B%22type%22%3A%22integer%22%2C%22minimum%22%3A1%7D%2C%22name%22%3A%7B%22type%22%3A%22string%22%2C%22faker%22%3A%22person.fullName%22%7D%2C%22email%22%3A%7B%22type%22%3A%22string%22%2C%22format%22%3A%22email%22%7D%7D%2C%22required%22%3A%5B%22id%22%2C%22name%22%2C%22email%22%5D%7D"
```

**Response:**
```json
{
    "data": {
        "data": {
            "id": 78179330,
            "name": "Marcos Bernhard",
            "email": "qhePOnhEaJhX@vnUcppcnXByhVVovGPsZayGLAoDMEYAZ.yfx"
        },
        "count": 1
    },
    "meta": {
        "timestamp": "2026-06-02T16:51:57.618Z",
        "request_id": "4cdc93fc-b058-4946-a4ad-81965564ecf7"
    },
    "status": "ok",
    "message": "Generate mock data from a JSON Schema",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "auth": "none upstream; this gateway requires x-api-key",
        "name": "Schema Mock API",
        "note": "Generate realistic mock data that conforms to a JSON Schema. POST or pass ?schema= a JSON Schema (Draft-07 style) and optional ?count=1..100 for an array. Honours type, format (email, uuid, date-time, uri, ...), min/max, enum, required, nested objects/arrays. Use a \"faker\" keyword (e.g. \"faker\":\"person.fullName\") for specific realistic values. Distinct from JSON Schema validation and fixed-entity mock data. Instant, nothing stored.",
        "source": "Local generation (json-schema-faker + faker) — no key, no upstream",
        "endpoints": 2
    },
    "meta": {
        "timestamp": "2026-06-02T16:51:57.717Z",
        "request_id": "f14a3058-2cac-46a7-a7e8-e976352b6377"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


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