This section outlines how to use our API endpoint to connect to Optimism.
Optimism is an EVM equivalent Layer 2 blockchain connected to Ethereum. The Optimism Stack is the standardized, shared, and open-source development stack that makes it easy to spin up your own production-ready Layer 2 blockchain just like Optimism.
How to Connect to Optimism
You can connect to Optimism 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.
Optimism Mainnnet
To get your API key, create a project using a unique Identifier as the project name and select Optimism from the network options.
Create Optimism project
Open the project to view your api key and rpc endpoints.
view Optimism project
Optimism Sepolia
To get your API key, create a project using a unique Identifier as the project name and select Optimism Sepolia from the network options.
Create Optimism Sepolia project
Open the project to view your api key and rpc endpoints.
view Optimism Sepolia project
Send requests
All requests are POST requests.
For Optimism Mainnet
For Optimism Sepolia
For Optimism 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.
Optimism Mainnet
Optimism Sepolia
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: