API Service
Connecting you to the world of web3 through API's
You can find Blockops quick start guides here: Getting Started with Blockops
Supported Networks
Get an API Key
To get started, visit https://beta-app.blockops.network and navigate to the API Service page. You can either register for a new account or log in if you already have one.
After your account has been verified, navigate to the API service dashboard, which allows you to create projects which generate your API keys.
Projects serve as a centralized location within your workspace where you can manage your API key and view analytics. They essentially act as containers that hold these components together.
Click Connect
to connect to any of the available networks on Blockops. Select the network you want to connect, and enter your project’s name.
Finally click Connect
button you’ll be taken to a page where you can view your API Service projects.
Authentication with API Key
Once you created a project, an API key will automatically be generated for you. Click on that project to view the network endpoint and the API key – a token required for the interaction with the service and making API requests.
API Keys can be rotated at any time.
Send requests
All requests are POST
requests.
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 header and body of a relay chain block.
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.
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:
Connect via Polkadot JS UI
To access our API service, you can use the Polkadot/Substrate Portal. First, go to the PolkadotJS UI and then open the Explorer tab located under Network. Finally, click on the Polkadot Icon located at the top of your screen.
This will open the Network switcher which will allow you to select the network that you connect to. You can add your Blockops API service endpoint to the Development section by pasting the websocket connection URL into the custom endpoint field and clicking on the save icon.
You're now connected and can start making calls with the Polkadot/Substrate UI App
Regenerate API Key
In case you suspect that an unauthorized third party is using your API key, you have the option to reset it by using the change Key button located in the project dashboard.
API Service Rate Limiting
The Blockops API service has a limit on the number of requests that can be made to each API endpoint. The limit depends on whether you are using the public rpc endpoint or an API key.
The number of requests you can make before reaching the limit or being rate-limited will vary based on your chosen method of access.
Public API endpoint - 50 requests/second
Private API endpoint - 1000 requests/second
Typically only aggressive use should experience rate limiting.
Customers running into rate limits are encouraged to contact us. We'll work with you to determine how best to avoid rate limits.
Error Codes
The following error codes are frequently returned by our API service. However, it's important to note that this list doesn't include errors related to network-specific business logic.
Code | Message | Explanation |
---|---|---|
401 | Unauthorized Access | Invalid API key or no API key found in request |
404 | No route matched | This indicates the specific page you are trying to visit is non-existent |
500 | Internal Server Error | Something went wrong inside our servers. Contact support. |
429 | Too Many Requests | You have exceeded your request limit. |
Track your projects
The project List shows all active projects, the network type, the creation date, and the status of the project. You also have the ability to search the projects by name.
Pricing and Costs
Follow us on Twitter for more information on upcoming protocols and developments.
Last updated