Skip to Content
API ReferenceEndpointsWidget JSON-LD Schema

Widget JSON-LD Schema

GET/api/v1/widgets/{id}/schema

Returns 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

NameTypeDescription
idstringThe unique widget identifier.

Response

Content-Type

Content-Type: application/ld+json

Cache Headers

Cache-Control: public, s-maxage=3600, stale-while-revalidate=86400

Responses 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

StatusDescription
404 Not FoundWidget with the given ID does not exist.
429 Too Many RequestsRate limit exceeded.
Last updated on