Skip to main content

Custom API

Call the REST endpoint directly from any server-side language or framework. Schemas are rendered into your HTML source — no JavaScript required on the client.

Endpoint

Parameters

Example

Response

schemas is an array of JSON-LD objects. Render each one as a <script type="application/ld+json"> tag.

Rendering schemas server-side

Add data-instantschema="1" to each tag so the dashboard can detect the integration automatically:
Without data-instantschema="1" the dashboard cannot distinguish your schemas from other JSON-LD and you’ll need to confirm manually.

Caching

The API sets Cache-Control: public, s-maxage=86400 (24 hours). Schemas are also tagged with Cache-Tag: project-{id}, page-{id}-{hash} for targeted CDN purging when you update them.

On-demand monitoring

If a page isn’t in InstantSchema yet (e.g. a new blog post), the API can scan and generate schemas on the fly — if On-demand monitoring is enabled for your project. When on-demand monitoring is enabled and a page isn’t found, the API:
  1. Checks your monthly scan budget (returns 402 if exhausted)
  2. Checks the rate limit (50 on-demand scans/org/hour; returns 429 if exceeded)
  3. Crawls the page, generates schemas, and returns them in the same request
Each on-demand request counts as a billable scan.

Error codes

All error responses have the shape {"error": "..."}.

CORS

The endpoint allows cross-origin requests from any origin (Access-Control-Allow-Origin: *). The CDN and inline script integrations rely on this.