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

# Request Routes & Quotes

> Prior to executing a swap or a bridge, you need to request the best route from our API

<Card title="Disclaimer" icon="triangle-exclamation">
  The Suave Aggregator SDK will only function properly in a browser-like environment. You can use a library like [web3-mock](https://github.com/DePayFi/web3-mock) to simulate this in Node.js.
</Card>

Use the `getRoutes` function to fetch routes/quotes from the Sauve Aggregator API.

Here is a simple example of how to request routes to bridge [10 USDC](https://arbiscan.io/token/0xda10009cbd5d07dd0cecc66161fc93d7c9000da1) on Arbitrum to the maximum amount of [DAI](https://polygonscan.com/token/0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063) on Polygon.

```ts theme={null}
import { getRoutes, RouteResponse } from '@suave-money/sdk'

const routes: RouteResponse[] = await getRoutes({
  inputAmount: '10000000', // 10 USDC
  fromChainId: 42161, // Arbitrum
  fromToken: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831', // USDC on Arbitrum
  toChainId: 137, // Polygon
  toToken: '0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063' // DAI on Polygon
})
```

## Routes request parameters

Below are the parameters for the `getRoutes` function along with their descriptions:

[fromChainId](#)  `number` `required`

The ID of the source chain.

| Chain Name | Chain ID |
| ---------- | -------- |
| Ethereum   | 1        |
| Optimism   | 10       |
| Polygon    | 137      |
| Arbitrum   | 42161    |

[fromTokenAddress](#) `string` `required`

The contract address of the token on the source chain. Ensure this address corresponds to the specified fromChainId.

[fromAmount](#) `string` `required`

The amount to be transferred from the source chain, specified in the smallest unit of the token (e.g., wei for ETH).

[fromAddress](#) `string` `optional`

The address from which the tokens are being transferred.

[toChainId](#) `number` `required`

The ID of the destination chain

| Chain Name | Chain ID |
| ---------- | -------- |
| Ethereum   | 1        |
| Optimism   | 10       |
| Polygon    | 137      |
| Arbitrum   | 42161    |

[toTokenAddress](#) `string` `required`

The contract address of the token on the destination chain. Ensure this address corresponds to the specified toChainId.
