Blockin.ai OpenAPI
  • Welcome
  • 🥳GETTING STARTED
    • 🗝️Creating an Account
    • 👀Product Overview
  • 😈REFERENCE
    • 🐙API Reference
      • Chain
        • Query available chain list
      • Protocol
        • Query available protocol
        • Query available protocol list
        • Query all available protocol list
        • Query available tagInfo list
        • Query available protocol detail
        • Query available protocol detail list
        • Query all available protocol detail list
        • Query liquidity change list by chain name and pool address
        • Query swap list by chain name and pool address
      • User
        • Query used chain by user address
        • Query chain balance by chain name and user address
        • Query protocol portfolio list by chain name and user address
        • Query protocol portfolios on all chains by user address
        • Query protocol portfolio by chain name, protocol name and user address
        • Query protocol portfolios on all chains by protocol name and user address
        • Query protocol top holders by chain name and protocol name
        • Query simple protocol list by chain name and user address
        • Query simple protocol list on all chains by user address
        • Query token list by chain name and user address
        • Query token list on all chains by user address
        • Query token top holders by chain name and token address
        • Query collections by chain name and user address
        • Query collections on all chains by user address
        • Query collections on Bitcoin by user address
        • Query items by chain name, collection address and user address
        • Query inscriptions on Bitcoin by user address
        • Query items transfer list by chain name and user address
        • Query history list by chain name and user address
        • Query all history list by user address
        • Query User history - Advanced edition
        • Query total balance on all supported chains by user address
        • Query token authorized list by chain name and user address
        • Query nft authorized list by chain name and user address
        • Query 24-hour net assets curve by chain name and user address
        • Query 24-hour net assets curve on all supported chains by user address
        • Query 24-hour protocol portfolios curve by chain name and user address
        • Query 24-hour protocol portfolios curve on all supported chains by user address
        • Query 24-hour wallet curve by chain name and user address
        • Query 24-hour wallet curve on all supported chains by user address
      • Token
        • Query token info
        • Query token info list
        • Query token market info list
        • Subscribe to token kline data
        • Unsubscribe token kline
        • Query pool list by chain name and token address
        • Query liquidity change list by chain name and token address
        • Query swap list by chain name and token address
        • Query real-time exchange rate
        • Query real-time token price
        • Query LP_token info
        • Query symbol's price from foreign exchange
      • NFT
        • Query collection metadata by chain name and collection address
        • Query collection trade list by chain name and collection address
        • Query item info list by chain name and collection address
        • Query item metadata by chain name, collection address and item id
        • Refresh collection metadata
        • Query inscriptions metadata on Bitcoin by inscriptions id
      • Mirror
        • Query historical token list
        • Query historical protocol portfolios
        • Query historical assets
        • Query historical token list on all supported chains
        • Query historical protocol portfolios on all supported chains
        • Query historical assets on all supported chains
        • Query historical LP_token info
      • Subscription
        • Create history subscription
        • Update history subscription
        • Delete history subscription
        • History subscription query
        • Socket Subscription Connection
        • Subscription notify
        • Alter history subscription
        • History subscription- Query Batch_no List
        • Create history subscription V2
        • Delete history subscription V2
        • Query history subscription wallet V2
        • Query history subscription detail V2
        • History subscription Message query V2
        • Socket Subscription Connection V2
    • 📜Enumeration
    • 🎭Error Code
      • Pre exec error code
    • 🍪Related Features
      • Usage
    • ⌨️Change Log
    • 😎Terms of Service
Powered by GitBook
On this page
  • Description
  • Request Header
  • Request Parameters
  • Response
  • Public Response
  • Response Content
  • Records Content
  • Input token, out token Content
  • Request Sample
  • Successful Response Sample
  • Failed Response Sample
  1. REFERENCE
  2. API Reference
  3. Protocol

Query swap list by chain name and pool address

Description

  • Method: HTTPS POST

  • Encoding: UTF-8

  • Path: https://api.blockin.ai/v2/dexs/pool/swap_list

  • Description: Query the swap list of a pool

Request Header

Parameter
Required
Type
Description

Content-Type

Y

String

application/json

AccessKey

Y

