Get Trades#
Retrieve the recent transactions of a token.
Request URL#
GET https://web3.okx.com/api/v6/dex/market/trades
Request Parameters#
| Parameter | Type | Required | Description | 
|---|---|---|---|
| chainIndex | String | Yes | Unique identifier for the chain. e.g., 1: Ethereum.See more here. | 
| tokenContractAddress | String | Yes | Token contract address,for EVM please pass all-lowercase addresses (e.g., 0x382bb369d343125bfb2117af9c149795c6c65c50) | 
| after | String | No | Pagination of data to return records earlier than the requested id. | 
| limit | String | No | Number of results per request. The maximum is 500 and default is 100. | 
Response Parameters#
| Parameter | Type | Description | 
|---|---|---|
| id | String | Unique trade id | 
| chainIndex | String | Unique identifier for the chain. (e.g., 1 for Ethereum. See ChainIndex) | 
| tokenContractAddress | String | Token contract address | 
| txHashUrl | String | On-chain txhash of the transactions | 
| userAddress | String | Authorizer of the transaction | 
| dexName | String | Name of the dex where the trade occured | 
| poolLogoUrl | String | Pool logo url | 
| type | String | trade Type. buysell | 
| changedTokenInfo | String | exchanged info | 
| > amount | String | token exchanged amount in this trade | 
| > tokenSymbol | String | Token symbol | 
| > tokenContractAddress | String | Token contract address | 
| price | String | Latest token price | 
| volume | String | USD value of this trade | 
| time | String | Timestamp of the price, Unix timestamp format in milliseconds | 
| isFiltered | String | If the trade is filtered for price and k-line calculation. 0: not filtered1: filtered" | 
Request Example#
shell
curl --location --request GET 'https://web3.okx.com/api/v6/dex/market/trades?chainIndex=501&tokenContractAddress=HeLp6NuQkmYB4pYWo2zYs22mESHXPQYzXbB8n4V98jwC' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
Response Example#
200
{
  "code":"0",
  "data":[
    {
    "id":"1739439633000!@#120!@#14731892839",
    "chainIndex": "501",
    "tokenContractAddress": "HeLp6NuQkmYB4pYWo2zYs22mESHXPQYzXbB8n4V98jwC",
    "txHashUrl": "https://solscan.io/tx/zgDzoiVG4XuDgQcoEg9vhpRyfyk5thNUQuTeTCeF289Qec5iraeCrUzPLyiE2UCviox2ebbTcsagGvzYF7M5uqs",
    "userAddress": "2kCm1RHGJjeCKL4SA3ZJCLyXqUD7nEJ7GMtVaP7c6jQ8",
    "dexName": "Orca Whirlpools",
    "poolLogoUrl": "https://static.okx.com/cdn/wallet/logo/dex_orcaswap.png",
    "type": "sell",
    "changedTokenInfo": [
    {
    "amount":"100.396595878", 
    "tokenSymbol":"ai16z",
    "tokenContractAddress": "HeLp6NuQkmYB4pYWo2zYs22mESHXPQYzXbB8n4V98jwC"
    },
    {
    "amount":"2.482831", 
    "tokenSymbol":"SOL",
    "tokenContractAddress": "So11111111111111111111111111111111111111112"
    }
    ]
    "price": "26.458143090226812",
    "volume": "519.788163",
    "time": "1739439633000",
    "isFiltered": "0"
    }
    ],
  "msg":"",
}
