Skip to main content

How to use Programmatic Endpoints

Welcome to our guide on efficiently managing your blockchain projects through programmatic API keys. This tutorial is designed for users of Blast API, offering a step-by-step approach to creating, managing, and utilizing API keys for project and endpoint automation.

Prerequisites​

  • A compatible wallet for the blockchain network installed on your device, such as MetaMask browser extension or any wallet supporting the Wallet Connect protocol on your phone or laptop.
  • Login already performed on Consumer APP
  • Login email and password set on the account

How to generate access keys and how to use Programmatic Endpoints:​

info

To generate the Access key you need to have a login email and a password set on the account

Step 1: Generate access keys from My Account section​

  1. Hover over My Account in the top right corner and select Account on the dropdown menu.

Account menu

  1. In order to use Access Keys from the UI, login email address should be set (if not already set).

Login email

  1. Scroll down to the bottom of the page and click Generate access key

Account page

  1. A modal with the access key will be displayed. Copy and save it for later use.
info

Make sure to copy your personal access key from this modal. You won't be able to see it again!

info

An access key can be removed anytime from the same section.

Access key

Step 2: Use Programmatic Endpoints​

With your Acces key generated, you can now use it to manage your projects and endpoints. Here’s how you can add or delete projects and endpoints:

Add a Project: (Customize the request body as needed, including allowlists and blocklists)

curl -X "POST" "https://api.blastapi.io/api/v1/project" -H "accept: application/json" -H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" -H "Content-Type: application/json" -d "{\"name\": \"string\", \"environment\": \"qa\", \"isPrimary\": false}"

Delete a Project:

curl -X "DELETE" "https://api.blastapi.io/api/v1/project/YOUR_PROJECT_ID" -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Add Endpoints to a Project: (Adjust the networks in the body as required)

curl -X "POST" "https://api.blastapi.io/api/v1/project/YOUR_PROJECT_ID/endpoints" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d "{\"networks\":[\"List of Networks...\"]}"

Delete Endpoints from a Project: (Adjust the networks in the body as required)

curl -X "DELETE" "https://api.blastapi.io/api/v1/project/YOUR_PROJECT_ID/endpoints" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d "{\"networks\":[\"List of Networks...\"]}"

Additional Notes​

info

Find your project ID in the response of the project creation request or log in to Blast as a consumer, navigate to your Dashboard, open an existing project, and locate the project ID displayed on the top left.

info

The ability to create more projects is contingent upon the limits set by your subscription plan.

info

Below you can find an example of networks list:

"networks": ["ava-mainnet", "ava-testnet", "astar", "arbitrum-one", "arbitrum-one-builder", "arbitrum-sepolia", "arbitrum-nova", "avail-turing", "avail-mainnet", "base-goerli", "base-sepolia", "base-mainnet", "base-mainnet-builder", "blastl2-mainnet", "blastl2-sepolia", "bob-mainnet", "bob-sepolia", "bsc-mainnet", "bsc-testnet", "bitcoin-mainnet", "bitcoin-testnet", "celestia-mainnet", "chiliz-mainnet", "chiliz-testnet", "crossfi-testnet", "elrond-mainnet", "elrond-devnet", "elrond-api", "elrond-api-devnet", "eth-mainnet", "eth-mainnet-builder", "eth-sepolia", "eth-holesky", "eth-holesky-beacon", "eth-goerli", "dymension-mainnet", "dymension-mainnet-tendermint", "dymension-mainnet-rest", "palm-testnet", "palm-mainnet", "fantom-mainnet", "fantom-testnet", "gnosis-mainnet", "gnosis-chiado", "iota-mainnet-evm", "iota-testnet-evm", "linea-goerli", "linea-mainnet", "linea-sepolia", "mande-mainnet", "mande-mainnet-tendermint", "mande-mainnet-rest", "mantle-mainnet", "mantle-sepolia", "metis-mainnet", "mode-sepolia", "mode-mainnet", "moonbase-alpha", "moonbeam", "moonriver", "nim-mainnet", "nim-mainnet-tendermint", "nim-mainnet-rest", "oktc-mainnet", "opbnb-mainnet", "opbnb-testnet", "optimism-mainnet", "optimism-mainnet-builder", "polygon-amoy", "polygon-mainnet", "polygon-mainnet-bor", "polygon-testnet", "polygon-zkevm-mainnet", "polygon-zkevm-cardona", "rivalz-testnet", "rivalz-testnet-tendermint", "rivalz-testnet-rest", "scroll-sepolia", "scroll-mainnet", "shape-sepolia", "shiden", "shibuya", "starknet-mainnet", "starknet-mainnet-builder", "starknet-sepolia", "sui-testnet", "sui-mainnet", "vara-mainnet", "evmos-mainnet", "optimism-goerli", "optimism-sepolia", "aptos-mainnet", "aptos-testnet", "zetachain-mainnet", "zetachain-testnet", "zksync-sepolia", "zksync-mainnet"]