Rate limits and pagination
How many requests a Bridge API key can make, how to tell when you're close to the limit, and how to page through long lists.
Rate limits
Each API key can make 120 requests per minute. Every response includes headers that show where you are:
| Header | Meaning |
|---|---|
RateLimit-Limit | Requests allowed per minute (120). |
RateLimit-Remaining | Requests left in the current minute. |
RateLimit-Reset | Seconds until the limit resets. |
Over the limit, requests get a 429 error with the code rate_limited:
{
"status": "error",
"error": {
"code": "rate_limited",
"message": "Too many requests. The limit is 120 per minute per key."
}
}
Wait for RateLimit-Reset seconds before trying again. To sync large amounts of data, request 100 items at a time instead of many small requests.
Pagination
GET /bookings returns results in pages. Control the page with two query parameters:
| Parameter | Default | Meaning |
|---|---|---|
take | 50 | How many results to return, from 1 to 100. |
skip | 0 | How many results to skip before the first one returned. |
The response includes a pagination object:
{
"status": "success",
"data": [ ... ],
"pagination": {
"total": 230,
"take": 100,
"skip": 100,
"has_more": true
}
}
totalis the number of results that match your filters.has_moreistruewhile there are more results after this page.
To read every page, increase skip by take until has_more is false:
const headers = { Authorization: `Bearer ${process.env.BRIDGE_API_KEY}` };
const bookings = [];
let skip = 0;
let hasMore = true;
while (hasMore) {
const url = `https://api.meetonbridge.com/v1/bookings?take=100&skip=${skip}`;
const body = await (await fetch(url, { headers })).json();
bookings.push(...body.data);
hasMore = body.pagination.has_more;
skip += 100;
}
Other list endpoints, such as GET /booking-pages and GET /collections, return every result in one response.