---
updatedAt: 2026-10-29T08:22:22.000Z
agentTools:
  projectIndex: https://docs.yotpo.com/llms.txt
---

# Rate limiting

How to handle rate limits and avoid 429 errors when making API requests.

The Core API enforces rate limits to ensure reliable performance for all users. This guide explains how rate limits work and how to handle them in your integration.

## How rate limiting works

**Limit:** 5 requests per second per store

The limit applies to your **Store ID** (app\_key). All API requests using the same Store ID count toward this limit, regardless of endpoint or access token.

### What happens when you exceed the limit

If you make more than 5 requests in a 1-second window, you'll receive:

**HTTP 429 Too Many Requests**, with a `Retry-After` header:

```json
{
  "message": "API rate limit exceeded",
  "request_id": "3558bb15ae77d746ad12257fbe748529"
}
```

The request is not processed. You must retry after waiting.

***

## Monitor your rate limit usage

Every API response includes headers showing your current rate limit status:

```
RateLimit-Limit: 5
RateLimit-Remaining: 3
RateLimit-Reset: 1
```

### Headers explained

| Header                | Description                                                 | Example                            |
| --------------------- | ----------------------------------------------------------- | ---------------------------------- |
| `RateLimit-Limit`     | Requests allowed per second                                 | `5`                                |
| `RateLimit-Remaining` | Number of requests remaining in the current 1-second window | `3` (you can make 3 more requests) |
| `RateLimit-Reset`     | Seconds until the window resets                             | `1`                                |
| `Retry-After`         | On `429` responses only: seconds to wait before retrying    | `1`                                |

### Reading the headers

```bash
curl -i --request GET \
  --url https://api.yotpo.com/core/v3/stores/{store_id}/products \
  --header 'X-Yotpo-Token: YOUR_ACCESS_TOKEN'
```

**Response headers:**

```
HTTP/1.1 200 OK
RateLimit-Limit: 5
RateLimit-Remaining: 4
RateLimit-Reset: 1
...
```

Check `RateLimit-Remaining` after each request. When it reaches `0`, wait `RateLimit-Reset` seconds before making the next request.

***

## Handle 429 errors

When you receive a 429 error, your integration should:

1. **Pause immediately** — Don't make more requests
2. **Wait before retrying** — Use a backoff strategy
3. **Retry the request** — Once the wait period ends

### Basic retry logic

```python
import time
import requests

def make_request(url, headers):
    response = requests.get(url, headers=headers)
    
    if response.status_code == 429:
        # Wait 1 second and retry
        time.sleep(1)
        return make_request(url, headers)
    
    return response
```

### Recommended backoff strategy

**Fixed 1-second wait** (simplest approach):

Wait 1 second after every 429, then retry. Since the rate limit resets every second, this ensures you're within a fresh window.

```python
if response.status_code == 429:
    time.sleep(1)
    # Retry request
```

**Exponential backoff** (for burst scenarios):

If you're hitting 429s repeatedly, exponential backoff prevents overwhelming the API:

```python
import time

def make_request_with_backoff(url, headers, max_retries=3):
    for attempt in range(max_retries):
        response = requests.get(url, headers=headers)
        
        if response.status_code != 429:
            return response
        
        # Exponential backoff: 1s, 2s, 4s
        wait_time = 2 ** attempt
        time.sleep(wait_time)
    
    raise Exception("Max retries exceeded")
```

**Use the Retry-After header** (most precise):

Both `Retry-After` and `RateLimit-Reset` are a number of seconds to wait, not a timestamp:

```python
if response.status_code == 429:
    wait_time = int(response.headers.get('Retry-After') or response.headers.get('RateLimit-Reset') or 1)
    time.sleep(max(wait_time, 1))
    # Retry request
```

***

## Best practices

### 1. Optimize your requests

**Fetch only what you need:**

```bash
# ❌ Bad: Fetch all products every time
GET /core/v3/stores/{store_id}/products

# ✅ Good: Filter by last update time
GET /core/v3/stores/{store_id}/products?updated_at_min=2024-01-01T00:00:00Z
```

**Use appropriate page sizes:**

```bash
# Fetch 100 products per request (max allowed)
GET /core/v3/stores/{store_id}/products?limit=100
```

### 2. Cache responses

Store frequently accessed data locally to reduce API calls:

```python
import time

cache = {}
CACHE_TTL = 300  # 5 minutes

def get_products(store_id, token):
    cache_key = f"products_{store_id}"
    
    # Check cache
    if cache_key in cache:
        data, timestamp = cache[cache_key]
        if time.time() - timestamp < CACHE_TTL:
            return data
    
    # Fetch from API
    response = make_request(url, headers)
    cache[cache_key] = (response.json(), time.time())
    return response.json()
```

### 3. Distribute requests evenly

**Avoid bursts:**

```python
# ❌ Bad: Process 100 orders at once
for order in orders:
    create_order(order)

# ✅ Good: Add delay between requests
for order in orders:
    create_order(order)
    time.sleep(0.2)  # 5 requests/second
```

**Batch operations across time:**

Instead of syncing your entire catalog at once, spread updates over time:

```python
# Sync 500 products per minute (well under 5 req/sec)
for batch in product_batches:
    for product in batch:
        update_product(product)
        time.sleep(0.2)
    time.sleep(60)  # Wait 1 minute between batches
```

