Wallet API
Query Account Transaction List

Query Account Transaction List#

Retrieve the transaction history of a wallet or watched account on all or a specific chain, sorted in reverse chronological order.

Request Path#

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

Request Parameters#

ParameterTypeRequiredDescription
accountIdStringYesUnique identifier for the account
chainIndexStringNoUnique identifier for the chain, e.g., ETH=3
tokenAddressStringNoToken contract address. Filters the transaction records for a specific token
beginStringNoStart time, queries transaction history later than this time. Unix timestamp in milliseconds
endStringNoEnd time, queries transaction history earlier than this time. If neither begin nor end are provided, the query returns transaction history up to the current time. Unix timestamp in milliseconds
cursorStringNoCursor
limitStringNoNumber of results returned, defaults to the latest 20, maximum of 20

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
>methodIdStringMethod
>nonceStringThe nth transaction initiated by the sender
>txTimeStringTransaction time; Unix timestamp 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 of the transaction amount
>txFeeStringTransaction fee
>txStatusStringTransaction status: success (successful), fail (failed), pending (awaiting confirmation)
>hitBlacklistBooleanfalse: Not on the blacklist; true: On the blacklist
>tagStringBlacklist tag type, including types like scam, phishing, or contract vulnerability
cursorStringCursor

Request Example#

shell
curl --location --request GET 'https://www.okx.com/api/v5/wallet/post-transaction/transactions?accountId=31f55853-d430-42c5-b4c6-710d39848cd1' \
--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": "1724212391",
            "transactions": [
                {
                    "chainIndex": "0",
                    "txHash": "5fd7e21515b088e2c47641779d53de4ff3b982c7d71a5e85f06f32d8cd4c5bcc",
                    "methodId": "",
                    "nonce": "",
                    "txTime": "1724250342000",
                    "from": [
                        {
                            "address": "bc1pm7fxkgcrqghf2rtxdw4hupvdpqkped7azyrh2mukedrw2p0cj3hsxt8ph3"
                            "amount": "0.000432"
                        }
                    ],
                    "to": [
                        {
                            "address": "bc1pm7fxkgcrqghf2rtxdw4hupvdpqkped7azyrh2mukedrw2p0cj3hsxt8ph3"
                            "amount": "0.00010"
                        },
                        {
                            "address": "bc1pm7fxkgcrqghf2rtxdw4hupvdpqkped7azyrh2mukedrw2p0cj3hsxt8ph3"
                            "amount": "0.00032738"
                        }
                    ],
                    "tokenAddress": "",
                    "amount": "",
                    "symbol": "BTC",
                    "txFee": "0.00000462",
                    "txStatus": "success",
                    "hitBlacklist": false,
                    "tag": "",
                    "iType": ""
                },
                {
                     "chainIndex": "1",
                     "txHash": "0x307ced97491fdeea9acb141cb3d07939ef3291f28c06c0cacd1cc1f8c435bbe1",
                     "methodId": "",
                     "nonce": "945",
                     "txTime": "1724056787000",
                     "from": [
                         {
                            "address": "0x50c476a139aab23fdaf9bca12614cdd54a4244e4"
                            "amount": ""
                         }
                     ],
                     "to": [
                         {
                            "address": "0x2491889438e5130a4cf629fbc93ae31aad742d8b"
                            "amount": ""
                         }
                    ],
                    "tokenAddress": "",
                    "amount": "0.00001",
                    "symbol": "ETH",
                    "txFee": "1.89E-23",
                    "txStatus": "success",
                    "hitBlacklist": false,
                    "tag": "",
                    "iType": "0"
                }
            ]
        }
    ]
}