API Documentation
Generate and validate schema markup programmatically with our RESTful API. Perfect for integrating structured data generation into your applications.
Quick Start
Get started with the SchemaGen API in minutes
1
Get API Key
Sign up for free access
2
Make Request
Send POST to /api/generate
3
Get Schema
Receive JSON-LD markup
Authentication
All API requests require authentication using an API key. Include your API key in the request headers:
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Base URL:
https://api.schemagen.com/v1
API Endpoints
POST
/api/generate
Generate schema markup for any supported type
Parameters:
type
stringRequiredSchema type (article, product, person, etc.)
data
objectRequiredContent data for the schema
format
stringOutput format (json-ld, microdata)
Example:
Request:
{
"type": "article",
"data": {
"headline": "How to Implement Schema Markup",
"author": "John Doe",
"datePublished": "2024-01-15",
"articleBody": "Schema markup is essential for SEO..."
},
"format": "json-ld"
}
Response:
{
"success": true,
"schema": {
"@context": "https://schema.org",
"@type": "Article",
"headline": "How to Implement Schema Markup",
"author": {
"@type": "Person",
"name": "John Doe"
},
"datePublished": "2024-01-15",
"articleBody": "Schema markup is essential for SEO..."
}
}
POST
/api/validate
Validate existing schema markup
Parameters:
schema
objectRequiredSchema markup to validate
strict
booleanEnable strict validation mode
Example:
Request:
{
"schema": {
"@context": "https://schema.org",
"@type": "Article",
"headline": "Test Article"
},
"strict": true
}
Response:
{
"valid": false,
"errors": [
{
"field": "author",
"message": "Required property 'author' is missing",
"severity": "error"
}
],
"warnings": []
}
GET
/api/types
Get list of supported schema types
Parameters:
category
stringFilter by category (content, business, etc.)
Example:
Request:
GET /api/types?category=content
Response:
{
"types": [
{
"name": "Article",
"description": "News articles, blog posts, and editorial content",
"required_fields": ["headline", "author", "datePublished"],
"optional_fields": ["image", "publisher", "articleBody"]
},
{
"name": "BlogPosting",
"description": "Blog posts and personal articles",
"required_fields": ["headline", "author", "datePublished"],
"optional_fields": ["image", "publisher", "articleBody"]
}
]
}
Official SDKs
Use our official libraries for faster integration
🟨
JavaScript/Node.js
Installation:
npm install @schemagen/sdk
Usage:
import { SchemaGen } from '@schemagen/sdk';
const client = new SchemaGen('your-api-key');
const schema = await client.generate({
type: 'article',
data: {
headline: 'My Article Title',
author: 'John Doe',
datePublished: '2024-01-15'
}
});
🐍
Python
Installation:
pip install schemagen-python
Usage:
from schemagen import SchemaGen
client = SchemaGen('your-api-key')
schema = client.generate(
type='article',
data={
'headline': 'My Article Title',
'author': 'John Doe',
'datePublished': '2024-01-15'
}
)
🐘
PHP
Installation:
composer require schemagen/php-sdk
Usage:
<?php
use SchemaGen\Client;
$client = new Client('your-api-key');
$schema = $client->generate([
'type' => 'article',
'data' => [
'headline' => 'My Article Title',
'author' => 'John Doe',
'datePublished' => '2024-01-15'
]
]);
Rate Limits
Free Tier:1,000 requests/month
Pro Tier:10,000 requests/month
Enterprise:Unlimited
Rate limits are enforced per API key. Upgrade your plan for higher limits.
Support
API Status: status.schemagen.com
Documentation: docs.schemagen.com
Support: api-support@schemagen.com
GitHub: github.com/schemagen/api