Authentication
Every request needs a key, except GET /healthz and GET /v2/logo/....
Get a key at dashboard.chainmetric.com.
Send the key
Section titled “Send the key”Send the key bare in the Authorization header:
curl -s -H "Authorization: $CHAINMETRIC_KEY" https://api.chainmetric.io/v2/token/1/c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/statsDo not prefix it with Bearer.
Authorization: Bearer <key> is refused with 403 at the edge.
Key errors
Section titled “Key errors”| Status | error |
Meaning |
|---|---|---|
401 |
api key missing |
No Authorization header was sent. |
401 |
api key unknown |
The key does not exist. |
401 |
api key revoked |
The key was revoked. Get a new one in the dashboard. |
403 |
The request was refused at the edge, for example because of a Bearer prefix. |
|
429 |
api key rate limit reached |
The key’s request rate limit is reached. |
The rate limit is set per key.
A 429 carries no Retry-After header: back off exponentially and retry.
Browsers
Section titled “Browsers”The API answers cross-origin requests from any origin.
It allows the Authorization, Content-Type and Last-Event-ID request headers.
Do not ship a key in public browser code: anyone can read it there.