YAD
SiteDocs
SiteDocs
    • Introduction
    • Blockchains
      GET
    • List tokens
      POST
    • Liquidity sources
      GET
    • Gas prices
      GET
    • Get price for pair
      GET
    • Transaction allowance
      GET
    • Transaction approve
      GET
    • Get quote for pair
      GET
    • Get Bridge Price
      GET
    • Get Bridge Quote
      GET
    • Get Bridge Tokens
      POST

      Get quote for pair

      GET
      https://api.entrswap.io/v1/{chainID}/quote
      Returns the best exchange offer and input parameters for the transaction.

      Request

      Authorization
      Add parameter in header
      X-API-Key
      Example:
      X-API-Key: ********************
      Path Params

      Query Params

      Request Code Samples

      Shell
      JavaScript
      Java
      Swift
      Go
      PHP
      Python
      HTTP
      C
      C#
      Objective-C
      Ruby
      OCaml
      Dart
      R
      Request Request Example
      Shell
      JavaScript
      Java
      Swift
      curl --location --request GET 'https://api.entrswap.io/v1/1/quote?fromTokenAddress=0xdac17f958d2ee523a2206206994597c13d831ec7&toTokenAddress=0x6b175474e89094c44da98b954eedeac495271d0f&amount=1500000000&slippage=1' \
      --header 'X-API-Key: <api-key>'

      Responses

      🟢200OK
      application/json
      Body

      Example
      {
          "amount_out_total": "1497761574710071333259",
          "estimate_gas_total": "127000",
          "token_in": "0xdac17f958d2ee523a2206206994597c13d831ec7",
          "token_out": "0x6b175474e89094c44da98b954eedeac495271d0f",
          "gas_price": "127000",
          "fee_recipient_amount": "string",
          "routes": [
              {
                  "type": "dex",
                  "protocol_name": "Uniswap_V3",
                  "amount_in": "1500000000",
                  "amount_out": "1497761574710071333259",
                  "percent": 100,
                  "pools": {
                      "protocol_name": "string",
                      "pool_address": "string",
                      "amount_in": "string",
                      "amount_out": "string",
                      "zero_for_one": true,
                      "token0": "string",
                      "token1": "string"
                  }
              }
          ],
          "calldata": "0x318ced5d000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000005061c2da8cfb40f01700000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000059682f000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000018000000000000000000000006f48eca74b38d2936b02ab603ff4e36a6c0e3a77",
          "expiry": 0,
          "to": "0x0000000000000000000000000000000000"
      }
      🟢204No Content
      Modified at 2024-06-04 11:14:09
      Previous
      Transaction approve
      Next
      Get Bridge Price