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
| Parameter | Required | Description |
|---|---|---|
project | Yes | Your InstantSchema project UUID |
pathname | Yes | The page path (e.g. /blog/my-post) |
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
Adddata-instantschema="1" to each tag so the dashboard can detect the integration automatically:
data-instantschema="1" the dashboard cannot distinguish your schemas from other JSON-LD and you’ll need to confirm manually.
Caching
The API setsCache-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:- Checks your monthly scan budget (returns
402if exhausted) - Checks the rate limit (50 on-demand scans/org/hour; returns
429if exceeded) - Crawls the page, generates schemas, and returns them in the same request
Error codes
| Status | Meaning |
|---|---|
400 | Missing project or pathname parameter |
402 | Monthly scan budget exhausted |
404 | Project not found, or page not found (on-demand disabled) |
429 | On-demand rate limit reached (50/org/hr) |
500 | Internal server error |
{"error": "..."}.
CORS
The endpoint allows cross-origin requests from any origin (Access-Control-Allow-Origin: *). The CDN and inline script integrations rely on this.