Klaytn Docs
Search…
Covalent API
Covalent provides a unified API to bring full transparency and visibility to assets across all blockchains including Klaytn Mainnet and Testnet.
Covalent provides the industry-leading Unified API bringing visibility to billions of Web3 data points. Developers use Covalent to build exciting multi-chain applications like crypto wallets, NFT galleries, and investor dashboard tools utilizing data from most major blockchains.

Generating API Keys

To get started, sign up for an API Key.
JSON support
CSV support
The Covalent API is RESTful and offers the following out-of-the-box for Klaytn:
Covalent API
Response formats
JSON and CSV
Real time response
2 blocks
Batch response
30 minutes
Request volume limit
None
Request rate limit
5 requests per second
Base URL
https://api.covalenthq.com/v1/
Networks & chain_id
Mainnet: Cypress - 8217 Testnet: Boabab - 1001
Try the supported endpoints directly in your browser from our API Reference or use the following code examples. The JSON response format is the same for all endpoints:
1
2
"data": ...,
3
"error": false,
4
"error_message": null,
5
"error_code": null
6
Copied!

Curl

1
curl -X GET "https://api.covalenthq.com/v1/{chain_id}/address/{address}/balances_v2/?key={YOUR API KEY}" -H "Accept: application/json"
Copied!

JavaScript

1
const APIKEY = 'YOUR API KEY';
2
const baseURL = 'https://api.covalenthq.com/v1'
3
const klaytnChainId = '8217'
4
const demoAddress = '0xFEC4f9D5B322Aa834056E85946A32c35A3f5aDD8'
5
6
async function getWalletBalance(chainId, address) {
7
const url = new URL(`${baseURL}/${chainId}/address/${address}/balances_v2/?key=${APIKEY}`);
8
const response = await fetch(url);
9
const result = await response.json();
10
const data = result.data;
11
console.log(data)
12
return data;
13
}
14
15
// Example address request
16
getWalletBalance(klaytnChainId, demoAddress);
Copied!

Python

1
import requests
2
3
API_KEY = 'YOUR API KEY'
4
base_url = 'https://api.covalenthq.com/v1'
5
klatyn_chain_id = '8217'
6
demo_address = '0xFEC4f9D5B322Aa834056E85946A32c35A3f5aDD8'
7
8
def get_wallet_balance(chain_id, address):
9
endpoint = f'/{chain_id}/address/{address}/balances_v2/?key={API_KEY}'
10
url = base_url + endpoint
11
result = requests.get(url).json()
12
data = result["data"]
13
print(data)
14
return(data)
15
16
17
# Example address request
18
get_wallet_balance(klatyn_chain_id, demo_address)
Copied!

Use Cases

The Covalent API supports a broad range of Web3 data use cases including:
Gaming
DeFi Taxes
KYC
NFTs
Wallets
Dashboards
On-Chain Forensics
DAO Data
DEXs & Trading
Predictive Analytics
Governance
Pricing
Check out our collection of ready-to-ship Code Templates that you can use to build your Web3 data-powered dApps.

Resources

Here are some additional resources to help you get started with the Covalent API: