Skip to content

Commit 0458494

Browse files
Update faq.mdx (#1015)
* Update faq.mdx OpenAPI link, added call-to-action for those looking to build client libraries, clarified network naming convention, explained pagination, added address format for Solana, additional minor edits * Update faq.mdx is has -> has * Update website/src/pages/en/token-api/faq.mdx * Update website/src/pages/en/token-api/faq.mdx * Update website/src/pages/en/token-api/faq.mdx * Update website/src/pages/en/token-api/faq.mdx --------- Co-authored-by: Benoît Rouleau <[email protected]>
1 parent 9df5d74 commit 0458494

File tree

1 file changed

+31
-25
lines changed
  • website/src/pages/en/token-api

1 file changed

+31
-25
lines changed

website/src/pages/en/token-api/faq.mdx

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Get fast answers to easily integrate and scale with The Graph's high-performance
88

99
### Which blockchains are supported by the Token API?
1010

11-
Currently, the Token API supports Ethereum, BNB Smart Chain (BSC), Polygon, Optimism, Base, Unichain, Avalanche, Solana, and Arbitrum One. A full list of supported networks can be found under the Token API column [here](/supported-networks/).
11+
Currently, the Token API supports Ethereum, BNB Smart Chain (BSC), Polygon, Optimism, Base, Unichain, Avalanche, Arbitrum One, and Solana. A full list of supported networks can be found under the Token API column [here](/supported-networks/).
1212

1313
### Does the Token API support NFTs?
1414

@@ -24,32 +24,28 @@ Authentication is managed via API tokens obtained through [The Graph Market](htt
2424

2525
### How current is the data provided by the API relative to the blockchain?
2626

27-
The API provides data up to the latest finalized block.
27+
The API provides data up to the latest finalized block. This time varies depending on the blockchain. Improvements to provide data closer to the chain head are planned, and feedback is welcome on [Discord](https://discord.gg/graphprotocol).
2828

2929
### How do I retrieve token prices?
3030

31-
By default, token prices are returned with token-related responses, including token balances, token transfers, token metadata, and token holders. Historical prices are available with the Open-High-Low-Close (OHLC) endpoints.
31+
Token prices are available with the Open-High-Low-Close (OHLC) endpoints. For a given time period, `"open"` represents the price at the start of the time period, `"high"` represents the highest price during the time period, `"low"` represents the lowest price, and `"close"` represents the price at the end of the time period.
3232

3333
### Does the Token API support historical token data?
3434

35-
The Token API supports historical token balances with the `/historical/balances/evm/{address}` endpoint. You can query historical price data by pool at `/ohlc/pools/evm/{pool}` and by contract at `/ohlc/prices/evm/{contract}`.
35+
The Token API supports historical token balances with the `/historical/balances/evm/{address}` endpoint. You can query historical price data by pool at `/ohlc/pools/evm/{pool}` and by contract at `/ohlc/prices/evm/{contract}`. Historical balances have a similar OHLC format, but return token balances instead of prices.
3636

3737
### What exchanges does the Token API use for token prices?
3838

3939
The Token API currently tracks prices on Uniswap v2, v3, and v4, along with Jupiter, Raydium, and Pump.fun on Solana, with plans to support additional exchanges in the future.
4040

41-
### Does the Token API provide a client SDK?
41+
### Does the Token API provide a client SDK or client library?
4242

43-
While a client SDK is not currently available, please share feedback on any SDKs or integrations you would like to see on [Discord](https://discord.gg/graphprotocol).
43+
While an official client SDK is not currently available, please share feedback on any SDKs or integrations you would like to see on [Discord](https://discord.gg/graphprotocol). Community contributions are welcome to use the [OpenAPI document](https://token-api.thegraph.com/openapi) to build and share their own client libraries.
4444

4545
### Are there plans to support additional blockchains in the future?
4646

4747
Yes, more blockchains will be supported in the future. Please share feedback on desired chains on [Discord](https://discord.gg/graphprotocol).
4848

49-
### Are there plans to offer data closer to the chain head?
50-
51-
Yes, improvements to provide data closer to the chain head are planned. Feedback is welcome on [Discord](https://discord.gg/graphprotocol).
52-
5349
### Are there plans to support additional use cases?
5450

5551
The Graph ecosystem is actively determining the [roadmap](https://thegraph.com/blog/token-api-the-graph/) for additional use cases. Please provide feedback on specific features you would like prioritized on [Discord](https://discord.gg/graphprotocol).
@@ -58,7 +54,7 @@ The Graph ecosystem is actively determining the [roadmap](https://thegraph.com/b
5854

5955
### Is there a time limit for LLM queries?
6056

61-
Yes. The maximum time limit for LLM queries is 10 seconds.
57+
Yes. The maximum time limit for each LLM query is 10 seconds.
6258

6359
### Is there a known list of LLMs that work with the API?
6460

@@ -70,11 +66,23 @@ Beyond that, whether an LLM "works" depends on whether it supports the MCP proto
7066

7167
You can find the code for the MCP client in [The Graph's repo](https://github.com/graphprotocol/mcp-client).
7268

69+
### MCP integration with Claude/Cline/Cursor shows errors like "ENOENT" or "Server disconnected". How do I fix this?
70+
71+
For "ENOENT" errors, ensure Node.js 18+ is installed and the path to `npx`/`bunx` is correct (consider using full paths in config). "Server disconnected" usually indicates authentication or connectivity issues – verify your `ACCESS_TOKEN` is set correctly and your network allows access to `https://token-api.mcp.thegraph.com/sse`.
72+
73+
### Do I need to use MCP or tools like Claude, Cline, or Cursor?
74+
75+
No, these are optional. MCP is an advanced feature allowing AI assistants to interface with the API via streaming. For standard usage, simply call the REST endpoints with any HTTP client using your JWT. Claude Desktop, Cline bot, and Cursor IDE integrations are provided for convenience but aren't required.
76+
7377
## Advanced Topics
7478

75-
### I keep seeing a smart contract with the address `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`. What is this address?
79+
### I keep seeing a smart contract with addresses like `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee` and `0x000000000000000000000000000000000000`. What is this?
80+
81+
The address `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee` is a sentinel (placeholder) address used to represent native tokens in EVM smart contracts. Since native tokens (ETH, BNB, AVAX, etc.) exist at the protocol level rather than as smart contracts, DeFi protocols need a placeholder address when their code expects contract addresses for all tokens. This address represents the native token of whatever chain you're on: ETH on Ethereum and its L2s (Base, Arbitrum, Optimism), BNB on BSC, AVAX on Avalanche, and so forth.
82+
83+
The address `0x0000000000000000000000000000000000000000` was introduced in Uniswap v4 for the same purpose.
7684

77-
The address 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee is a sentinel (placeholder) address used to represent native tokens in EVM smart contracts. Since native tokens (ETH, BNB, AVAX, etc.) exist at the protocol level rather than as smart contracts, DeFi protocols need a placeholder address when their code expects contract addresses for all tokens. This address represents the native token of whatever chain you're on: ETH on Ethereum and its L2s (Base, Arbitrum, Optimism), BNB on BSC, AVAX on Avalanche, FTM on Fantom, and so forth. The repetitive pattern makes it obvious that the address is artificial; it's not a real account anyone controls, just an arbitrarily chosen low-entropy address that developers agreed to use.
85+
Because these addresses have an obvious repetitive pattern, they are clearly not randomly generated, as are other blockchain addresses. These accounts are not real accounts, just arbitrarily chosen low-entropy addresses that developers agreed to use.
7886

7987
### I'm getting 403/401 errors. What's wrong?
8088

@@ -86,20 +94,24 @@ Networks that are currently or temporarily unavailable on a given endpoint will
8694

8795
### Are there rate limits or usage costs?
8896

89-
During Beta, the Token API is free for authorized developers. There are no specific rate limits, but reasonable throttling exists to prevent abuse. High request volumes may trigger HTTP 429 errors. Monitor official announcements for future pricing changes after Beta.
97+
During Beta, the Token API has a generous allowance of free usage. There are no specific rate limits, but reasonable throttling exists to prevent abuse. High request volumes may trigger HTTP 429 errors. Monitor official announcements for future pricing changes after Beta.
9098

9199
### What do I do if I notice data inconsistencies in the data returned by the Token API?
92100

93101
If you notice data inconsistencies, please report the issue on our [Discord](https://discord.gg/graphprotocol). Identifying edge cases can help make sure all data is accurate and up-to-date.
94102

95103
### How do I specify a network?
96104

97-
You can query available networks with [this link](https://token-api.thegraph.com/networks). A full list of the exact network IDs accepted by The Graph can be found [here](/supported-networks/). Use the optional `network_id` parameter (e.g., `mainnet`, `bsc`, `base`, `arbitrum-one`, `optimism`, `matic`, `unichain`) to target a specific chain. Without this parameter, the API defaults to Ethereum mainnet.
105+
You can query which networks are available with [this endpoint](https://token-api.thegraph.com/networks). Take note that the network IDs differ between the Token API and Subgraphs. For EVM networks, use EVM endpoints with the optional `network_id` parameter (e.g., `mainnet`, `bsc`, `base`, `arbitrum-one`, `optimism`, `polygon`, `unichain`) to target a specific chain. Without this parameter, the API defaults to Ethereum mainnet.
106+
107+
To query Solana, use the SVM endpoints.
98108

99109
### Why do I only see 10 results? How can I get more data?
100110

101111
Endpoints cap output at 10 items by default. Use pagination parameters: `limit` and `page` (1-indexed) to return more results. For example, set `limit=50` to get 50 results, and increment `page` for subsequent batches (e.g., `page=2` for items 51-100).
102112

113+
It is currently possible for the total number of pages to be inexact. This is because the backend provides only an approximation of the number of records in order to improve response time. To avoid getting confused by this approximation, make sure to continue fetching next pages until there is no more data, or the endpoint returns an error.
114+
103115
### How do I fetch older transfer history?
104116

105117
The Transfers endpoint defaults to 30 days of history. To retrieve older events, increase the `age` parameter up to 180 days maximum (e.g., `age=180` for 6 months of transfers). Transfers older than 180 days cannot be fetched in a single call.
@@ -114,24 +126,18 @@ All Token API responses consistently wrap results in a top-level `data` array, e
114126

115127
### Why are token amounts returned as strings?
116128

117-
Large numeric values (like token amounts or supplies) are returned as strings to avoid precision loss, as they often exceed JavaScript's safe integer range. Convert these to big number types for arithmetic operations. Fields like `decimals` are provided as normal numbers to help derive human-readable values.
129+
Large numeric values (like token amounts or supply) are returned as strings to avoid precision loss, as they often exceed JavaScript's safe integer range. Convert these to big number types for arithmetic operations. Fields like `decimals` are provided as normal numbers to help derive human-readable values.
118130

119131
### What format should addresses be in?
120132

121-
The API accepts 40-character hex addresses with or without the `0x` prefix. The endpoint is case-insensitive, so both lower and uppercase hex characters work. Ensure addresses are exactly 40 hex digits (20 bytes) if you remove the prefix. For contract queries, use the token's contract address; for balance/transfer queries, use the wallet address.
133+
For EVM addresses, the API accepts hex addresses with either 42 or 40 characters, with or without the `0x` prefix. The endpoint is case-insensitive, so both lower and uppercase hex characters work. Ensure EVM addresses are exactly 42 characters, or 40 if you remove the prefix. For contract queries, use the token's contract address. For balance/transfer queries, use the wallet address.
134+
135+
SVM addresses are base58-encoded strings that are typically 32-44 characters long. They contain a mix of uppercase letters, lowercase letters, and numbers. Unlike Ethereum addresses which are hexadecimal and start with "0x", Solana addresses don't have a consistent prefix pattern.
122136

123137
### Do I need special headers besides authentication?
124138

125139
While recommended, `Accept: application/json` isn't strictly required as the API returns JSON by default. The critical header is `Authorization: Bearer <token>`. Ensure you make a GET request to the correct URL without trailing slashes or path typos (e.g., use `/balances/evm/{address}` not `/balance`).
126140

127-
### MCP integration with Claude/Cline/Cursor shows errors like "ENOENT" or "Server disconnected". How do I fix this?
128-
129-
For "ENOENT" errors, ensure Node.js 18+ is installed and the path to `npx`/`bunx` is correct (consider using full paths in config). "Server disconnected" usually indicates authentication or connectivity issues – verify your `ACCESS_TOKEN` is set correctly and your network allows access to `https://token-api.mcp.thegraph.com/sse`.
130-
131141
### Is the Token API part of The Graph's GraphQL service?
132142

133143
No, the Token API is a separate RESTful service. Unlike traditional subgraphs, it provides ready-to-use REST endpoints (HTTP GET) for common token data. You don't need to write GraphQL queries or deploy subgraphs. Under the hood, it uses The Graph's infrastructure and MCP with AI for enrichment, but you simply interact with REST endpoints.
134-
135-
### Do I need to use MCP or tools like Claude, Cline, or Cursor?
136-
137-
No, these are optional. MCP is an advanced feature allowing AI assistants to interface with the API via streaming. For standard usage, simply call the REST endpoints with any HTTP client using your JWT. Claude Desktop, Cline bot, and Cursor IDE integrations are provided for convenience but aren't required.

0 commit comments

Comments
 (0)