Guidelines & Conventions
A quick overview of base URLs, authentication, formats, pagination, rate limits, and error responses in the Yotpo UGC API.
🧭 Guidelines & Conventions
Before you start using the Yotpo API, we recommend reviewing these key guidelines to ensure a smooth development experience.
🌐 Protocol Support
Use HTTPS for every request. Requests sent over HTTP get a 301 redirect to HTTPS, and many HTTP clients turn a redirected POST into a GET, so writes sent over HTTP can fail.
🌍 Base URLs
Yotpo provides two base URLs depending on the type of operation:
| Base URL | Description |
|---|---|
https://api.yotpo.com | Authenticated merchant operations and all writes (creating reviews, metadata, coupons, analytics). |
https://api-cdn.yotpo.com | CDN-backed, read-only endpoints for storefront display, such as product reviews and star ratings. |
📌 When to Use Each
- Use
api.yotpo.comfor operations that involve private data or change state (for example,POSTrequests). - Use
api-cdn.yotpo.comfor high-traffic, read-only endpoints used in shopper-facing interfaces, such as a product reviews widget.
🔑 Authentication at a Glance
| Endpoints | Authentication |
|---|---|
Storefront reads on api-cdn.yotpo.com (v1 widget endpoints, V3 storefront endpoints, bottom lines) | None. Your store ID in the path identifies the store. |
Most merchant endpoints on api.yotpo.com | Access token in the X-Yotpo-Token header |
| Insights API | Access token in an Authorization: Bearer header |
| Custom albums | Access token in the utoken query parameter |
See Authenticate and make your first call for how to get a token.
📄 Data Format
Request and response bodies use JSON, encoded as UTF-8. Send this header on every request that has a body:
Content-Type: application/jsonA few endpoints return other formats, for example plain-text error messages and the HTML returned by the LLM schema endpoint. Each endpoint's reference page shows its response types.
📚 Pagination
Endpoints that return lists are paginated. The parameter names depend on the API family:
| API family | Parameters | Limits |
|---|---|---|
| v1 merchant endpoints, such as Retrieve all reviews | page, count | Retrieve all reviews returns at most 100 reviews per page |
v1 storefront widget endpoints | page, per_page | Default 10, maximum 150 |
| V3 storefront endpoints | page, perPage | Default 5, maximum 150. Retrieve bottomline scores: maximum 10, and both parameters are required |
| Insights API | paging.page, paging.per_page in the request body | page starts at 0 |
page starts at 1 everywhere except the Insights API. When you request more than the maximum, most endpoints silently return the maximum instead of an error, so check pagination.perPage (or per_page) in the response.
Example:
GET https://api-cdn.yotpo.com/v1/widget/YOUR_STORE_ID/products/YOUR_PRODUCT_ID/reviews.json?page=2&per_page=10{
"status": { "code": 200, "message": "OK" },
"response": {
"pagination": { "page": 2, "per_page": 10, "total": 756 },
"reviews": []
}
}total is the total number of items across all pages, not the number of pages.
🚦 Rate Limiting
To ensure stability and fairness, API endpoints are rate-limited.
- If you exceed the allowed limit, you'll receive a
429 Too Many Requestserror. - Storefront limits are counted per IP address. Per-app-key limits are shared by everything that uses your store ID.
- Where applicable, rate limits are documented per endpoint.
📊 Rate Limit Headers
API responses include rate limiting headers that provide real-time information about your current usage:
| Header | Description |
|---|---|
ratelimit-limit | The maximum number of requests allowed in the current time window |
ratelimit-remaining | The number of requests remaining in the current time window |
ratelimit-reset | The time (in seconds) until the rate limit resets |
x-ratelimit-limit-minute | The maximum number of requests allowed per minute |
x-ratelimit-remaining-minute | The number of requests remaining in the current minute |
Note:
Rate limit values vary between endpoints and may change based on your account tier or usage patterns. Read the headers instead of hard-coding a limit.
✅ Best Practices
To avoid hitting rate limits and ensure optimal API performance:
-
Monitor Rate Limit Headers: Check the
ratelimit-remainingheader in responses to track your usage and avoid unexpected throttling. -
Implement Exponential Backoff: If you receive a
429 Too Many Requestserror, wait before retrying. Use theratelimit-resetheader to determine when to retry, or implement exponential backoff (e.g., wait 1 second, then 2 seconds, then 4 seconds). -
Batch Requests When Possible: Instead of making multiple individual requests, use batch endpoints (for example, Retrieve bottomline scores for a category page) to reduce the total number of API calls.
-
Cache Responses: For read-only operations, cache responses on your side. Responses are sent with
Cache-Control: no-store, so your HTTP client and browser won't cache them for you. -
Use Pagination Efficiently: When retrieving large datasets, use the page size limits above to minimize the number of requests needed.
-
Handle Errors Gracefully: Implement proper error handling for
429responses, including logging and alerting, so you can adjust your request patterns proactively.
📈 Data Freshness
Storefront data is not real-time. For example, Retrieve reviews for a product returns data with a delay of up to 3 hours, and new reviews also pass through your moderation settings before they appear. When a delay applies, it is documented on that endpoint's page.
📡 Status Codes and Errors
Yotpo APIs use standard HTTP status codes: 200 for success, 400 for an invalid request, 401 or 403 for a missing or invalid token, 404 for an unknown store, resource or path, 429 when you exceed a rate limit, and 500 for a server error.
Most api.yotpo.com errors return a status object with message, code, error_type and uuid. Log the uuid: it identifies the request if you contact Yotpo support. Some errors are plain text, and storefront endpoints return 200 with no data for an unknown product ID.
See Errors for every error body and how to handle each status code, and Testing your integration for how to test without affecting real shoppers.
🧩 Parameters Format
Make sure all parameters follow the correct format to avoid failed requests.
| Parameter | Format | Example |
|---|---|---|
email | user@domain | [email protected] |
URL | Full URL, including https:// | https://www.example.com/products/usb-cable |
Date | YYYY-MM-DD | 2017-12-31 |
URL-encode query parameter values. For example, send + in an email address as %2B. Otherwise it is read as a space.
Product IDs must match the external product ID your store already sends to Yotpo (for example, the Shopify product ID or SKU), and support only letters, digits, _, and -.
✅ Final Tips
- Be sure to read endpoint-specific documentation for any extra requirements.
- Test against a dedicated test store before using production data. Write calls, such as creating reviews or deleting personal data, act on real data.
- Subscribe to the Changelog to hear about API and documentation changes.
Updated 12 days ago
What’s Next
Authentication and how to get started with your API credentials
