Skip to main content

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!

# 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