Portail dév.
Thème

Batch Get Token Transaction List by Address#

Query the token transaction list for multiple addresses within a given block range in batches. Up to 50 addresses are allowed, and the block range must not span more than 10,000 blocks. Results are returned with cursor + limit pagination. Supports EVM-compatible chains plus APT and TRON.

Supported chains: see Get Transaction API Supported Chains (apiName: token-transaction-list-multi).

Request URL#

GET
https://web3.okx.com/api/v6/explorer/transaction/token-transaction-list-multi

Request Parameters#

ParameterTypeRequiredDescription
chainIndexStringYesUnique identifier of the chain, e.g., 1 for ETH and 0 for BTC. See Get Transaction API Supported Chains for supported values.
addressStringYesAddress. Separate multiple addresses with commas, up to 50; duplicate addresses are deduplicated automatically.
startBlockHeightStringYesStart block height. The range between this and endBlockHeight must not span more than 10,000 blocks.
endBlockHeightStringYesEnd block height.
protocolTypeStringNoContract protocol type: token_20, token_721, token_1155; TRON additionally supports token_10. If omitted, no protocol type filter is applied.
tokenContractAddressStringNoToken contract address. Separate multiple contract addresses with commas, up to 50.
isFromOrToStringNofrom: return only transactions where the from address is the queried address; to: return only transactions where the to address is the queried address. If omitted, a match on either from or to is returned.
limitStringNoNumber of entries per page. Default is 20, maximum is 100.
cursorStringNoCursor returned by the previous response. Omit it for the first page.

Response Parameters#

ParameterTypeDescription
limitStringMaximum number of entries on this page.
cursorStringCursor for the next page; an empty string means no more pages. Pass it back as-is; clients should not parse or construct it.
transactionListArrayToken transaction list.
> txIdStringTransaction hash.
> blockHashStringBlock hash.
> heightStringBlock height.
> transactionTimeStringTransaction time, as a Unix timestamp in milliseconds.
> fromStringSender address.
> toStringRecipient address.
> isFromContractBooleanWhether the from address is a contract address.
> isToContractBooleanWhether the to address is a contract address.
> amountStringTransaction amount.
> tokenIdStringNFT tokenId; an empty string for non-NFT transactions.
> symbolStringToken symbol.
> tokenContractAddressStringToken contract address.

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v6/explorer/transaction/token-transaction-list-multi?chainIndex=1&address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045&startBlockHeight=18717000&endBlockHeight=18718000&protocolType=token_20' \
--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#

json
{
  "code": "0",
  "msg": "",
  "data": [
    {
      "limit": "20",
      "cursor": "",
      "transactionList": [
        {
          "txId": "0x6a4cc25f0eda663b7d5cb92e2f1c92ff1c4bd3f34f7f3a54c8b74e29e3c25e11",
          "blockHash": "0x4a151d9d3e1b7fca2f9f34ea70e2ae35b6f4cd8e4a1cdbedb50ac52c1c50b1af",
          "height": "18717042",
          "transactionTime": "1702138715000",
          "from": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
          "to": "0x5041ed759dd4afc3a72b8192c143f72f4724081a",
          "isFromContract": false,
          "isToContract": true,
          "amount": "1000",
          "tokenId": "",
          "symbol": "USDT",
          "tokenContractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7"
        }
      ]
    }
  ]
}