Docs
Search⌘ K
  • Home
  • About The Graph
  • Supported Networks
  • Protocol Contracts
  • Subgraphs
    • Substreams
      • Token API
        • AI Suite
          • Indexing
            • Resources
              Token API

              2 minutes

              Token API Quick Start

              The Graph Token API Quick Start banner

              This product is currently in Beta and under active development. If you have any feedback, please reach out to us on Discord⁠.

              The Graph’s Token API lets you access blockchain token information via a GET request. This guide is designed to help you quickly integrate the Token API into your application.

              The Token API provides access to onchain NFT and fungible token data, including live and historical balances, holders, prices, market data, token metadata, and token transfers. This API also uses the Model Context Protocol (MCP) to allow AI tools such as Claude to enrich raw blockchain data with contextual insights.

              Prerequisites

              Before you begin, get a JWT API token by signing up on The Graph Market⁠. Make sure to use the JWT API Token, not the API key. Each API key can generate a new JWT API Token at any time.

              Authentication

              All API endpoints are authenticated using a JWT API token inserted in the header as Authorization: Bearer <token>.

              1{2  "headers": {3    "Authorization": "Bearer eyJh•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••NnlA"4  }5}

              Using JavaScript

              Make an API request using JavaScript by adding the request parameters, and then fetching from the relevant endpoint. For example:

              index.js
              1const address = '0x2a0c0dbecc7e4d658f48e01e3fa353f44050c208'2const options = {3  method: 'GET',4  headers: {5    Accept: 'application/json',6    Authorization: 'Bearer <token>',7  },8}910fetch(`https://token-api.thegraph.com/balances/evm/${address}`, options)11  .then((response) => response.json())12  .then((response) => console.log(response))13  .catch((err) => console.error(err))

              Make sure to replace <token> with the JWT Token generated from your API key.

              Using cURL (Command Line)

              To make an API request using cURL, open your command line and run the following command.

              1curl --request GET \2  --url https://token-api.thegraph.com/balances/evm/0x2a0c0dbecc7e4d658f48e01e3fa353f44050c208 \3  --header 'Accept: application/json' \4  --header 'Authorization: Bearer <token>'

              Make sure to replace <token> with the JWT Token generated from your API key.

              Most Unix-like systems come with cURL preinstalled. For Windows, you may need to install cURL.

              Chain and Feature Support

              NetworkTokensSwapsNFTs
              Ethereum Mainnet
              BSC
              Base
              Unichain
              Arbitrum-One
              Optimism
              Polygon
              Avalanche
              Solana❌ Unsupported

              A full list of chain support for The Graph services can be found here.

              Troubleshooting

              If the API call fails, try printing out the full response object for additional error details. For example:

              index.js
              1fetch(`https://token-api.thegraph.com/balances/evm/${address}`, options)2  .then((response) => {3    console.log('Status Code:', response.status)4    return response.json()5  })6  .then((data) => console.log(data))7  .catch((err) => console.error('Error:', err))
              ⁠Edit on GitHub⁠

              PublishingBalances by Address
              On this page
              • Prerequisites
              • Authentication
              • Using JavaScript
              • Using cURL (Command Line)
              • Chain and Feature Support
              • Troubleshooting
              The GraphStatusTestnetBrand AssetsForumSecurityPrivacy PolicyTerms of Service