# JSON-LD API
> Generate valid schema.org JSON-LD structured data from simple fields — the markup Google and other search engines use for rich results. The generate endpoint builds ready-to-embed JSON-LD for the types that matter most for SEO: Article (and BlogPosting / NewsArticle) with author and publisher, Product with offers, price, availability and an aggregate rating, Organization and LocalBusiness with postal address and opening hours, Person, WebSite with a Sitelinks search box (SearchAction), BreadcrumbList, FAQPage, Event and Recipe with ingredients and step-by-step instructions. Pass plain fields — or JSON arrays and newline lists for breadcrumbs, FAQ questions, ingredients and social profiles — and get back a clean JSON-LD object, optionally wrapped in a ready-to-paste <script type="application/ld+json"> tag. The types endpoint documents every supported type and its fields. Everything is assembled locally and deterministically, so it is instant and private. Ideal for CMS and static-site pipelines, SEO tooling, e-commerce product pages, documentation and content platforms. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This GENERATES schema.org markup; to extract structured data or Open Graph tags from a page use an HTML-parsing API, and to audit on-page SEO use an SEO API.

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

## Pricing
- **Free** (Free) — 2,135 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 11,650 calls/Mo, 8 req/s
- **Pro** ($24/Mo) — 167,500 calls/Mo, 20 req/s
- **Mega** ($62/Mo) — 880,000 calls/Mo, 50 req/s

## Endpoints

### JSON-LD

#### `GET /v1/generate` — Generate JSON-LD

**Parameters:**
- `type` (query, required, string) — article, product, organization, localbusiness, person, website, breadcrumb, faq, event, recipe Example: `product`
- `name` (query, optional, string) — Name/headline (type-specific — see /v1/types) Example: `Widget`
- `html` (query, optional, string) — true to also return the <script> tag

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/jsonld-api/v1/generate?type=product&name=Widget"
```

**Response:**
```json
{
    "data": {
        "type": "product",
        "jsonld": {
            "name": "Widget",
            "@type": "Product",
            "@context": "https://schema.org"
        }
    },
    "meta": {
        "timestamp": "2026-06-03T09:25:04.895Z",
        "request_id": "29e1239a-5953-4ca1-88bb-402884a5db8f"
    },
    "status": "ok",
    "message": "Generate JSON-LD",
    "success": true
}
```

#### `GET /v1/types` — List supported types

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

**Response:**
```json
{
    "data": {
        "types": [
            {
                "type": "article",
                "fields": [
                    "headline",
                    "description",
                    "image",
                    "author",
                    "publisher",
                    "logo",
                    "datePublished",
                    "dateModified",
                    "url"
                ],
                "aliases": [
                    "BlogPosting",
                    "NewsArticle"
                ]
            },
            {
                "type": "product",
                "fields": [
                    "name",
                    "description",
                    "image",
                    "sku",
                    "brand",
                    "price",
                    "currency",
                    "availability",
                    "url",
                    "rating",
                    "reviewCount"
                ]
            },
            {
                "type": "organization",
                "fields": [
                    "name",
                    "url",
                    "logo",
                    "description",
                    "email",
                    "telephone",
                    "sameAs",
                    "businessType"
                ]
            },
            {
                "type": "localbusiness",
                "fields": [
                    "name",
                    "url",
        
…(truncated, see openapi.json for full schema)
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "name": "JSON-LD API",
        "notes": "This GENERATES schema.org markup — to extract structured data or Open Graph tags from a page use an HTML-parsing API, and to audit on-page SEO use an SEO API. Send list/nested data as JSON via POST. Nothing is stored.",
        "version": "v1",
        "endpoints": [
            {
                "path": "/v1/generate",
                "params": {
                    "html": "true to also return the <script> tag",
                    "type": "article, product, organization, localbusiness, person, website, breadcrumb, faq, event, recipe",
                    "…fields": "type-specific fields — see /v1/types"
                },
                "returns": "the JSON-LD object (and optional HTML script tag)"
            },
            {
                "path": "/v1/types",
                "params": [],
                "returns": "all supported types and their fields"
            },
            {
                "path": "/v1/meta",
                "params": [],
                "returns": "this document"
            }
        ],
        "description": "Generate valid schema.org JSON-LD structured data from simple fields — for Google rich results and SEO. Build markup for Article/BlogPosting/NewsArticle, Product (with offers and aggregate rating), Organization, LocalBusiness, Person, WebSite (with a Sitelinks search box), BreadcrumbList, FAQPage, Event and Recipe. Pass plain fields and get back a ready-to-embed J
…(truncated, see openapi.json for full schema)
```


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