Documentation Index
Fetch the complete documentation index at: https://dub-partner-network.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Dub’s API rate limiting is in conformance with the IETF standard:
| Header Name | Description |
|---|
X-RateLimit-Limit | The maximum number of requests that the consumer is permitted to make per hour. |
X-RateLimit-Remaining | The number of requests remaining in the current rate limit window. |
X-RateLimit-Reset | The time at which the current rate limit window resets in UTC epoch seconds. |
Retry-After | The number of seconds to wait before retrying the request again. |
Dub’s API is capped at 60 requests per minute per key on the Free plan, with elevated limits for Pro plan and above.
This is implemented to ensure a fair usage policy so that excessive use by a single user does not adversely affect the performance and usage of the API by others.
You’ll receive a 429 Too Many Requests response code if the rate limit is exceeded.
Rate limits by plan
Depending on your Dub plan, you can expect the following rate limits:
| Plan | Rate limit |
|---|
| Free | 60 requests per minute |
| Pro | 600 requests per minute |
| Business | 1,200 requests per minute |
| Advanced | 3,000 requests per minute |
| Enterprise | Custom – reach out to sales for details |
Rate limits by endpoint
Dub’s analytics endpoints have separate, per-second rate limits to ensure optimal performance:
| Plan | Analytics API rate limit |
|---|
| Free | N/A |
| Pro | 2 requests per second |
| Business | 4 requests per second |
| Advanced | 8 requests per second |
| Enterprise | Custom – reach out to sales for details |
Analytics endpoints include:
All other API endpoints use the standard rate limits listed in the Rate limits by plan section above.
How to comply with rate limits
Here’s how you can optimize your API setup to comply with rate limits:
1. Bulk link creation
If you need to create a lot of links within a short period of time, try our bulk link creation endpoint instead (create up to 100 links in one API call)
await dub.links.createMany([
{
url: "https://google.com",
},
{
url: "https://twitter.com",
},
{
url: "https://linkedin.com",
},
]);
2. Fetch workspace-level analytics
If you’re using our Analytics API, instead of retrieving the clicks count for every single link, try making a single API call to get workspace-level click analytics instead.
await dub.analytics.retrieve({
groupBy: "top_links",
start: "4 hours ago", // we support natural language for start/end params
});
3. Leverage webhooks
If you’re expecting high volume, fast-changing data (e.g. thousands of clicks on your links per day) and would prefer to store the data on your end, we recommend using our real-time webhooks feature instead.
Webhooks are push-based, meaning that Dub will send events to your webhook receiver endpoint when specific events occur, while a REST API is pull-based, meaning that you need to consistently poll the API endpoint to get real-time updates.
Check out our webhooks documentation to learn more.