Making first call
Once you acquire your project_id
token, let's give the API a try! You need to pass this it as an HTTP header with the name project_id
. Don't forget that you can call just the network you created the token for.
info
Each network has separate project_id
tokens, distinguishable by the prefix.
In this example, we set project_id
as an environment variable and then use it to call the API. Don't forget to replace the PROJECT_ID
in the example with your newly generated one!
- Cardano mainnet
- Cardano preprod
- Cardano preview
- IPFS
- Milkomeda mainnet
- Milkomeda testnet
# Don't forget to replace the PROJECT_ID with your newly generated one!
# The following PROJECT_ID is made up, NEVER share your PROJECT_ID publicly!!!
export PROJECT_ID=mainnetqnWuOt69v42rIes4punuD20FAsRuqnpDg4
curl -H "project_id: $PROJECT_ID" https://cardano-mainnet.blockfrost.io/api/v0/blocks/latest
# Don't forget to replace the PROJECT_ID with your newly generated one!
# The following PROJECT_ID is made up, NEVER share your PROJECT_ID publicly!!!
export PROJECT_ID=preprodEnrkKWDwlA9hV4IajI4ILrFdsHJpIqNC
curl -H "project_id: $PROJECT_ID" https://cardano-preprod.blockfrost.io/api/v0/blocks/latest
# Don't forget to replace the PROJECT_ID with your newly generated one!
# The following PROJECT_ID is made up, NEVER share your PROJECT_ID publicly!!!
export PROJECT_ID=previewEnrkKWDwlA9hV4IajI4ILrFdsHJpIqNC
curl -H "project_id: $PROJECT_ID" https://cardano-preview.blockfrost.io/api/v0/blocks/latest
# Don't forget to replace the PROJECT_ID with your newly generated one!
# The following PROJECT_ID is made up, NEVER share your PROJECT_ID publicly!!!
export PROJECT_ID=ipfssbLweNvuxs6rcwYBLDWaXZR1n4zPPNDI
curl -H "project_id: $PROJECT_ID" https://ipfs.blockfrost.io/api/v0/pins/list
# Don't forget to replace the PROJECT_ID with your newly generated one!
# The following PROJECT_ID is made up, NEVER share your PROJECT_ID publicly!!!
export PROJECT_ID=milkmainnetBhXgL924l8MjGlM9NwGlAa4KDrcDFwlE
curl -H "project_id: $PROJECT_ID" -H 'Content-Type: application/json' -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}' https://milkomeda-mainnet.blockfrost.io/api/v0/
# Don't forget to replace the PROJECT_ID with your newly generated one!
# The following PROJECT_ID is made up, NEVER share your PROJECT_ID publicly!!!
export PROJECT_ID=milktestnet7xXnVtBag8wGRZsnymqYZH8ChJ1PSF8U
curl -H "project_id: $PROJECT_ID" -H 'Content-Type: application/json' -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}' https://milkomeda-testnet.blockfrost.io/api/v0/