Market API

Get History by Address#

Query the transaction history under the address dimension, sorted in descending chronological order.

Request URL#

GET https://web3.okx.com/api/v5/dex/post-transaction/transactions-by-address

Request Parameters#

ParameterTypeRequiredDescription
addressStringYesAddress to query the transaction history for
chainsStringNoFilter the chains whose transaction history needs to be queried. Multiple chains are separated by ",". A maximum of 50 chains are supported.
tokenContractAddressStringNoToken contract address; if empty, query addresses with main chain currency balance;if not pass, query all
beginStringNoStart time, queries transactions after this time. Unix timestamp, in milliseconds
endStringNoEnd time, queries transactions before this time. If both begin and end are not provided, queries transactions before the current time. Unix timestamp, in milliseconds
cursorStringNoCursor
limitStringNoNumber of records to return, defaults to the most recent 20 records.
Up to a maximum of 20 records for query on single chain.
Up to a maximum of 100 records for query on multiple chain.

Response Parameters#

ParameterTypeDescription
transactionsArrayList of transactions
>chainIndexStringChain ID
>txHashStringTransaction hash
>itypeStringTransaction tier type
0: Outer main chain coin transfer
1: Contract inner main chain coin transfer
2: Token transfer
>methodIdStringContract Function Call
>nonceStringThe nth transaction initiated by the sender address
>txTimeStringTransaction time in Unix timestamp format, in milliseconds, e.g., 1597026383085
>fromArrayTransaction input
>>addressStringSending/input address, comma-separated for multi-signature transactions
>>amountStringInput amount
>toArrayTransaction output
>>addressStringReceiving/output address, comma-separated for multiple addresses
>>amountStringOutput amount
>tokenContractAddressStringToken contract address
>amountStringTransaction amount
>symbolStringCurrency symbol corresponding to the transaction amount
>txFeeStringTransaction fee
>txStatusStringTransaction status: success for successful transactions, fail for failed transactions, pending for pending transactions
>hitBlacklistBooleanfalse: Not in blacklist, true: In blacklist
cursorStringCursor

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v5/dex/post-transaction/transactions-by-address?addresses=0x50c476a139aab23fdaf9bca12614cdd54a4244e4&chains=1' \
--header 'Content-Type: application/json' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--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",
    "msg": "success",
    "data": [
        {
            "cursor": "1706197403",
            "transactionList": [
                {
                    "chainIndex": "1",
                    "txHash": "0x963767695543cfb7804039c470b110b87adf9ab69ebc002b571523b714b828ca",
                    "methodId": "",
                    "nonce": "",
                    "txTime": "1724213411000",
                    "from": [
                        {
                            "address": 
                                "0xae7ab96520de3a18e5e111b5eaab095312d7fe84"
                                "amount": ""
                        }
                    ],
                    "to": [
                        {
                            "address": 
                                "0x50c476a139aab23fdaf9bca12614cdd54a4244e4"
                                "amount": ""
                        }
                    ],
                    "tokenContractAddress": "0xe13c851c331874028cd8f681052ad3367000fb13",
                    "amount": "1",
                    "symbol": "claim rewards on stethdao.net",
                    "txFee": "",
                    "txStatus": "success",
                    "hitBlacklist": true,
                    "itype": "2"
                }
            ]
        }
    ]
}