Get quote details based on input data

GEThttps://api.1inch.com/fusion/quoter/v1.0/{chain}/quote
Supported on:
Solana

Parameters

chain
* number path
srcToken
* string query
dstToken
* string query
amount
* number query
wallet
* string query
enableEstimate
* boolean query
slippage
number query

Request Body

This request doesn’t have any request body.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const axios = require('axios');

async function httpCall() {
  const url = 'https://api.1inch.com/fusion/quoter/v1.0/{chain}/quote';

  const config = {
    headers: {
      Authorization: `Bearer ${API_KEY}`,
    },
    params: {
      srcToken: 'SoNative11111111111111111111111111111111111',
      dstToken: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
      amount: '1000000000',
      wallet: 'GZctHpWXmsZC1YHACTGGcHhYxjdRqQvTpYkb9LMvxDib',
      enableEstimate: 'false',
      slippage: '0.1',
    },
    paramsSerializer: {
      indexes: null,
    },
  };

  try {
    const response = await axios.get(url, config);
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

Returns

200 response doesn’t have payload.

Did you find what you need?