SchemaInject API: Developer Guide for Automated Schema at Scale
The SchemaInject API generates complete, AI-optimized JSON-LD schema for any URL. Reference guide for developers and agencies building schema automation into their pipelines.
SchemaInject API: Developer Guide for Automated Schema at Scale
> TL;DR
> - The SchemaInject API generates production-ready JSON-LD for any URL ā one call, complete output
> - Use it in build pipelines, deployment hooks, agency onboarding flows, or real-time injection
> - Free during beta ā get access at /schemainject ā
Updated: April 21, 2026
---
What the API Does
Pass any URL. Get back complete, valid JSON-LD schema ā typed correctly, fields populated from live page data, AI enrichment layer included.
The API:
1. Fetches the target URL
2. Detects page type (Product, SoftwareApplication, LocalBusiness, Article, etc.)
3. Extracts metadata from the page (title, price, availability, description, ratings)
4. Enriches with AI-generated fields (use cases, audience, FAQ schema)
5. Returns valid JSON-LD ready to embed
Use cases:
---
Base URL
https://robo-27abd188.base44.app/functions/schemaApi
All requests are POST with Content-Type: application/json.
---
Core Endpoints
Generate Schema for a URL
curl -X POST https://robo-27abd188.base44.app/functions/schemaApi \
-H "Content-Type: application/json" \
-d '{
"action": "generate",
"url": "https://yoursite.com/products/standing-mat",
"key": "si_yourkey_xxxxxxxxxxxx"
}'
Response:
{
"success": true,
"url": "https://yoursite.com/products/standing-mat",
"page_type": "Product",
"schema": {
"@context": "https://schema.org/",
"@type": "Product",
"name": "Topo Anti-Fatigue Mat",
"description": "...",
"offers": { ... },
"aggregateRating": { ... }
},
"ai_visibility_score": 87,
"missing_fields": ["FAQPage", "OfferShippingDetails"]
}
---
Audit a URL (Score + Missing Fields)
curl -X POST https://robo-27abd188.base44.app/functions/schemaApi \
-H "Content-Type: application/json" \
-d '{
"action": "audit",
"url": "https://yoursite.com/products/standing-mat",
"key": "si_yourkey_xxxxxxxxxxxx"
}'
Response:
{
"success": true,
"url": "https://yoursite.com/products/standing-mat",
"ai_visibility_score": 52,
"existing_schema": ["Product", "BreadcrumbList"],
"missing_high_impact": ["MerchantReturnPolicy", "AggregateRating", "FAQPage"],
"missing_medium_impact": ["OfferShippingDetails", "Brand entity"],
"snippet": ""
}
---
Create a Project (Admin)
curl -X POST https://robo-27abd188.base44.app/functions/schemaApi \
-H "Content-Type: application/json" \
-d '{
"admin_token": "your_admin_token",
"action": "admin_create",
"data": {
"domain": "clientsite.com",
"owner_email": "client@example.com",
"plan": "pro",
"schema_types": ["Product", "Organization"],
"site_config": {
"org_name": "Client Store",
"return_days": 30,
"free_returns": true
},
"is_active": true
}
}'
Response:
{
"success": true,
"project": {
"id": "proj_abc123",
"domain": "clientsite.com",
"api_key": "si_clientsite_Kx9mPqRvLnT2cY",
"snippet": ""
}
}
---
Build Pipeline Integration
Next.js ā Generate Schema at Build Time
// scripts/generate-schema.ts
// Run this during next build via a prebuild scriptimport fs from 'fs'
import path from 'path'
const API_KEY = process.env.SCHEMAINJECT_KEY
const BASE_URL = 'https://yoursite.com'
async function generateSchema(slug: string) {
const url = ${BASE_URL}/products/${slug}
const res = await fetch('https://robo-27abd188.base44.app/functions/schemaApi', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ action: 'generate', url, key: API_KEY })
})
const { schema } = await res.json()
return JSON.stringify(schema)
}
// Generate and cache schema for all products
const products = await fetchAllProductSlugs()
const schemas: Record = {}
for (const slug of products) {
schemas[slug] = await generateSchema(slug)
console.log(Generated schema for ${slug})
}
fs.writeFileSync(
path.join(process.cwd(), 'public/schema-cache.json'),
JSON.stringify(schemas, null, 2)
)
Then in your product page component, read from the cache:
// app/products/[slug]/page.tsx
import schemaCache from '@/public/schema-cache.json'export default function ProductPage({ params }) {
const schema = schemaCache[params.slug]
return (
<>
{schema && (
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: schema }}
/>
)}
{/ page content /}
>
)
}
Vercel Deployment Hook
Add a post-deploy hook that audits your top pages and flags any schema regressions:
#!/bin/bash
post-deploy-schema-check.sh
PAGES=(
"https://yoursite.com"
"https://yoursite.com/products/top-product"
"https://yoursite.com/pricing"
)
for URL in "${PAGES[@]}"; do
SCORE=$(curl -s -X POST https://robo-27abd188.base44.app/functions/schemaApi \
-H "Content-Type: application/json" \
-d "{\"action\":\"audit\",\"url\":\"$URL\",\"key\":\"$SCHEMAINJECT_KEY\"}" \
| jq '.ai_visibility_score')
echo "Score for $URL: $SCORE"
if [ "$SCORE" -lt 70 ]; then
echo "WARNING: Schema score below threshold for $URL"
# Send Slack notification, email alert, etc.
fi
done
---
SDK (Node.js)
// lib/schemainject.tsconst API_BASE = 'https://robo-27abd188.base44.app/functions/schemaApi'
export class SchemaInject {
constructor(private apiKey: string) {}
async generate(url: string) {
const res = await fetch(API_BASE, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ action: 'generate', url, key: this.apiKey })
})
return res.json()
}
async audit(url: string) {
const res = await fetch(API_BASE, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ action: 'audit', url, key: this.apiKey })
})
return res.json()
}
scriptTag() {
return
}
}
// Usage
const si = new SchemaInject(process.env.SCHEMAINJECT_KEY!)
const { schema, ai_visibility_score } = await si.generate('https://yoursite.com/products/mat')
---
Rate Limits and Plans
| Plan | Requests/month | Concurrent | Use case |
|---|---|---|---|
| Free (beta) | Unlimited | 5 | Individual sites, testing |
| Pro | 10,000 | 20 | Growing stores, small agencies |
| Agency | 100,000 | 100 | Multi-site agencies |
| Enterprise | Unlimited | Custom | Large catalogs, white-label |
---
Related articles: