Request Authentication

There are multiple options to choose from when it comes to authentication:

HTTP Header (recommended)

Send your key as HTTP header with the name "X-API-Key"

Best option because the key is not part of the URL but unfortunately, this does not work for clients that do not let you change the HTTP headers.

## Examples
# Blockbook API
curl -H "X-API-Key:YOUR_KEY" https://api.chain49.com/bitcoin/v2/block/123456

# JSON-RPC request 
curl -X POST -H "X-API-Key:YOUR_KEY" -H "Content-Type: application/json" \
--data '{"id": 49, "method":"eth_blockNumber","params":[]}' \
https://rpc.chain49.com/ethereum

URL / Path Param

Send your key in the URL as second parameter after the blockchain. Other path params come after (see examples)

Not all clients support adding/changing HTTP request headers and this option allows using our API with such clients.

Mostly used for JSON-RPC, like using our endpoint for a wallet like MetaMask or Trezor or attaching a Web3 console

## Examples
# Blockbook API request with path parameters after the key:
curl https://api.chain49.com/bitcoin/YOUR_KEY/v2/block/123456

# JSON-RPC request 
curl -X POST -H "Content-Type: application/json" \
--data '{"id": 49, "method":"eth_blockNumber","params":[]}' \
https://rpc.chain49.com/ethereum/YOUR_KEY

# Attach geth web3 console
geth attach https://rpc.chain49.com/ethereum/YOUR_KEY

Query Param

Send your key as parameter "api_key" in the query string with other optional request parameters

Has the same benefits and drawbacks as the URL/Path param option

## Examples
# Blockbook API request
curl https://api.chain49.com/bitcoin/v2/block/123456?api_key=YOUR_KEY&pageSize=10

# JSON-RPC request 
curl -X POST -H "Content-Type: application/json" \
--data '{"id": 49, "method":"eth_blockNumber","params":[]}' \
https://rpc.chain49.com/ethereum?api_key=YOUR_KEY

# Attach geth web3 console
geth attach https://rpc.chain49.com/ethereum?api_key=YOUR_KEY