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

# Fetch Tokens

> Get token list with filtering and search using the SDK

## Overview

Fetch exchangeable tokens from avnu with optional filtering by tags and search. The SDK handles pagination and response parsing automatically.

## SDK Method

```typescript theme={null}
fetchTokens(
  request?: GetTokensRequest,
  options?: AvnuOptions
): Promise<Page<Token>>
```

## Parameters

<ParamField path="request" type="GetTokensRequest">
  Optional request parameters

  <Expandable title="GetTokensRequest properties">
    <ParamField path="page" type="number" default={0}>
      Page number for pagination
    </ParamField>

    <ParamField path="size" type="number" default={100}>
      Number of tokens per page (max 1000)
    </ParamField>

    <ParamField path="search" type="string">
      Search by token name or symbol
    </ParamField>

    <ParamField path="tags" type="TokenTag[]">
      Filter by tags: `Verified`, `Community`, `Unruggable`, `AVNU`, `Unknown`
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="options" type="AvnuOptions">
  Optional SDK configuration

  <Expandable title="AvnuOptions properties">
    <ParamField path="baseUrl" type="string">
      Custom API base URL
    </ParamField>

    <ParamField path="avnuPublicKey" type="string">
      Public key for response verification
    </ParamField>
  </Expandable>
</ParamField>

## Returns

Returns `Promise<Page<Token>>` - Paginated response with token list.

```typescript theme={null}
interface Page<Token> {
  content: Token[];
  totalPages: number;
  totalElements: number;
  size: number;
  number: number;
}

type TokenTag = 'Unknown' | 'Verified' | 'Community' | 'Unruggable' | 'AVNU';

interface Token {
  address: string;
  name: string;
  symbol: string;
  decimals: number;
  logoUri: string | null;
  lastDailyVolumeUsd: number;
  extensions: { [key: string]: string };
  tags: TokenTag[];
}
```

## Examples

<CodeGroup>
  ```typescript Fetch All Tokens theme={null}
  import { fetchTokens } from '@avnu/avnu-sdk';

  // Get first 100 tokens
  const result = await fetchTokens();

  console.log(`Total tokens: ${result.totalElements}`);
  console.log(`Tokens on this page: ${result.content.length}`);

  result.content.forEach(token => {
    console.log(`${token.symbol}: ${token.name}`);
    console.log(`  Address: ${token.address}`);
    console.log(`  Tags: ${token.tags.join(', ')}`);
  });
  ```

  ```typescript Filter by Tags theme={null}
  import { fetchTokens } from '@avnu/avnu-sdk';

  // Get only verified tokens
  const verifiedTokens = await fetchTokens({
    tags: ['Verified']
  });

  console.log(`Found ${verifiedTokens.content.length} verified tokens`);
  ```

  ```typescript Search Tokens theme={null}
  import { fetchTokens } from '@avnu/avnu-sdk';

  // Search for USDC-related tokens
  const usdcTokens = await fetchTokens({
    search: 'USDC',
    size: 10
  });

  usdcTokens.content.forEach(token => {
    console.log(`${token.symbol} - ${token.name}`);
  });
  ```
</CodeGroup>

## Token Tags

Available tags to filter tokens:

| Tag          | Description                                          |
| ------------ | ---------------------------------------------------- |
| `Verified`   | Manually verified by avnu team                       |
| `Community`  | Community-approved (3+ avnu Working Group approvals) |
| `Unruggable` | Unruggable memecoin                                  |
| `AVNU`       | avnu team verified token                             |
| `Unknown`    | Token without verification status                    |

## Related

<CardGroup cols={2}>
  <Card title="Token List Overview" icon="coins" href="/docs/tokens/index">
    Learn about verification and token tags
  </Card>

  <Card title="API Reference" icon="code" href="/api/tokens">
    REST API endpoint documentation
  </Card>
</CardGroup>
