Structured Data Validation API
Validate JSON-LD structured data on any URL. Built for AI agents, CI pipelines, and developers automating schema.org checks.
Quick start
Authentication
Include your API key in the X-Api-Key header on every request.
curl -X POST https://xoocode.com/api/v1/validate/url/ \
-H "Content-Type: application/json" \
-H "X-Api-Key: xoo_your_key_here" \
-d '{"url": "https://example.com"}'Your API key is shown once when created. Store it securely. If lost, delete it and create a new one.
Tiers
Free
No credit card required
- 50 requests per month
- Both endpoints included
- Rate limit headers on every response
Pro
$19.99/monthFor production workloads
- 500 requests per day
- Both endpoints included
- Priority support
Endpoints
POST /api/v1/validate/url/
Fetch a URL and validate all JSON-LD blocks found on the page.
Request:
{
"url": "https://example.com/product-page"
}Response (200):
{
"source": "https://example.com/product-page",
"summary": {
"blocks": 2,
"errors": 1,
"warnings": 3
},
"blocks": [
{
"index": 0,
"type": "Product",
"blockId": null,
"blockName": "Widget Pro",
"snippet": "{\n \"@context\": \"https://schema.org\",\n \"@type\": \"Product\",\n \"name\": \"Widget Pro\",\n ...",
"errors": [
{
"path": "offers[0].priceCurrency",
"value": "dollars",
"message": "\"dollars\" is not a recognized ISO 4217 currency code",
"suggestion": "USD"
}
],
"warnings": [
{
"path": "brand",
"value": null,
"message": "Missing property \"brand\" (recommended by Google for Product rich result)"
}
]
}
],
"prompt": "# Structured Data Fix Instructions\n\nFix the following...",
"usage": {
"tier": "free",
"period": "month",
"used": 5,
"limit": 50,
"remaining": 45
}
}POST /api/v1/validate/raw/
Validate raw JSON-LD markup directly without fetching a URL.
Request:
{
"jsonld": "{\n \"@context\": \"https://schema.org\",\n \"@type\": \"Organization\",\n \"name\": \"Acme Corp\"\n}"
}Response: Same shape as the URL endpoint.
Response format
Top-level fields in every response:
| Field | Type | Description |
|---|---|---|
source | string | The URL tested or "Pasted markup" |
summary | object | Total blocks, errors, warnings |
blocks | array | Per-block validation results |
prompt | string | Markdown fix instructions ready to paste into an AI agent |
usage | object | Current rate limit status |
Each block contains:
| Field | Type | Description |
|---|---|---|
type | string | Schema.org @type (e.g. "Product", "Organization") |
blockId | string? | @id from the block |
blockName | string? | name or headline from the block |
snippet | string | First 5 lines of the JSON for context |
errors | array | Validation errors with path, value, message, suggestion |
warnings | array | Same shape as errors |
Rate limiting
Every API response includes rate limit headers:
| Header | Example | Description |
|---|---|---|
X-RateLimit-Limit | 50 | Maximum requests in the current period |
X-RateLimit-Remaining | 45 | Requests remaining |
X-RateLimit-Reset | 2026-05-01T00:00:00.000Z | When the limit resets |
X-RateLimit-Period | month | Current billing period (month or day) |
When you exceed the limit, the API returns 429 with a Retry-After header.
Error codes
| Code | HTTP Status | Description |
|---|---|---|
MISSING_API_KEY | 401 | No X-Api-Key header provided |
INVALID_API_KEY | 401 | API key not recognized |
RATE_LIMITED | 429 | Rate limit exceeded |
INVALID_URL | 400 | URL is missing or malformed |
INVALID_JSON | 400 | Could not parse the JSON-LD input |
NO_BLOCKS | 200 | No JSON-LD blocks found on the page |
FETCH_FAILED | 502 | Could not fetch the provided URL |
Add to your AI agent
Copy this instruction prompt to give any AI coding agent structured data validation capabilities.
# Structured Data Validation
You can validate JSON-LD structured data on any URL using the XooCode API.
## Setup
1. Sign up at https://xoocode.com/signup
2. Verify your email (check inbox for magic link)
3. Go to https://xoocode.com/account/api-keys
4. Click "Create API key", name it, and copy the key
5. Store the key securely (you will not see it again)
## Validating a URL
POST https://xoocode.com/api/v1/validate/url/
Headers: Content-Type: application/json, X-Api-Key: YOUR_KEY
Body: { "url": "https://example.com" }
## Validating raw JSON-LD
POST https://xoocode.com/api/v1/validate/raw/
Headers: Content-Type: application/json, X-Api-Key: YOUR_KEY
Body: { "jsonld": "{ \"@context\": \"https://schema.org\", ... }" }
## Interpreting results
The response includes:
- summary: total blocks, errors, and warnings found
- blocks: per-block details with path, value, message, and suggested fix for each finding
- prompt: ready-to-use markdown fix instructions
- usage: your current API quota
## Fixing issues
Use the "prompt" field from the response as your fix guide. It contains step-by-step instructions for each finding with suggested values. For missing properties where no value is suggested, ask the user what value to use.
If you have access to the codebase, locate the files that generate each schema block and apply the fixes directly.
## Free tier: 50 requests/month. Pro (19.99/month): 500 requests/day.
## Docs: https://xoocode.com/api-docs