Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Handle Figma REST API rate limits with exponential backoff and request queuing. Use when encountering 429 errors, implementing retry logic, or optimizing API request throughput for Figma. Trigger with phrases like "figma rate limit", "figma throttling", "figma 429", "figma retry", "figma backoff".
.claude/skills/jeremylongshore-figma-rate-limits/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 34% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 45% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 85% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 40% | 0% |
Figma uses a leaky bucket algorithm for rate limiting. When the bucket is full, the API returns 429 with a Retry-After header. Limits vary by plan tier, seat type, and endpoint tier.
Endpoint tiers (limits are per-user, per-minute):
| Tier | Endpoints | Typical Limit | |------|-----------|--------------| | Tier 1 | GET /v1/files, GET /v1/images | Higher quota | | Tier 2 | GET /v1/files/:key/comments, GET /v1/files/:key/variables/local | Moderate quota | | Tier 3 | GET /v1/teams/:id/components, GET /v1/teams/:id/styles | Lower quota |
429 response headers:
| Header | Type | Meaning | |--------|------|---------| | Retry-After | Integer (seconds) | Wait this long before retrying | | X-Figma-Plan-Tier | String | Your Figma plan level | | X-Figma-Rate-Limit-Type | String | "low" or "high" rate limit | | X-Figma-Upgrade-Link | String | URL to upgrade for higher limits |
typescriptasync function figmaFetchWithRetry( path: string, token: string, maxRetries = 5 ): Promise<any> { for (let attempt = 0; attempt <= maxRetries; attempt++) { const res = await fetch(`https://api.figma.com${path}`, { headers: { 'X-Figma-Token': token }, }); if (res.status === 429) { const retryAfter = parseInt(res.headers.get('Retry-After') || '60'); const limitType = res.headers.get('X-Figma-Rate-Limit-Type') || 'unknown'; if (attempt === maxRetries) { throw new Error(`Rate limited after ${maxRetries} retries (${limitType})`); } // Use the Retry-After header -- Figma tells you exactly how long to wait const jitter = Math.random() * 1000; const delay = retryAfter * 1000 + jitter; console.warn(`429 (${limitType}). Waiting ${(delay/1000).toFixed(1)}s (attempt ${attempt + 1})`); await new Promise(r => setTimeout(r, delay)); continue; } if (res.status >= 500 && attempt < maxRetries) { // Server errors: exponential backoff without Retry-After const delay = Math.min(1000 * Math.pow(2, attempt), 30000); await new Promise(r => setTimeout(r, delay)); continue; } if (!res.ok) { throw new Error(`Figma API error: ${res.status} ${await res.text()}`); } return res.json(); } }
typescriptimport PQueue from 'p-queue'; // Limit concurrent requests to avoid bursting the bucket const figmaQueue = new PQueue({ concurrency: 3, // max 3 parallel requests interval: 1000, // per second intervalCap: 5, // max 5 requests per second }); async function queuedFigmaRequest<T>( path: string, token: string ): Promise<T> { return figmaQueue.add(() => figmaFetchWithRetry(path, token)); } // Usage -- all requests are automatically queued and throttled const [file, comments, images] = await Promise.all([ queuedFigmaRequest(`/v1/files/${fileKey}`, token), queuedFigmaRequest(`/v1/files/${fileKey}/comments`, token), queuedFigmaRequest(`/v1/images/${fileKey}?ids=0:1&format=svg`, token), ]);
typescriptclass FigmaRateLimitMonitor { private requestLog: number[] = []; private windowMs = 60_000; // 1 minute window recordRequest() { this.requestLog.push(Date.now()); // Trim old entries const cutoff = Date.now() - this.windowMs; this.requestLog = this.requestLog.filter(t => t > cutoff); } getRequestsInWindow(): number { const cutoff = Date.now() - this.windowMs; return this.requestLog.filter(t => t > cutoff).length; } shouldThrottle(safetyMargin = 0.8): boolean { // If we've used 80% of a conservative estimate, slow down const estimatedLimit = 30; // Conservative estimate return this.getRequestsInWindow() > estimatedLimit * safetyMargin; } } const monitor = new FigmaRateLimitMonitor(); // Wrap every request async function monitoredFigmaFetch(path: string, token: string) { if (monitor.shouldThrottle()) { console.warn('Approaching rate limit, adding delay'); await new Promise(r => setTimeout(r, 2000)); } monitor.recordRequest(); return figmaFetchWithRetry(path, token); }
typescript// Instead of N individual /v1/files/:key/nodes requests, // batch node IDs into fewer requests async function batchFetchNodes( fileKey: string, nodeIds: string[], batchSize = 50, token: string ) { const results: Record<string, any> = {}; for (let i = 0; i < nodeIds.length; i += batchSize) { const batch = nodeIds.slice(i, i + batchSize); const ids = encodeURIComponent(batch.join(',')); const data = await queuedFigmaRequest( `/v1/files/${fileKey}/nodes?ids=${ids}`, token ); Object.assign(results, data.nodes); } return results; }
Retry-After header compliance| Scenario | Detection | Response | |----------|-----------|----------| | Single 429 | Retry-After header | Wait exactly that duration | | Repeated 429s | Multiple retries exhausted | Log, alert, back off longer | | low rate limit type | X-Figma-Rate-Limit-Type: low | Consider upgrading Figma plan | | Batch too large | 400 Bad Request | Reduce batch size to 50 IDs |
Reproduce a 429 and read the headers that drive every pattern in this skill (Step 1):
bashfor i in $(seq 1 60); do curl -s -o /dev/null -D - -H "X-Figma-Token: ${FIGMA_PAT}" \ "https://api.figma.com/v1/files/${FIGMA_FILE_KEY}?depth=1" | /usr/bin/grep -iE '^(HTTP|retry-after)' done | sort | uniq -c
text54 HTTP/2 200 6 HTTP/2 429 6 retry-after: 30
Collapse N per-node calls into one batched request (Step 5) — the single biggest budget win:
bashcurl -s -H "X-Figma-Token: ${FIGMA_PAT}" \ "https://api.figma.com/v1/files/${FIGMA_FILE_KEY}/nodes?ids=1:2,1:5,1:9,2:14" | jq '.nodes | keys'
Backoff implementation and the queue: references/implement-exponential-backoff.md, references/request-queue-with-concurrency-control.md.
For security configuration, see figma-security-basics.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 20,170 | 43,743 | +117% | 1 | 1 | 0% | 4,290 | 5,755 | +34% | 0 | 0 | — |
case-02 | fail→pass | 21,985 | 19,301 | -12% | 1 | 1 | 0% | 4,113 | 5,964 | +45% | 0 | 0 | — |
case-03 | fail→pass | 20,760 | 13,718 | -34% | 1 | 1 | 0% | 4,099 | 4,873 | +19% | 0 | 0 | — |
case-04 | pass→pass | 9,961 | 6,816 | -32% | 1 | 1 | 0% | 1,977 | 3,421 | +73% | 0 | 0 | — |
case-05 | pass→pass | 12,966 | 12,945 | -0% | 1 | 1 | 0% | 2,743 | 4,740 | +73% | 0 | 0 | — |
case-06 | pass→pass | 9,279 | 9,419 | +2% | 1 | 1 | 0% | 1,873 | 3,685 | +97% | 0 | 0 | — |
case-07 | pass→pass | 9,357 | 2,812 | -70% | 1 | 1 | 0% | 1,681 | 2,654 | +58% | 0 | 0 | — |
case-08 | pass→pass | 9,588 | 3,083 | -68% | 1 | 1 | 0% | 1,708 | 2,745 | +61% | 0 | 0 | — |
case-09 | fail→pass | 13,905 | 11,391 | -18% | 1 | 1 | 0% | 2,088 | 3,859 | +85% | 0 | 0 | — |
case-10 | fail→pass | 9,406 | 2,149 | -77% | 1 | 1 | 0% | 1,754 | 2,453 | +40% | 0 | 0 | — |
case-11 | fail→pass | 12,450 | 3,332 | -73% | 1 | 1 | 0% | 1,756 | 2,662 | +52% | 0 | 0 | — |
case-12 | fail→pass | 13,284 | 907,009 | +6728% | 1 | 1 | 0% | 2,045 | 2,517 | +23% | 0 | 0 | — |
case-13 | pass→pass | 12,658 | 1,895 | -85% | 1 | 1 | 0% | 2,620 | 2,440 | -7% | 0 | 0 | — |
case-14 | fail→fail | 13,058 | 10,808 | -17% | 1 | 1 | 0% | 2,159 | 4,048 | +87% | 0 | 0 | — |
case-15 | fail→pass | 15,009 | 3,947 | -74% | 1 | 1 | 0% | 2,753 | 2,870 | +4% | 0 | 0 | — |
case-16 | fail→pass | 18,451 | 2,892 | -84% | 1 | 1 | 0% | 3,257 | 2,685 | -18% | 0 | 0 | — |
case-17 | fail→pass | 10,300 | 6,732 | -35% | 1 | 1 | 0% | 1,895 | 3,489 | +84% | 0 | 0 | — |
case-18 | fail→pass | 10,225 | 1,711 | -83% | 1 | 1 | 0% | 1,727 | 2,364 | +37% | 0 | 0 | — |
case-19 | pass→pass | 11,878 | 5,499 | -54% | 1 | 1 | 0% | 1,906 | 3,076 | +61% | 0 | 0 | — |
case-20 | pass→pass | 11,628 | 3,789 | -67% | 1 | 1 | 0% | 1,773 | 2,773 | +56% | 0 | 0 | — |
case-21 | fail→pass | 13,168 | 2,166 | -84% | 1 | 1 | 0% | 2,305 | 2,446 | +6% | 0 | 0 | — |
case-22 | fail→pass | 9,157 | 1,369 | -85% | 1 | 1 | 0% | 1,422 | 2,326 | +64% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +59 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.