Get Transactions in a Block#
Retrieve the transaction list within a specified block, with filtering by transaction type (regular transactions, internal transactions, token transfers, and more).
Supported chains: see Get Block API Supported Chains (apiName: transaction-list).
Request URL#
GET
https://web3.okx.com/api/v6/explorer/block/transaction-listRequest Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
| chainIndex | String | Yes | Unique identifier of the chain, e.g., 1 for ETH, 0 for BTC. See Get Block API Supported Chains for supported values. |
| height | String | Yes | Block height (digits only). |
| protocolType | String | No | Transaction type: transaction for regular transactions (default), internal for internal transactions, token_transfer_20 for ERC-20 token transactions, token_transfer_721 for ERC-721 token transactions, token_transfer_1155 for ERC-1155 token transactions, token_transfer_10 for TRC-10 token transactions. |
| cursor | String | No | Pagination cursor. Pass the cursor returned by the previous response; omit it on the first request. |
| limit | String | No | Number of results to return. Defaults to the most recent 20, up to a maximum of 100. |
Response Parameters#
| Parameter | Type | Description |
|---|---|---|
| limit | String | Maximum number of results per page. |
| cursor | String | Cursor for the next page; an empty string means no more pages. Pass it back as-is; clients should not parse or construct it. |
| chainIndex | String | Unique identifier of the chain. |
| transactionList | Array | Transaction list within the block. |
| > txid | String | Transaction hash. |
| > methodId | String | Method ID. |
| > blockHash | String | Block hash. |
| > height | String | Height of the block containing the transaction. |
| > transactionTime | String | Transaction time, as a Unix timestamp in milliseconds, e.g., 1597026383085. |
| > from | String | Sender address. |
| > isFromContract | Boolean | Whether the from address is a contract address. |
| > isToContract | Boolean | Whether the to address is a contract address. |
| > to | String | Recipient address. |
| > amount | String | Transaction amount. |
| > transactionSymbol | String | Currency corresponding to the transaction amount. |
| > txfee | String | Transaction fee. Returned only for regular transactions (transaction); an empty string "" for other types. |
| > state | String | Transaction state. |
| > tokenId | String | NFT ID. |
| > tokenContractAddress | String | Token contract address. |
Request Example#
shell
curl --location --request GET 'https://web3.okx.com/api/v6/explorer/block/transaction-list?chainIndex=1&height=19000000&protocolType=transaction' \
--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": "2",
"chainIndex": "1",
"transactionList": [
{
"txid": "0x9a92dcd2a29ba1b195f6ee752f8be5da96b03b25ad38ae12de304a01048bf9c4",
"methodId": "0xa9059cbb",
"blockHash": "0xba9ded5ca1ec9adb9451bf062c9de309d9552fa0f0254a7b982d3daf7ae436cd",
"height": "19000000",
"transactionTime": "1705146239000",
"from": "0x28c6c06298d514db089934071355e5743bf21d60",
"isFromContract": false,
"isToContract": true,
"to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"amount": "0",
"transactionSymbol": "ETH",
"txfee": "0.001744128940281",
"state": "success",
"tokenId": "",
"tokenContractAddress": ""
}
]
}
]
}
