Linea Token API

Linea Token API

-

For the past few months, we’ve been working on a new piece of infrastructure for builders in the Linea ecosystem: the Token API.

The idea is simple: give easy, fast, and reliable access to key information about ERC-20 tokens on Linea. Prices, metadata, stats, etc. Everything you need to plug into a dashboard, a dapp, a bot, an explorer, or anything else.

The API is already live in Linea Hub, the entry point to explore the Linea ecosystem, and in MetaMask Portfolio.

For builders

The API exposes a main /tokens endpoint that lets you:

  • fetch the full list of tokens deployed on Linea

  • filter for "secure" tokens (Moralis security score > 70, market cap > $50k)

  • sort by creation date, volume, price, etc.

  • access current and historical prices, track most traded tokens, top gainers and losers

Here’s a TypeScript example to filter secure tokens:

const BASE_URL = "https://token-api.linea.build";
const tokens = await fetch(`${BASE_URL}/tokens?isSecure=true`).then(r => r.json());

Or to build a simple price monitoring bot:

async function monitorPriceChange(addr: string, threshold: number) {
const BASE_URL = "https://token-api.linea.build"
const url = `${BASE_URL}/tokens/${addr}`

  const { currentPrice: p0 } = await fetch(url).then(res => res.json())

  setInterval(async () => {
    const { currentPrice: p1 } = await fetch(url).then(res => res.json())
    const delta = Math.abs((p1 - p0) / p0)

    if (delta > threshold) {
      console.log("🚨 Price moved")
    }
  }, 60_000)
}

Docs for humans, and for AIs

We structured the documentation to be usable by everyone, including AI tools like Cursor or Copilot.

The OpenAPI spec is available in:

Why recommend YAML for AI? Because it’s lighter, cleaner, and easier to parse for LLMs (fewer tokens, better code generation, less noise).