X Layer Blockchain Data Indexing API

X Layer Quick Facts

X Layer is a ZK-powered L2 that connects OKX and Ethereum.

Don't Have an API Key?

Sign up to start building on X Layer.

Unlock millions of requests and free archive data on all chains.

Supported Endpoints

Endpoint

Code Samples

Get token balances for address

GET /v1/{chainName}/address/{walletAddress}/balances_v2/

Commonly used to fetch the native, fungible (ERC20), and non-fungible (ERC721 & ERC1155) tokens held by an address. Response includes spot prices and other metadata.

Costs:
1.00 Credits
Processing:
Realtime
Installation
npm install @covalenthq/client-sdk
Request
import { CovalentClient } from "@covalenthq/client-sdk";

const ApiServices = async () => {
    const client = new CovalentClient("YOUR_API_KEY");
    const resp = await client.BalanceService.getTokenBalancesForWalletAddress();
    console.log(resp.data);
}