Widget JSON-LD Schema
GET
/api/v1/widgets/{id}/schemaReturns structured data in JSON-LD format for a specific review widget. This enables Google rich snippets with star ratings in search results, improving SEO and click-through rates.
Authentication
None — this is a public endpoint. No API key is required.
Rate Limit
60 requests per minute per IP address.
Path Parameters
| Name | Type | Description |
|---|---|---|
id | string | The unique widget identifier. |
Response
Content-Type
Content-Type: application/ld+jsonCache Headers
Cache-Control: public, s-maxage=3600, stale-while-revalidate=86400Responses are cached for 1 hour at the CDN level with a 24-hour stale-while-revalidate window.
200 OK
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Your Business",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.5",
"reviewCount": "142"
},
"review": [
{
"@type": "Review",
"author": {
"@type": "Person",
"name": "Jane D."
},
"reviewRating": {
"@type": "Rating",
"ratingValue": "5"
},
"reviewBody": "Excellent service!"
}
]
}Usage
Add the JSON-LD schema to your website’s <head> to enable rich snippets:
<script type="application/ld+json" src="https://app.prooflio.io/api/v1/widgets/YOUR_WIDGET_ID/schema"></script>Or fetch and inline it server-side:
const response = await fetch(
'https://app.prooflio.io/api/v1/widgets/YOUR_WIDGET_ID/schema'
);
const schema = await response.json();
// Inject into your page's <head>
const script = document.createElement('script');
script.type = 'application/ld+json';
script.textContent = JSON.stringify(schema);
document.head.appendChild(script);Error Responses
| Status | Description |
|---|---|
404 Not Found | Widget with the given ID does not exist. |
429 Too Many Requests | Rate limit exceeded. |
Last updated on