Wallet API

Get History by Account#

Query all or specific chain transaction history under the account dimension, sorted in descending 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. Used to filter transactions for a specific token
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 layer type
0: External main chain coin transfer
1: Contract internal main chain coin transfer
2: Token transfer
>methodIdStringMethod
>nonceStringThe number of transactions initiated by the sender address
>txTimeStringTransaction time; Unix timestamp in milliseconds, e.g., 1597026383085
>fromArrayTransaction inputs
>>addressStringSender/input address, separated by commas for multi-signature transactions
>>amountStringInput amount
>toArrayTransaction outputs
>>addressStringReceiver/output address, separated by commas for multi-signature transactions
>>amountStringOutput amount
>tokenAddressStringToken contract address
>amountStringTransaction amount
>symbolStringCurrency symbol for the transaction amount
>txFeeStringTransaction fee
>txStatusStringTransaction status; success, fail, pending, etc.
>hitBlacklistBooleanfalse: not in blacklist true: in blacklist
>tagStringBlacklist tag type, including types like phishing, network phishing, and contract vulnerabilities
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"
                }
            ]
        }
    ]
}