This source did not publish a separate summary. Review SKILL.md before using the skill.
SKILL.md
Bright Data Rate Limits
Overview
Handle Bright Data rate limits and concurrent request limits. Unlike traditional API rate limits, Bright Data limits are per-zone and based on concurrent connections and requests per second. The Web Scraper API trigger endpoint is limited to 20 requests/min and 60 requests/hour.
Prerequisites
Bright Data zone configured
Understanding of async/await patterns
p-queue or similar concurrency library
Instructions
Step 1: Understand Bright Data Rate Limits
Product
Concurrent Limit
Per-Minute
Notes
Residential Proxy
Based on plan
No hard cap
Charged per GB
Web Unlocker
Based on plan
No hard cap
Charged per request
Scraping Browser
Based on plan sessions
No hard cap
Charged per session
SERP API
Based on plan
No hard cap
Charged per search
Web Scraper API (trigger)
N/A
20/min, 60/hr
Async collections
Datasets API
N/A
20/min
Snapshot requests
Step 2: Implement Concurrent Request Limiter
// src/brightdata/limiter.ts
import PQueue from 'p-queue';
// Match concurrency to your Bright Data plan limits
const scrapeQueue = new PQueue({
concurrency: 10, // Max concurrent proxy requests
interval: 1000, // Per second
intervalCap: 20, // Max 20 requests per second
timeout: 120000, // Kill after 2 min
throwOnTimeout: true,
});
export async function queuedScrape(url: string): Promise<string> {
return scrapeQueue.add(async () => {
const client = getBrightDataClient();
const response = await client.get(url);
return response.data;
});
}
// Monitor queue health
scrapeQueue.on('active', () => {
console.log(`Queue: ${scrapeQueue.size} waiting, ${scrapeQueue.pending} active`);
});
// Instead of triggering per-URL, batch into single triggers
async function batchTrigger(urls: string[], batchSize = 100) {
const batches = [];
for (let i = 0; i < urls.length; i += batchSize) {
batches.push(urls.slice(i, i + batchSize));
}
console.log(`Triggering ${urls.length} URLs in ${batches.length} batches`);
for (const batch of batches) {
await rateLimitedTrigger('gd_dataset_id', batch);
}
}