> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyspend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get tokens for a chain

Retrieves available tokens for a specific blockchain

` GET /chains/{chainId}/tokens `

Get tokens for a chain

Retrieves available tokens for a specific blockchain

## Servers

- ` https://mainnet.anyspend.com ` — Production server

## Parameters

### ` chainId ` (path, required)

Blockchain chain ID

- ` value `: type ` number `

Example:

```json
1
```

### ` term ` (query, optional)

Search term to filter tokens

- ` value `: type ` string `

Example:

```json
"USDC"
```

### ` limit ` (query, optional)

Maximum number of tokens to return

- ` value `: type ` number `

## Responses

### ` 200 ` — Tokens retrieved successfully

Content type: ` application/json `

- ` value `: type ` object `

  - example: ` {"success":true,"message":"Success","data":[{"chainId":1,"address":"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48","symbol":"USDC","name":"USD Coin","decimals":6,"metadata":{"logoURI":"https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694"}}],"statusCode":200} `

  - Required fields: ` success `, ` message `, ` data `, ` statusCode `

  - ` success `: type ` boolean `

    - example: ` true `

  - ` message `: type ` string `

    - example: ` "Tokens retrieved successfully" `

  - ` data `: type ` array ` — Array of tokens

    - ` array item `: type ` object `

      - Required fields: ` chainId `, ` address `, ` symbol `, ` name `, ` decimals `, ` metadata `

      - ` chainId `: type ` number ` — Chain ID

      - ` address `: type ` string ` — Token contract address

      - ` symbol `: type ` string ` — Token symbol

      - ` name `: type ` string ` — Token name

      - ` decimals `: type ` number ` — Token decimals

      - ` metadata `: type ` object `

        - ` logoURI `: type ` string ` — Token logo URI

  - ` statusCode `: type ` number `

    - example: ` 200 `

Example:

```json
{
  "success": true,
  "message": "Success",
  "data": [
    {
      "chainId": 1,
      "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
      "symbol": "USDC",
      "name": "USD Coin",
      "decimals": 6,
      "metadata": {
        "logoURI": "https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694"
      }
    }
  ],
  "statusCode": 200
}
```

### ` 400 ` — Bad request

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` success `, ` message `, ` statusCode `

  - ` success `: type ` boolean `

    - example: ` false `

  - ` message `: type ` string `

    - example: ` "Bad request" `

  - ` statusCode `: type ` number `

    - example: ` 400 `

## Request examples

### cURL

```curl
curl -X GET 'https://mainnet.anyspend.com/chains/1/tokens'
```

### JavaScript

```javascript
const response = await fetch('https://mainnet.anyspend.com/chains/1/tokens', {
  method: 'GET'
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

response = requests.get('https://mainnet.anyspend.com/chains/1/tokens')
print(response.json())
```