Skip to main content
Data indexers

Codex

Codex is a blockchain data API for real-time and historical DeFi data. Linea is fully supported. All Codex data primitives (tokens, prices, charts, holders, wallets, trades, and live subscriptions) are available for Linea, backed by indexing 80+ million tokens, 700 million wallets, and 28 billion transactions across 80+ networks.

What you can do​

All of Codex's token endpoints are available for Linea, allowing applications to:

  • Discover tokens: filter and search Linea tokens by liquidity, market cap, age, volume, holder count, and other metrics.
  • Read prices and charts: real-time and historical prices, plus OHLCV candlestick data for any Linea token across any timeframe.
  • Look up holders and balances: holder counts, top-holder distribution, and token balances for any Linea wallet.
  • Query DEX trades and pairs: swap events and token pair data across Linea DEXs.
  • Stream live updates: WebSocket subscriptions for price ticks, trades, and pair events on Linea tokens as they happen.

For a comprehensive list of endpoints available for Linea, see the Codex Linea reference.

Quick example​

Fetch the top 10 Linea tokens by 24-hour trading volume, with price, market cap, liquidity, and holder metrics:

import { Codex } from "@codex-data/sdk";

const sdk = new Codex("YOUR_API_KEY");

const { filterTokens } = await sdk.queries.filterTokens({
filters: {
network: [59144], // Linea's network ID
liquidity: { gt: 10000 },
},
rankings: [{ attribute: "volume24", direction: "DESC" }],
limit: 10,
});

for (const result of filterTokens.results ?? []) {
console.log({
name: result.token.name,
symbol: result.token.symbol,
address: result.token.address,
priceUSD: result.priceUSD,
volume24: result.volume24,
liquidity: result.liquidity,
marketCap: result.marketCap,
holders: result.holders,
});
}

The same query as a raw GraphQL request:

curl -X POST https://graph.codex.io/graphql \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-d '{
"query": "query { filterTokens(filters: { network: [59144], liquidity: { gt: 10000 } }, rankings: [{ attribute: volume24, direction: DESC }], limit: 10) { results { token { name symbol address } priceUSD volume24 liquidity marketCap holders } } }"
}'

Integrating Codex​

Codex exposes one GraphQL endpoint with several access modes. Pick the one that fits your delivery needs.

GraphQL endpoint​

All queries and mutations are issued as HTTPS POST to https://graph.codex.io/graphql. 65 query operations cover every data category listed above.

TypeScript SDK​

The @codex-data/sdk package is a thin wrapper around the GraphQL API with typed queries, mutations, and built-in subscription handling.

npm install @codex-data/sdk

WebSocket subscriptions​

24 real-time streams are available over wss://graph.codex.io/graphql, including price updates, chart data, trade events, new and updated DEX pairs, and wallet activity.

Webhooks​

For push-based delivery without a persistent WebSocket, Codex webhooks POST onchain events to your server as they occur.

Resources​

Was this page helpful?