flexport-rate-limits

Featured

Handle Flexport API rate limits with exponential backoff, queue-based throttling, and response header monitoring for logistics API calls. Trigger: "flexport rate limit", "flexport 429", "flexport throttling", "flexport backoff".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Flexport Rate Limits ## Overview The Flexport API v2 enforces rate limits per API key. When exceeded, you get a `429 Too Many Requests` with `Retry-After` and `X-RateLimit-*` headers. Key limits to know: the API returns headers on every response telling you remaining quota. ## Rate Limit Headers | Header | Description | Example | |--------|-------------|---------| | `X-RateLimit-Limit` | Max requests per window | `100` | | `X-RateLimit-Remaining` | Remaining in current window | `47` | | `X-RateLimit-Reset` | Unix timestamp when window resets | `1711234567` | | `Retry-After` | Seconds to wait (only on 429) | `30` | ## Instructions ### Step 1: Monitor Rate Limit Headers ```typescript class RateLimitTracker { remaining = Infinity; resetAt = 0; update(headers: Headers) { this.remaining = parseInt(headers.get('X-RateLimit-Remaining') || '100'); this.resetAt = parseInt(headers.get('X-RateLimit-Reset') || '0') * 1000; } async waitIfNeeded() { if (this.remaining <= 2 && Date.now() < this.resetAt) { const wait = this.resetAt - Date.now() + 100; console.log(`Rate limit near. Waiting ${wait}ms`); await new Promise(r => setTimeout(r, wait)); } } } ``` ### Step 2: Exponential Backoff with Jitter ```typescript async function flexportWithRetry<T>( fn: () => Promise<Response>, maxRetries = 4 ): Promise<T> { for (let attempt = 0; attempt <= maxRetries; attempt++) { const res = await fn(); if (res.ok) return res.json(); ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category