Authentication
Each API product in Blockdaemon is designed to serve a specific purpose, from querying blockchain data to managing staking or interacting with DeFi protocols. To use them, you need to authenticate the request with a valid API key or token.
Base URLs
Product | Base URL |
---|---|
RPC API | https://svc.blockdaemon.com/{protocol}/{network}/native/{connection_type} |
Staking API | https://svc.blockdaemon.com/boss/v1/{protocol}/{network}/{endpoint} |
Staking Reporting API | https://svc.blockdaemon.com/reporting/staking/v2/{protocol}/{network}/{endpoint} |
Dedicated Nodes | Depends on the connection type, learn more here. |
DeFi API | https://svc.blockdaemon.com/defi/v1/{modules}/{endpoint} |
ABI API | https://svc.blockdaemon.com/abi/v1/{protocol}/{network}/contracts/{endpoint} |
Token Price API | https://svc.blockdaemon.com/pricing/v1/{endpoint} |
NoteSee the Supported Protocols page for a full list of available chains and networks.
Authorization
All API requests must be authenticated using one of the following methods:
- API Key (via
X-API-Key
header or?apiKey=
query parameter) - OAuth2 Bearer Token (via
Authorization: Bearer
header)
NoteNever expose your API keys or access tokens in client-side applications or to anyone.
Authentication Methods & Examples
1. Bearer Token
curl --request POST \
--url https://svc.blockdaemon.com/ethereum/mainnet/native/rpc \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'
2. API Key as Query Parameter
curl -X POST -H 'Content-Type: application/json' 'YOUR_ENDPOINT_URL/tendermint_rest/status?auth=YOUR_API_KEY'
3. API Key as Header
curl --request GET \
--url https://svc.blockdaemon.com/universal/v1/bitcoin/mainnet/sync/block_number \
--header "X-API-Key: YOUR_API_KEY" \
--header "Accept: application/json"
Sample Successful Response
Request
curl --request GET \
--url 'https://svc.blockdaemon.com/reporting/staking/v2/ethereum/mainnet/validator/yield?startTime=1709251200&endTime=1711929600&denomination=wei&raw=false' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'accept: application/x-ndjson'
Response (200 OK)
{
"startTime": 1709251200,
"endTime": 1711929600,
"return": "283291849202",
"apr": "0.0601",
"aprPercentage": "6.01%",
"apy": "0.06912",
"apyPercentage": "6.912%",
"denomination": "ETH",
"stake": "3830810096309000",
"metadata": {
"epoch": "285413-287302",
"protocolRewards": "11.582442116",
"mevRewards": "2.55849541422880986",
"blockRewards": "1.660716278059616145",
"totalBalance": "33750555.15182654"
}
}
Sample Error Responses
401 Unauthorized - Missing or invalid credentials.
{
"type": "unauthorized",
"title": "Invalid Token",
"status": 401
}
400 Bad Request—Malformed request or invalid parameters. Check the parameters used by the method that is failing.
{
"timestamp": "string",
"path": "/v2/solana/mainnet/delegator",
"status": 400,
"error": "[endTime should be in unix epoch seconds]"
}
404 Not Found – Resource doesn’t exist
{
"type": "not-found",
"title": "Not Found",
"status": 404
}
429 Too Many Requests - Rate limit exceeded.
{
"type": "too-many-requests",
"title": "Too Many Requests",
"status": 429,
"detail": "Request rate limits have been exceeded. Try again after a few seconds."
}
500 Internal Server Error - Any error that cannot be attributed to bad values sent in the command.
{
"type": "internal-server-error",
"title": "Internal Server Error",
"status": 500
}
Updated about 2 months ago