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

# Routes and discovery

> Discover supported networks, tokens, routes, and prices: GetChains, GetTokenList, routes, and pricing endpoints.

Use these endpoints to discover what networks, tokens, and routes are available before building a quote. They are read-only and require no active intent.

For authentication and base URL, see the [API overview](/cross-chain/api-reference/overview).

***

## GetChains

List all supported networks.

**Endpoint**: `POST /GetChains`

No request parameters required.

### Response fields

| Field              | Description                        |
| ------------------ | ---------------------------------- |
| `chains`           | Array of supported network objects |
| `chains[].chainId` | Numeric chain ID                   |
| `chains[].name`    | Human-readable network name        |

### Example

```typescript theme={null}
const { chains } = await trails.getChains({});

chains.forEach((chain) => {
  console.log(chain.chainId, chain.name);
});
// 1 Ethereum
// 137 Polygon
// 8453 Base
// 42161 Arbitrum One
```

***

## GetTokenList

List supported tokens on a specific network.

**Endpoint**: `POST /GetTokenList`

### Request parameters

| Field     | Type   | Required | Description                    |
| --------- | ------ | -------- | ------------------------------ |
| `chainId` | number | Yes      | The network to list tokens for |

### Response fields

| Field               | Description                                   |
| ------------------- | --------------------------------------------- |
| `tokens`            | Array of token objects on the specified chain |
| `tokens[].address`  | Token contract address                        |
| `tokens[].symbol`   | Token symbol (e.g. `USDC`)                    |
| `tokens[].decimals` | Token decimal precision                       |

### Example

```typescript theme={null}
const { tokens } = await trails.getTokenList({ chainId: 137 });

tokens.forEach((token) => {
  console.log(token.symbol, token.address, token.decimals);
});
```

***

## GetExactInputRoutes

Get all available destination options for a given source token and amount. Use this to show customers what they can receive given what they have.

**Endpoint**: `POST /GetExactInputRoutes`

### Request parameters

| Field                | Type   | Required | Description                                  |
| -------------------- | ------ | -------- | -------------------------------------------- |
| `originChainId`      | number | Yes      | Source network chain ID                      |
| `originTokenAddress` | string | Yes      | Source token contract address                |
| `originTokenAmount`  | string | Yes      | Amount to send, in the token's smallest unit |

### Example

```typescript theme={null}
const routes = await trails.getExactInputRoutes({
  originChainId: 1,
  originTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
  originTokenAmount: "1000000",
});
```

***

## GetExactOutputRoutes

Get all available source options for a desired destination token and amount. Use this when the customer specifies how much they want to receive.

**Endpoint**: `POST /GetExactOutputRoutes`

### Request parameters

| Field                     | Type   | Required | Description                                          |
| ------------------------- | ------ | -------- | ---------------------------------------------------- |
| `destinationChainId`      | number | Yes      | Destination network chain ID                         |
| `destinationTokenAddress` | string | Yes      | Destination token contract address                   |
| `destinationTokenAmount`  | string | Yes      | Desired receive amount, in the token's smallest unit |

### Example

```typescript theme={null}
const routes = await trails.getExactOutputRoutes({
  destinationChainId: 137,
  destinationTokenAddress: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
  destinationTokenAmount: "100000000", // 100 USDC
});
```

***

## GetTokenPrices

Get current USD prices for one or more tokens.

**Endpoint**: `POST /GetTokenPrices`

### Request parameters

| Field            | Type      | Required | Description                                |
| ---------------- | --------- | -------- | ------------------------------------------ |
| `tokenAddresses` | string\[] | Yes      | Array of token contract addresses to price |

### Example

```typescript theme={null}
const prices = await trails.getTokenPrices({
  tokenAddresses: [
    "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC on Ethereum
    "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359", // USDC on Polygon
  ],
});

prices.forEach((p) => {
  console.log(p.address, p.priceUsd);
});
```

***

## GetExchangeRate

Get a fiat-to-fiat or fiat-to-crypto exchange rate for display and quoting purposes.

**Endpoint**: `POST /GetExchangeRate`

### Request parameters

| Field          | Type   | Required | Description                                 |
| -------------- | ------ | -------- | ------------------------------------------- |
| `fromCurrency` | string | Yes      | Source currency code (ISO 4217, e.g. `USD`) |
| `toCurrency`   | string | Yes      | Target currency code (ISO 4217, e.g. `EUR`) |
| `amount`       | number | Yes      | Amount in the source currency               |

### Example

```typescript theme={null}
const rate = await trails.getExchangeRate({
  fromCurrency: "USD",
  toCurrency: "EUR",
  amount: 100,
});

console.log(`100 USD = ${rate.convertedAmount} EUR`);
```

***

## GetFiatCurrencyList

List all fiat currencies supported for on-ramp and off-ramp funding.

**Endpoint**: `POST /GetFiatCurrencyList`

No request parameters required.

### Example

```typescript theme={null}
const { currencies } = await trails.getFiatCurrencyList({});

currencies.forEach((c) => {
  console.log(c.code, c.name); // USD United States Dollar
});
```
