Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.schemagen.io/llms.txt

Use this file to discover all available pages before exploring further.

The validate endpoint analyzes a JSON-LD object you already have and tells you whether it is valid, what types it detected, and what issues or improvements it found. It checks against the Schema.org specification, Google Rich Result eligibility guidelines, and general SEO recommendations. It also returns a corrected version of your schema when it can infer the right fix. This endpoint is useful for auditing JSON-LD you sourced from third-party tools, validating schemas before publishing them to your SDN, or building validation into your own content pipeline.

Endpoint

POST https://schemagen.io/api/validate
This endpoint does not require authentication. It is rate-limited per IP address using a separate limit from the generate endpoints.

Request body

jsonString
string
required
A JSON string representation of the JSON-LD object you want to validate. You must serialize your JSON-LD to a string before sending it. Pass the raw serialized string, not a nested JSON object.

Response

isValid
boolean
true if the JSON-LD passes all Schema.org and Google Rich Result checks with no blocking issues. false if one or more errors were found.
detectedTypes
string[]
An array of Schema.org type names detected in the JSON-LD (e.g., ["Article"], ["Product", "Offer"]). Useful for confirming the validator interpreted your schema as intended.
issues
string[]
Blocking errors that make the schema invalid. Fix all items in this array before publishing. An empty array means no blocking errors were found.
warnings
string[]
Non-blocking issues that do not invalidate the schema but may affect rich result eligibility or data quality. Review these and address where possible.
schemaOrgIssues
string[]
Issues specific to the Schema.org specification, such as unrecognized properties or incorrect value types for the detected schema type. May be undefined if no Schema.org-specific issues were found.
googleRichResultWarnings
string[]
Warnings from Google Rich Result guidelines — for example, missing fields that Google requires for a schema type to qualify for rich results in Search. May be undefined if not applicable.
seoRecommendations
string[]
Optional best-practice suggestions for improving the schema’s SEO value beyond minimum validity requirements. May be undefined if no recommendations apply.
correctedSchema
object | null
A corrected version of your JSON-LD with known fixable issues resolved, or null if no corrections could be inferred or the schema is already valid.

Code examples

curl -X POST "https://schemagen.io/api/validate" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonString": "{\"@context\":\"https://schema.org\",\"@type\":\"Article\",\"headline\":\"How structured data improves SEO\",\"author\":{\"@type\":\"Person\",\"name\":\"Jane Smith\"},\"datePublished\":\"2026-05-08\"}"
  }'

Example response

{
  "isValid": false,
  "detectedTypes": ["Article"],
  "issues": [],
  "warnings": [
    "The 'image' property is missing. Google recommends including an image for Article rich results."
  ],
  "schemaOrgIssues": [],
  "googleRichResultWarnings": [
    "Missing recommended property: image"
  ],
  "seoRecommendations": [
    "Add a 'description' property to improve snippet quality in search results.",
    "Include 'publisher' with an Organization and logo for full Article rich result eligibility."
  ],
  "correctedSchema": {
    "@context": "https://schema.org",
    "@type": "Article",
    "headline": "How structured data improves SEO",
    "author": {
      "@type": "Person",
      "name": "Jane Smith"
    },
    "datePublished": "2026-05-08"
  }
}

Error responses

400 — invalid request body

If jsonString is missing or the request body itself cannot be parsed, the API returns 400:
{
  "error": "Validation failed",
  "details": {
    "jsonString": {
      "_errors": ["Required"]
    }
  }
}

429 — rate limit exceeded

{
  "error": "Too many requests. Please try again later."
}
Pass the correctedSchema value back to /api/validate to confirm the corrections resolved all issues before you publish the schema to your site.