Overview
All API requests must include your API key in thex-api-key HTTP header.
Keys are issued from your Blockworks Research account and are tied to your organization/plan.
Quick start
Sending the header
- Always send
x-api-keyon every request. - Use HTTPS only.
- Prefer environment variables or a secure secrets manager; never hardcode keys in code or commit history.
Example with Axios (Node)
Key management best practices
- Least privilege (if you use multiple keys per environment/team, give the narrowest access).
- Separate keys per environment:
dev,staging,prod. - Rotate regularly and on any suspected exposure. Safe rotation flow:
- Create a new key.
- Deploy config with the new key.
- Verify traffic and logs.
- Revoke the old key.
- Store securely: cloud secrets manager (e.g., AWS Secrets Manager, GCP Secret Manager, 1Password) or your CI/CD secret store.
- Audit usage from your account dashboard (failed requests, rate-limit spikes, unusual origins).
Common errors
Error body shape
Security checklist
- Do not embed keys in client-side apps (browsers, mobile). Proxy through your backend.
- Restrict egress on your servers if possible (allowlist
api.blockworks.com). - Add rate limiting and retries with jitter to your client.
- Log request_id from responses for support/debugging.
- Consider key per service (ingesters, web, batch) to isolate exposure.