Rate limit
A rate limit caps how many requests a client can send to an API per unit of time. Over the limit, the server answers with 429 Too Many Requests, defined in RFC 6585, and may add a Retry-After header saying how many seconds to wait (HTTP 429 error).
Rate and quota
There are usually two limits: the rate (requests per second or minute) and the quota (calls per day or month). In Genesis API both depend on the plan:
| Plan | Requests per second | Calls per 30 days | Quota at full rate lasts |
|---|---|---|---|
| Trial | 1 | 500K | 5.8 days |
| Start | 2 | 2M | 11.6 days |
| Pro | 5 | 5M | 11.6 days |
| Max | 15 | 10M | 7.7 days |
The last column assumes non-stop requests at the rate limit and a 200 for every response. For Pro: 5 × 86,400 = 432,000 requests a day, and 5,000,000 / 432,000 ≈ 11.6 days. The per-second limit is a ceiling for bursts, while the quota sets the average pace: 30 days hold 2,592,000 seconds, so Pro sustains an average of 5,000,000 / 2,592,000 ≈ 1.93 requests per second.
Only 200 responses use the quota; 304 responses and errors do not, but they still count toward the requests-per-second limit. Download volume is capped separately at 60 MB of compressed data per 10 seconds per key; anything over the cap gets 429 download_limited.
Staying within the limit
Every Genesis API response reports its limit state in headers:
| Header | What it shows |
|---|---|
X-RateLimit-Limit | Requests-per-second limit of your plan |
X-RateLimit-Remaining | Requests left in the current window |
X-RateLimit-Reset | Unix time the window resets |
Retry-After | Seconds to wait before retrying (on 429 and 503) |
The quota shows in X-Quota-Limit, X-Quota-Remaining, X-Quota-Reset and the Usage endpoint, /account/usage. The code below polls three endpoints in a row: when the window has no requests left, it waits for X-RateLimit-Reset on its own, and on 429 and 503 it pauses for Retry-After.
import os
import time
import requests
BASE = "https://api.genesisarbitrage.com/v1"
HEADERS = {"X-API-Key": os.environ["GENESIS_API_KEY"]}
PATHS = ("/arbitrage/spot-spot", "/funding/spread",
"/market/open-interest")
def poll_once():
for path in PATHS:
r = requests.get(BASE + path, headers=HEADERS, timeout=10)
if r.status_code in (429, 503):
# the server asks for a pause; the next pass retries
time.sleep(int(r.headers.get("Retry-After", "1")))
continue
r.raise_for_status()
print(path, "rows:", r.json()["meta"]["count"])
if r.headers.get("X-RateLimit-Remaining") == "0":
# window used up: wait for its reset instead of a 429
reset = int(r.headers.get("X-RateLimit-Reset", "0"))
time.sleep(max(0.0, reset - time.time()))
while True:
poll_once()
time.sleep(10) # Pro freshness: polling faster gains nothing
See also: API polling, data freshness, Plans & limits, Genesis API limits, how to poll an API without hitting limits.
Questions and answers
What happens when the monthly quota runs out?
Requests over the quota are never billed. Wait for the reset (the time is in X-Quota-Reset) or move to a higher plan: a new plan takes effect at once, the quota starts from zero and whatever was left of the old plan is forfeited.
Can I get around the limit with a second key?
No. An account has one key, and using several accounts or rotating IPs to get past the limit breaks the rules. If you run short of calls, cut the unnecessary ones with filters, the coin parameter and an ETag with If-None-Match, or move to a higher plan.