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

# Get Quotes

> Best-route quotes for same-chain swaps and cross-chain bridges.

Returns the best available routes for one or more swap/bridge pairs, including recommended provider, priced route, and fees. Transaction calldata is not included - call [`/v1/buildTx`](/api/trade/build-tx) separately once you've picked a route.

### Body

<ParamField body="fromChain" type="integer" required>Source chain ID for every item in `data`.</ParamField>

<ParamField body="data" type="object[]" required>
  Array of trade requests to quote.

  <Expandable title="data item">
    <ParamField body="amount" type="string" required>Amount to send, in the source token's smallest unit.</ParamField>

    <ParamField body="srcToken" type="string" required>Source token contract address.</ParamField>

    <ParamField body="srcDecimals" type="integer">Source token decimals (skips a lookup if provided).</ParamField>

    <ParamField body="destToken" type="string" required>Destination token contract address.</ParamField>

    <ParamField body="destDecimals" type="integer">Destination token decimals (skips a lookup if provided).</ParamField>

    <ParamField body="toChain" type="integer" required>Destination chain ID.</ParamField>

    <ParamField body="slippage" type="number" required>Slippage tolerance, in percent.</ParamField>

    <ParamField body="selectedSource" type="string">Restrict/prefer quoting to a specific provider ID.</ParamField>
  </Expandable>
</ParamField>

<ParamField body="account" type="string">User's wallet address.</ParamField>

<ParamField body="filter" type="string">Quote filter: `all` (default), `best`, or `fastest`.</ParamField>

<ParamField body="gasless" type="boolean">Request gasless-eligible quotes.</ParamField>

<ParamField body="private" type="boolean">Request private/MEV-protected quotes.</ParamField>

<ParamField body="disableEstimation" type="boolean">Skip gas/output estimation for a faster response.</ParamField>

<ParamField body="bridges" type="object">Allow/deny list of bridge providers: `{ allow?: string[]; deny?: string[] }`.</ParamField>

<ParamField body="dexes" type="object">Allow/deny list of DEX providers: `{ allow?: string[]; deny?: string[] }`.</ParamField>

<ParamField body="timingStrategy" type="object">
  Fine-tune quote collection timing.

  <Expandable title="timingStrategy">
    <ParamField body="minWaitTimeMs" type="integer">Minimum wait time before returning results. Default `1000`.</ParamField>

    <ParamField body="maxWaitTimeMs" type="integer">Maximum wait time for quote optimization. Default `5000`.</ParamField>

    <ParamField body="subsequentDelayMs" type="integer">Delay between subsequent provider batches. Default `500`.</ParamField>

    <ParamField body="preferredResultCount" type="integer">Target number of quotes to collect. Default `3`.</ParamField>

    <ParamField body="relaxMinSuccessOnDelay" type="boolean">Return partial results once `maxWaitTimeMs` is hit.</ParamField>
  </Expandable>
</ParamField>

### Response

The response is an object keyed by pair identifier (`{fromChain}_{srcToken}_{toChain}_{destToken}`), not wrapped in a `data` envelope.

<ResponseField name="{pair}.status" type="string">Per-pair status, if applicable.</ResponseField>

<ResponseField name="{pair}.recommendedSource" type="string">Provider ID of the recommended route.</ResponseField>

<ResponseField name="{pair}.bestReturnSource" type="string">Provider ID with the best return - use as a fallback route.</ResponseField>

<ResponseField name="{pair}.fastestSource" type="string">Provider ID with the fastest execution (bridge quotes only).</ResponseField>

