Wallet API

Get History by Address#

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

Request Path#

GET https://www.okx.com/api/v5/wallet/post-transaction/transactions-by-address

Request Parameters#

ParameterTypeRequiredDescription
addressStringYesAddress to query the transaction history for
chainIndexStringNoUnique identifier for the chain, e.g. ETH=3
tokenAddressStringNoToken contract address. Used to filter transactions for a specific token
tokenAddressStringNoToken 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

Response Parameters#

ParameterTypeDescription
transactionListArrayList of transactions
>chainIndexStringChain ID
>txHashStringTransaction hash
>iTypeStringEVM Transaction 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
>tokenAddressStringToken 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
>tagStringTag type for blacklisted addresses, including phishing, contract vulnerabilities, etc.
cursorStringCursor

Request Example#

shell
curl --location --request GET 'https://www.okx.com/api/v5/wallet/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": ""
                        }
                    ],
                    "tokenAddress": "0xe13c851c331874028cd8f681052ad3367000fb13",
                    "amount": "1",
                    "symbol": "claim rewards on stethdao.net",
                    "txFee": "",
                    "txStatus": "success",
                    "hitBlacklist": true,
                    "tag": "Risk Airdrop",
                    "iType": "2"
                }
            ]
        }
    ]
}