> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cevoid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Server-render Rich Snippets

> Add product rating HTML and JSON-LD to the initial page response.

Use the Rich Snippets endpoint to add a visible product rating and matching Product JSON-LD to non-Shopify storefronts. Call it from your storefront server so search engines receive both values in the initial response.

## Prerequisites

Before you start, collect:

* your workspace publishable key
* a product reference
* the product page language

A market is optional when the request includes the product page URL as the referrer.

## Authenticate requests

Send your publishable key as a bearer token:

```http theme={"system"}
Authorization: Bearer cev_pk_example
```

## Render a Rich Snippet

1. Call the endpoint before returning the product page.
2. Pass a Cevoid product ID, variant ID, external product reference, or product slug as `productRef`.
3. Pass the page language. Pass a market when you know it, or send the product page URL so Cevoid can select the market.
4. Insert `html` where the rating should appear.
5. Serialize `jsonLd` into the same initial HTML response.

```bash theme={"system"}
curl "https://api.widget.cevoid.com/v1/products/prd_example/rich-snippet?market=mar_sweden&language=sv" \
  --header "Authorization: Bearer cev_pk_example"
```

Use `productRef=auto` only when you also send the product page URL in the `referer` query parameter or `Referer` header. A stable product reference is more predictable for server integrations.

## Keep one rendering snapshot

Use `html` and `jsonLd` from the same response so the visible rating matches the structured data.

Keep `data-cevoid-rich-snippet="ssr"` on the JSON-LD script so Cevoid does not add duplicate structured data when its client script loads.

```html theme={"system"}
<script type="application/ld+json" data-cevoid-rich-snippet="ssr">
  {"@context":"https://schema.org","@type":"Product"}
</script>
```

If the endpoint returns `404`, omit both outputs. No published rating is available for the request.

## Related

* [Rich Snippet API reference](./storefront-rendering/render-a-product-rich-snippet)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.