### 4. Monitor RateLimit-Remaining

Proactively throttle before hitting the limit:

```python
def make_smart_request(url, headers):
    response = requests.get(url, headers=headers)
    
    remaining = int(response.headers.get('RateLimit-Remaining', 5))
    
    # If only 1 request left, wait before next call
    if remaining <= 1:
        time.sleep(0.5)
    
    return response
```

### 5. Use webhooks for real-time updates

Instead of polling for changes, subscribe to [webhooks](https://docs.yotpo.com/docs/about-webhook-events) to receive notifications:

```python
# ❌ Bad: Poll for new reviews every minute
while True:
    reviews = get_reviews()
    time.sleep(60)

# ✅ Good: Subscribe to review_create webhook
# Yotpo pushes notifications when reviews are created
```

### 6. Implement graceful degradation

If rate-limited, don't fail completely:

```python
def sync_products():
    try:
        products = fetch_products()
        update_local_catalog(products)
    except RateLimitError:
        # Log and continue with stale data
        log.warning("Rate limited, using cached data")
        products = load_from_cache()
    
    return products
```

***

## Common scenarios

### Bulk data sync

**Problem:** Syncing 10,000 products would take 2,000 seconds (33 minutes) at 5 req/sec.

**Solution:**

1. **Use pagination efficiently** — Fetch 100 products per request (max `limit`)
2. **Run during off-peak hours** — Sync overnight or during low-traffic periods
3. **Sync incrementally** — Use `updated_at_min` to fetch only changed products
4. **Consider the aggregated endpoint** — For orders, use [Send aggregated order info](https://docs.yotpo.com/reference/send-aggregated-order-info) to send all data in one call

### Real-time order processing

**Problem:** Processing orders as they come in, unpredictable volume.

**Solution:**

1. **Queue requests** — Use a job queue to smooth bursts
2. **Monitor RateLimit-Remaining** — Throttle proactively
3. **Implement retry logic** — Handle 429s gracefully with exponential backoff

```python
from queue import Queue
import time

order_queue = Queue()

def process_orders():
    while True:
        if order_queue.empty():
            time.sleep(0.1)
            continue
        
        order = order_queue.get()
        
        try:
            create_order(order)
            time.sleep(0.2)  # Rate limit safety margin
        except RateLimitError:
            # Put back in queue and wait
            order_queue.put(order)
            time.sleep(1)
```

### Multiple integrations

**Problem:** You have multiple systems hitting the API with the same Store ID.

**Solution:**

1. **Coordinate across systems** — Share rate limit state
2. **Centralize API calls** — Route all requests through one service
3. **Prioritize critical operations** — Ensure high-priority calls succeed

***

## Troubleshooting

### Hitting 429s frequently

**Check:**

1. Are you making unnecessary requests? (Use caching)
2. Are multiple systems using the same Store ID?
3. Are you bursting requests? (Distribute evenly)
4. Are you retrying failed requests properly? (Check backoff logic)

**Solution:** Review the [best practices](#best-practices) above and optimize your integration.

### RateLimit-Remaining always shows 0

**Cause:** You're consistently exceeding 5 requests per second.

**Solution:**

1. Add `time.sleep(0.2)` between requests (ensures ≤5 req/sec)
2. Monitor `RateLimit-Remaining` and pause when needed
3. Reduce concurrent API calls if running multi-threaded

### Different endpoints, same limit

**Expected behavior:** The 5 req/sec limit applies across **all endpoints** for your Store ID.

Creating a product and fetching an order both count toward the same limit.

***

## Summary

**Key takeaways:**

* Limit is **5 requests/second per Store ID**
* Monitor `RateLimit-Remaining` and `RateLimit-Reset` headers
* Wait **1 second** after receiving 429, then retry
* Optimize requests: cache, batch, filter, use webhooks
* Distribute requests evenly — avoid bursts

## Related

* [Guidelines and conventions](https://docs.yotpo.com/docs/guidelines-and-conventions) — General API guidelines
* [Error handling](https://docs.yotpo.com/docs/error-handling) — How to handle other error types
* [Webhooks](https://docs.yotpo.com/docs/about-webhook-events) — Real-time notifications (avoid polling)

# Sibling pages

* [What you can build](https://docs.yotpo.com/docs/what-you-can-build.md)
* [How to use the Core API](https://docs.yotpo.com/docs/how-to-use.md)
* [Guidelines & conventions](https://docs.yotpo.com/docs/guidelines-and-conventions.md)
* [App key vs. Store ID](https://docs.yotpo.com/docs/store-id-app-key.md)
* [Errors](https://docs.yotpo.com/docs/error-handling.md)
* [Testing your integration](https://docs.yotpo.com/docs/testing-your-integration.md)
* [Idempotency](https://docs.yotpo.com/docs/idempotency.md)
* [Working with entity identifiers](https://docs.yotpo.com/docs/working-with-entity-identifiers.md)
* [Working with custom properties](https://docs.yotpo.com/docs/working-with-custom-properties.md)
* [Connect to Yotpo's MCP Servers](https://docs.yotpo.com/docs/connect-to-yotpo-mcp.md)