Skip to navigation

Keys, plans and usage

How a key works, what a download counts, and what happens at the limit

Keys

Every request carries a Datasets API key as a bearer token:

Authorization: Bearer immixds_<keyId>_<secret>
  • Immix issues your keys. Ask for one per machine or job: each is then easy to replace, and your usage is broken down by key.
  • The whole key is shown once, when it is issued or rotated. A lost key is rotated: it keeps its id, its secret is replaced, and the old secret stops working at once.
  • <keyId> is not secret. It names the key in your usage and when you talk to us. Never share the rest.
  • Send the key to the API and nowhere else. Do not put it in a URL. Do not send it to the storage link a download redirects to: that link carries its own signature, and anyone holding it can use it until it expires, so do not log or share the link either.

A Datasets key works only here. A trading API key, which begins immix_, and a login token are both refused with 401 UNAUTHENTICATED, and the message says which one you sent.

Plans

Your plan is a number of bytes for each calendar month, in UTC, or no limit.

RequestCounts
A data file, GET /files/{family}/{exchange}/{day}/{symbol}.{ext}The file’s bytes, whole, when the redirect is answered
Coverage, a day’s manifest, an instruments file, GET /usageNothing
Any request that is refusedNothing

A file counts whatever you then do with the link. A download you abort counts, and a second request for a file you already hold counts again. So keep what you fetch, and before asking for a file, check whether you already have it with the SHA-256 its manifest gives.

To size a download before you start it, add up bytes in GET /coverage/{exchange} for the families and symbols you want: it is what fetching every day of each transfers, and counts.

Where you stand

Every counted redirect says where the month stands:

HeaderIs
X-Immix-Month-Bytes-UsedThe bytes counted this month, this file’s among them
X-Immix-Month-Bytes-LimitYour plan. Absent when it has no limit

GET /usage gives the same two numbers and the month’s bytes and files by key, exchange and family, for every key of your account.

At the limit

AnswerIt meansDo
429 BUDGET_EXHAUSTEDThe file would take the month past your plan. It is not countedStop until the month turns, or ask us to raise the plan. Its Retry-After is the month’s end, so do not wait it out in a loop
429 BUDGET_EXHAUSTED, no Retry-AfterThe file is larger than your whole plan, so no month fits itAsk us for a larger plan
429 RATE_LIMITEDToo many requests from this key in a minuteWait Retry-After seconds, then continue

A client that fetches five files at a time stays under the rate limit.

The HTTP API guide lists every refusal with what to do about it.