The purpose of this article is to jump start development on the Covalenthq API to start building asap.
Covalenthq is an API unlike others, it lets us access many blockchains, not only 1.
There are two classes of endpoints:
- Class A - endpoints that return enriched blockchain data applicable to all blockchain networks, eg: balances, transactions, log events, etc.
- Class B - endpoints that for a specific protocol on a blockchain, eg: AAVE is Ethereum-only and is not applicable to other blockchain networks.
The Covalent API is RESTful. Sample API calls are provided next to each method using
Some points to keep in mind:
- All requests are done over HTTPS (calls over plain HTTP will fail.)
- The current version of the API is version 1.
- The return format for all endpoints is JSON.
- All requests require authentication.
>>> curl -X GET https://api.covalenthq.com/v1/ENDPOINT/?key=API_KEY
key=API_KEY as a query parameter to all queries.
To get the balance of your ETH wallet, you could type in the terminal the following (of course replace what I noted inside):
curl -X GET "https://api.covalenthq.com/v1/1/address/YOUR_ETH_WALLET_ADDRESS/balances_v2/?&key=YOUR_COVALENHQ_API_KEY" \ -H "Accept: application/json" \
That's a very simple sample to get you started. The documentation is here, the rest is the architectural structure of your app of how you want to use curls to fetch data.
I hope it helps.
With love and respect,