DEV Community

Cover image for How to Add JSON-LD Schema for AI Search Engines (OpenAI, Perplexity, Claude)
Robert Wallace
Robert Wallace

Posted on

How to Add JSON-LD Schema for AI Search Engines (OpenAI, Perplexity, Claude)

`You've got perfect meta descriptions, proper Open Graph tags, and a sitemap that Googlebot loves. So why does ChatGPT Search return outdated info about your app, and why does Perplexity hallucinate your pricing?

Because AI search engines don't parse the web the way Google does. They extract structured data into their reasoning context — and if your JSON-LD is missing, incomplete, or loosely typed, the AI fills gaps with whatever it thinks is correct. That's how "probably around $20/month" becomes a confident lie in a search result.

What JSON-LD Actually Does for AI

JSON-LD (JavaScript Object Notation for Linked Data) is a way to embed structured metadata in your HTML. Traditional search engines use it for rich snippets. AI search engines use it as factual grounding — they pull your schema into their context window instead of guessing from prose.

OpenAI Search, Perplexity, and Claude-powered search all read JSON-LD <script type="application/ld+json"> blocks. Get it right, and the AI cites your exact features, pricing, and availability. Get it wrong or miss it, and the AI infers whatever it can from body text — including your competitor's data.

The Schema Types That Matter for AI

Not all schema types are created equal. For AI extraction, these perform best:

SoftwareApplication

Perfect for SaaS tools and apps. Include name, applicationCategory, operatingSystem, offers (with price and priceCurrency), and featureList. AI models are trained to pull applicationCategory directly.

`json
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "MyTool",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Web",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
}
}

FAQPage

When users ask "Does X support Y?" in Perplexity, the answer often comes from FAQ schema. Each mainEntity with acceptedAnswer is a direct Q&A pair AIs extract verbatim.

Article

For blog posts and docs, use Article or TechArticle with datePublished, author, and headline. AI search engines prioritize schema dates over visible text when answering "is this current?"

WebApplication

If you offer a browser-based tool, this tells AI crawlers it's an interactive app (not just a landing page). Include browserRequirements and softwareVersion.

Common Mistakes That Break AI Extraction

Missing @id: Without a unique identifier, AI models can't distinguish your schema from similar ones on the page. Always add @id: "https://yoursite.com/#app".

Wrong @context URL: Some generators output "@context": "http://schema.org" instead of "https://schema.org". The https variant is the current standard — the http one works but is deprecated and some AI parsers treat it as reduced confidence.

Nested types without explicit roles: If your software is also a product, use additionalType rather than nesting blindly. Flat, explicit schemas parse more reliably than deeply nested ones.

Missing required properties: Each schema type has required fields. SoftwareApplication demands applicationCategory and operatingSystem. Omitting them means the schema block may be ignored entirely.

Validating Your Schema

Google's Rich Results Test is fine for traditional SEO, but it doesn't simulate AI extraction. For that, copy your JSON-LD into a validator that checks for: valid @context, all required properties, correct pricing format, and resolvable URLs in @id.


I build lightweight browser-based tools at utilitylab.dev. If you want a free, no-login tool to generate and validate JSON-LD schema optimized for AI search engines like OpenAI, Perplexity, and Claude, there's one at https://utilitylab.dev/ai-search-schema-generator.

Top comments (0)