String

1bdb01c947c54919b64d1fc6794atest

Request Parameters

Parameter
Required
Type
Description

chain_name

Y

String

Chain's name, only support ethereum

address

Y

String

Pool address

page

Y

Integer

Page num

page_size

Y

Integer

Page size (The maximum size is 100)

start_usd_value

N

BigDecimal

minimum usd value

end_usd_value

N

BigDecimal

maximum usd value

start_timestamp

N

Long

Start timestamp (Default is the last three months, timestamp in seconds)

end_timestamp

N

Long

End timestamp (Timestamp in seconds)

Response

Public Response

Parameter
Required
Type
Description

success

Y

Boolean

Success Boolean

data

Y

JSONObject

Response object

error_code

N

String

Error code

error_msg

N

String

Error message

Response Content

Parameter
Required
Type
Description

total

Y

Integer

Total number

current

Y

Integer

Current page number

count_page

Y

Integer

Total page number

page_size

Y

Integer

Current page size

records

Y

List

Paginated list

Records Content

Parameter
Required
Type
Description

account

Y

String

User address

protocol_name

Y

String

Protocol's name

project_name

Y

String

Project's name

logo_url

Y

String

Logo's url

site_url

Y

String

Site's url

pool_address

Y

String

Pool address

block_time

Y

Long

Transaction time (Timestamp in seconds)

type

Y

String

Type (buy,sell)

input_token

Y

Object

Token info

out_token

Y

Object

Token info

usd_value

Y

BigDecimal

USD value

tx

Y

String

Transaction hash

Input token, out token Content

Parameter
Required
Type
Description

address

Y

String

Token's address

name

Y

String

Token's name

symbol

Y

String

Token's symbol

decimal

Y

Integer

Token's decimal

amount

Y

BigDecimal

Token's amount

price

N

BigDecimal

Token's price

logo_url

Y

String

Token's logo

Request Sample

curl -X POST 'https://api.blockin.ai/v2/dexs/pool/swap_list' -H 'Accesskey: 1bdb01c947c54919b64d1fc6794atest' -H 'Content-Type: application/json' --data '{"chain_name": "eth","address": "0x004375dff511095cc5a197a54140a24efef3a416","page": 1,"page_size": 20,"start_usd_value": 0,"end_usd_value": 20,"start_timestamp": 1695208367,"end_timestamp": 1695261215}'

Successful Response Sample

{
    "success": true,
    "data": {
        "total": 1,
        "current": 1,
        "count_page": 1,
        "page_size": 20,
        "records": [
            {
                "protocol_name": "uniswap2",
                "project_name": "Uniswap V2",
                "logo_url": "https://www.blockin.ai/image/protocol/uniswap2.png",
                "site_url": "https://app.uniswap.org",
                "pool_address": "0x004375dff511095cc5a197a54140a24efef3a416",
                "account": "0xeaeda1ff9edaa33b00edacd08d6edc33a7483390",
                "block_time": 1695261215,
                "type": "sell",
                "input_token": {
                    "address": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
                    "name": "Wrapped BTC",
                    "symbol": "WBTC",
                    "decimal": 8,
                    "amount": 0.00012979,
                    "price": 26991.099678826676189876,
                    "logo_url": "https://www.blockin.ai/image/token/0x2260fac5e5542a773aa44fbcfedf7c193bc2c599.png"
                },
                "out_token": {
                    "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
                    "name": "USD Coin",
                    "symbol": "USDC",
                    "decimal": 6,
                    "amount": 3.508854,
                    "price": 1.001445743546385570,
                    "logo_url": "https://www.blockin.ai/image/token/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png"
                },
                "usd_value": 3.503174827314914303,
                "tx": "0x2486476d6d37c20661a2e40edcf4e8852d70664e2a8f1478bc4c69fb1bbd5e0e"
            }
        ]
    },
    "error_code": null,
    "error_msg": null
}

Failed Response Sample

{
    "success": false,
    "data": null,
    "error_code": "Unauthorized",
    "error_msg": "AccessKey status error"
}
PreviousQuery liquidity change list by chain name and pool addressNextUser

Last updated 1 year ago

😈
🐙