Base
This section outlines how to use our API endpoint to connect to Base.
Last updated
This section outlines how to use our API endpoint to connect to Base.
Last updated
Base is a secure, low-cost, builder-friendly Ethereum L2 built to bring the next billion users onchain.
You can connect to Base using Blockops private API endpoints. Secure your data, speed up your queries, and take control of your API usage with our RPC API endpoint and personalized API keys. Sign up now to get your own API key.
To get your API key, create a project using a unique Identifier as the project name and select Base from the network options.
Open the project to view your api key and rpc endpoints.
To get your API key, create a project using a unique Identifier as the project name and select Base Sepolia from the network options.
Open the project to view your api key and rpc endpoints.
All requests are POST
requests.
For Base Mainnet
For Base Sepolia
Connect via Command Line
You can connect to the network using websocket or HTTP with your API key in two ways:
Adding the API key as a query string ?api_key=${APIKEY}
Or the request header -H 'authorization: APIKEY ${APIKEY}'
Curl
For example, the following CURL command can be used to get a block number.
Here is the response you will receive back.
Wscat
If you want to send data requests with WebSockets, you can use several libraries or wscat. You can install and use wscat as follows:
Download wscat from https://www.npmjs.com/package/wscat
Install wscat by running the following command: npm install -g wscat
You can connect to the network with wscat using two options by adding the API key as a query string.
Or the request header.
Or the request header.
After executing the command, the terminal will display a message indicating that the connection has been enabled successfully.
Then, you can send the following request:
For more information on the Polkadot network, please see the official Base developer documentation.
Login or set up an account here to get started!