<ResponseField name="{pair}.quoteRates" type="object">
  Map keyed by provider ID, each value a full quote.

  <Expandable title="quote">
    <ResponseField name="providerDetails" type="object">
      <Expandable title="providerDetails">
        <ResponseField name="id" type="string" />

        <ResponseField name="name" type="string" />

        <ResponseField name="icon" type="string" />
      </Expandable>
    </ResponseField>

    <ResponseField name="bridgeDetails" type="object">Present for bridge routes. Same shape as `providerDetails` above.</ResponseField>

    <ResponseField name="srcAmount" type="string" />

    <ResponseField name="srcAmountUSD" type="string" />

    <ResponseField name="destAmount" type="string" />

    <ResponseField name="destAmountUSD" type="string" />

    <ResponseField name="minDestAmount" type="string" />

    <ResponseField name="swapPerUnit" type="string">Effective exchange rate for this route.</ResponseField>

    <ResponseField name="srcToken" type="object">
      <Expandable title="srcToken">
        <ResponseField name="address" type="string" />

        <ResponseField name="decimals" type="integer" />

        <ResponseField name="chainId" type="integer" />

        <ResponseField name="logo" type="string" />

        <ResponseField name="symbol" type="string" />

        <ResponseField name="price" type="string" />
      </Expandable>
    </ResponseField>

    <ResponseField name="destToken" type="object">Same shape as `srcToken` above.</ResponseField>

    <ResponseField name="priceImpactPercent" type="string" />

    <ResponseField name="duration" type="string">Estimated seconds to completion.</ResponseField>

    <ResponseField name="gasless" type="boolean" />

    <ResponseField name="fee" type="object">
      <Expandable title="fee">
        <ResponseField name="gasFee" type="object[]">
          <Expandable title="fee item">
            <ResponseField name="address" type="string" />

            <ResponseField name="decimals" type="integer" />

            <ResponseField name="chainId" type="integer" />

            <ResponseField name="symbol" type="string" />

            <ResponseField name="amount" type="string" />

            <ResponseField name="amountUSD" type="string" />

            <ResponseField name="included" type="boolean">Whether the fee is already netted into the shown amounts.</ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="protocolFee" type="object[]">Same item shape as `gasFee` above.</ResponseField>
        <ResponseField name="providerFee" type="object[]">Same item shape as `gasFee` above.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="steps" type="object[]">
      High-level step summary.

      <Expandable title="step item">
        <ResponseField name="type" type="string" />

        <ResponseField name="exchange" type="object">`{ logo, name }`.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="path" type="object[]">
      Detailed route path.

      <Expandable title="path item">
        <ResponseField name="type" type="string" />

        <ResponseField name="exchange" type="object">Same shape as `providerDetails` above.</ResponseField>
        <ResponseField name="srcToken" type="object">Same shape as the top-level `srcToken` above.</ResponseField>

        <ResponseField name="srcAmount" type="string" />

        <ResponseField name="srcAmountUSD" type="string" />

        <ResponseField name="destToken" type="object">Same shape as the top-level `srcToken` above.</ResponseField>

        <ResponseField name="destAmount" type="string" />

        <ResponseField name="destAmountUSD" type="string" />

        <ResponseField name="fee" type="object">Same shape as the top-level `fee` above.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="tags" type="object[]">
      Optional route badges.

      <Expandable title="tag item">
        <ResponseField name="title" type="string" />

        <ResponseField name="link" type="string" />

        <ResponseField name="message" type="string" />
      </Expandable>
    </ResponseField>

    <ResponseField name="additionalInfo" type="object">Provider-specific extra data (shape varies).</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="{pair}.tokensWithoutPrice" type="object">Map of `chainId` → token addresses missing price data.</ResponseField>

### Examples

<RequestExample>
  ```bash curl theme={null}
  curl -X POST https://api.dzap.io/v1/quotes \
    -H "Content-Type: application/json" \
    -d '{
      "fromChain": 42161,
      "data": [
        {
          "amount": "1000000",
          "srcToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
          "destToken": "0x4200000000000000000000000000000000000006",
          "toChain": 8453,
          "slippage": 1
        }
      ],
      "account": "0x99BCEBf44433E901597D9fCb16E799a4847519f6"
    }'
  ```

  ```ts SDK theme={null}
  const quotes = await dzap.getTradeQuotes({
    fromChain: 42161,
    data: [
      {
        amount: '1000000',
        srcToken: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
        destToken: '0x4200000000000000000000000000000000000006',
        toChain: 8453,
        slippage: 1,
      },
    ],
    account: '0x99BC...',
  });
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "42161_0xaf88d065e77c8cC2239327C5EDb3A432268e5831_8453_0x4200000000000000000000000000000000000006": {
      "recommendedSource": "across",
      "bestReturnSource": "across",
      "quoteRates": {
        "across": {
          "providerDetails": { "id": "across", "name": "Across", "icon": "https://..." },
          "srcAmount": "1000000",
          "srcAmountUSD": "1.00",
          "destAmount": "300000000000000",
          "destAmountUSD": "0.99",
          "minDestAmount": "298500000000000",
          "priceImpactPercent": "0.12",
          "duration": "90",
          "gasless": false,
          "fee": { "gasFee": [], "protocolFee": [], "providerFee": [] },
          "steps": [{ "type": "bridge", "exchange": { "logo": "https://...", "name": "Across" } }],
          "path": []
        }
      },
      "tokensWithoutPrice": {}
    }
  }
  ```
</ResponseExample>
