> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.galleon8.com/api-reference/advanced-api/api-endpoints/query-api/ankr-get-transactions-by-hash/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.galleon8.com/_mcp/server. # ankr_getTransactionsByHash POST https://advanced-api-docs-proxy.galleon8.workers.dev Content-Type: application/json Retrieves details of the transaction specified by its hash. Reference: https://docs.galleon8.com/api-reference/advanced-api/api-endpoints/query-api/ankr-get-transactions-by-hash ## Request ### Body (application/json) This endpoint expects an object. - `transactionHash` (string, required) — Hash of the transaction. - `blockchain` (BlockchainSelector, optional) — Name of the blockchain or list of blockchain names. Single: eth. Multiple: [eth, bsc, fantom, avalanche, polygon, arbitrum, syscoin, optimism, eth_goerli, polygon_mumbai, avalanche_fuji]. All chains: empty value. - `decodeLogs` (boolean, optional) — Decode logs (true) or not (false). - `decodeTxData` (boolean, optional) — Decode transaction data (true) or not (false). - `includeLogs` (boolean, optional) — Include logs (true) or exclude them (false). ## Response ### 200 Result returned by ankr_getTransactionsByHash. - `transactions` (list of AnkrGetTransactionsByHashResultTransactionsItems, required, nullable) ## Types ### BlockchainSelector A single blockchain identifier or an array of blockchain identifiers. ### AnkrGetTransactionsByHashResultTransactionsItems - `blockHash` (string, required) — Hash of the block that included the transaction. Null if pending. 32 bytes. - `blockNumber` (string, required) — Block number where the transaction was included. Null if pending. - `blockchain` (enum, required) — Supported blockchain identifier. - Allowed values: `arbitrum`, `avalanche`, `avalanche_fuji`, `bsc`, `eth`, `eth_goerli`, `fantom`, `optimism`, `polygon`, `polygon_mumbai`, `polygon_zkevm`, `syscoin` - `from` (string, required) — Blockchain address, ENS name, or contract address where supported. - `status` (string, required) — Status of the transaction. 1 (success) or 0 (failure). - `timestamp` (string, required) — UNIX timestamp when the block was collated. - `to` (string, required, nullable) — Blockchain address, ENS name, or contract address where supported. - `transactionIndex` (string, required) — Index position of the transaction in the block. Null if pending. - `value` (string, required) — Value transferred. Encoded as hexadecimal. - `contractAddress` (string, optional) — Blockchain address, ENS name, or contract address where supported. - `cumulativeGasUsed` (string, optional) — Total amount of gas used when this transaction was executed in the block. - `gas` (string, optional) — Gas provided by the sender. - `gasPrice` (string, optional) — Gas price provided by the sender. Encoded as hexadecimal. - `gasUsed` (string, optional) — Total used gas by all transactions in this block. - `hash` (string, optional) — Hash of the transaction. 32 bytes. - `input` (string, optional) — Data sent along with the transaction. - `logs` (list of AnkrGetTransactionsByHashResultTransactionsItemsLogsItems, optional) — Array of log objects that the transaction generated. - `method` (AnkrGetTransactionsByHashResultTransactionsItemsMethod, optional) — Name of the method if the transaction was sent to a contract. Empty if no contract. - `nonce` (string, optional) — Total number of transactions ever sent by the sender prior to this transaction. Encoded as hexadecimal. - `r` (string, optional) — R field of the signature. - `s` (string, optional) — S field of the signature. - `type` (string, optional) — Type of the transaction. - `v` (string, optional) — Standardized V field of the signature. ### AnkrGetTransactionsByHashResultTransactionsItemsLogsItems - `address` (string, required) — Blockchain address, ENS name, or contract address where supported. - `blockHash` (string, required) — Hash of the block that included the log. Null when pending. - `blockNumber` (string, required) — Block number where the log was included. Null when pending. - `blockchain` (enum, required) — Supported blockchain identifier. - Allowed values: `arbitrum`, `avalanche`, `avalanche_fuji`, `bsc`, `eth`, `eth_goerli`, `fantom`, `optimism`, `polygon`, `polygon_mumbai`, `polygon_zkevm`, `syscoin` - `data` (string, required) — One or more 32B non-indexed arguments of the log. - `logIndex` (string, required) — Index position of the log in the block. Null when pending. - `removed` (boolean, required) — Status of the log. True when the log was removed due to a chain reorganization, and false if it's a valid log. - `topics` (list of string, required, nullable) - `transactionHash` (string, required) — Hash of the transaction that created the log. Null when pending. - `transactionIndex` (string, required) — Index position of the transaction that created the log. Null when pending. - `event` (AnkrGetTransactionsByHashResultTransactionsItemsLogsItemsEvent, optional) — Metadata of the log. ### AnkrGetTransactionsByHashResultTransactionsItemsMethod Name of the method if the transaction was sent to a contract. Empty if no contract. - `id` (string, optional) — Hashed signature of the called method. - `inputs` (list of AnkrGetTransactionsByHashResultTransactionsItemsMethodInputsItems, optional, nullable) - `name` (string, optional) — Name of the called contract method. - `signature` (string, optional) — Signature of the called method. - `string` (string, optional) — String containing signature of the called method. - `verified` (boolean, optional) — Status of the contract. Verified (true) or not verified (false). ### AnkrGetTransactionsByHashResultTransactionsItemsLogsItemsEvent Metadata of the log. - `anonymous` (boolean, optional) — Anonymous event (true) or not (false). - `id` (string, optional) — Hash of the event signature. - `inputs` (list of AnkrGetTransactionsByHashResultTransactionsItemsLogsItemsEventInputsItems, optional, nullable) - `name` (string, optional) — Name of the event. - `signature` (string, optional) — Signature of the event. - `string` (string, optional) — String containing signature of the event. - `verified` (boolean, optional) — Status of the contract. Verified (true) or not verified (false). ### AnkrGetTransactionsByHashResultTransactionsItemsMethodInputsItems - `name` (string, optional) — Name of the input parameter. - `size` (integer, optional) — Size of the parameter, in bytes. - `type` (string, optional) — Type of the input parameter. - `valueDecoded` (string, optional) — Decoded value of the parameter (unmarshalled). ### AnkrGetTransactionsByHashResultTransactionsItemsLogsItemsEventInputsItems - `indexed` (boolean, optional) — Indexed event input (true) or non-indexed (false). - `name` (string, optional) — Name of the input. - `size` (integer, optional) — Size of the event input. - `type` (string, optional) — Type of the input. - `valueDecoded` (string, optional) — Decoded value of the event input (unmarshalled). ## Examples **Request** ```json [ "0x4792bc24356c2ddb93fee10b153e04808ff4a08aca01f276a422eab88a5dd521", "eth", true, true, true ] ``` **Response** ```json { "jsonrpc": "2.0", "id": "1", "result": { "transactions": [ { "blockHash": "0x1e7b69036e5de4094839e186facabe2e3fb3586f52888bdb22f96e265f77aaeb", "blockNumber": "0xf85b14", "blockchain": "eth", "cumulativeGasUsed": "0x57b86", "from": "0x77223f67d845e3cbcd9cc19287e24e71f7228888", "gas": "0x3012f", "gasPrice": "0x298c22300", "gasUsed": "0x200ca", "hash": "0x4792bc24356c2ddb93fee10b153e04808ff4a08aca01f276a422eab88a5dd521", "input": "0x0372e988016462e1719eb1692cb7af7016172262cb287f37aa000d4f", "logs": [ { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "blockHash": "0x1e7b69036e5de4094839e186facabe2e3fb3586f52888bdb22f96e265f77aaeb", "blockNumber": "0xf85b14", "blockchain": "eth", "data": "0x000000000000000000000000000000000000000000000000008d702a9a8be800", "event": { "anonymous": false, "id": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "inputs": [ { "indexed": true, "name": "_from", "size": 20, "type": "address", "valueDecoded": "0x00000000A991C429eE2Ec6df19d40fe0c80088B8" }, { "indexed": true, "name": "_to", "size": 20, "type": "address", "valueDecoded": "0x72e988016462e1719Eb1692cB7aF7016172262cb" }, { "indexed": false, "name": "_value", "size": 256, "type": "uint256", "valueDecoded": "39811300000000000" } ], "name": "Transfer", "signature": "Transfer(address,address,uint256)", "string": "event Transfer(address indexed _from, address indexed _to, uint256 _value)", "verified": false }, "logIndex": "0x2", "removed": false, "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x00000000000000000000000000000000a991c429ee2ec6df19d40fe0c80088b8", "0x00000000000000000000000072e988016462e1719eb1692cb7af7016172262cb" ], "transactionHash": "0x4792bc24356c2ddb93fee10b153e04808ff4a08aca01f276a422eab88a5dd521", "transactionIndex": "0x5" } ], "nonce": "0x1182", "r": "0x3857d29f619e161e00141abecf5f3420dfbda34dfaf7e10cac20758c5cdd2d0f", "s": "0x7843a450a5f1224e9d6e10e7518b9aba67e6dd1b442c11b3e8926eaca3b72546", "status": "0x1", "timestamp": "0x63aaec8b", "to": "0x00000000a991c429ee2ec6df19d40fe0c80088b8", "transactionIndex": "0x5", "type": "0x2", "v": "0x1", "value": "0x61321" } ] } } ``` **SDK Code** ```python import requests url = "https://advanced-api-docs-proxy.galleon8.workers.dev/" payload = ["0x4792bc24356c2ddb93fee10b153e04808ff4a08aca01f276a422eab88a5dd521", "eth", True, True, True] headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://advanced-api-docs-proxy.galleon8.workers.dev/'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '["0x4792bc24356c2ddb93fee10b153e04808ff4a08aca01f276a422eab88a5dd521","eth",true,true,true]' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://advanced-api-docs-proxy.galleon8.workers.dev/" payload := strings.NewReader("[\n \"0x4792bc24356c2ddb93fee10b153e04808ff4a08aca01f276a422eab88a5dd521\",\n \"eth\",\n true,\n true,\n true\n]") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://advanced-api-docs-proxy.galleon8.workers.dev/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "[\n \"0x4792bc24356c2ddb93fee10b153e04808ff4a08aca01f276a422eab88a5dd521\",\n \"eth\",\n true,\n true,\n true\n]" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://advanced-api-docs-proxy.galleon8.workers.dev/") .header("Content-Type", "application/json") .body("[\n \"0x4792bc24356c2ddb93fee10b153e04808ff4a08aca01f276a422eab88a5dd521\",\n \"eth\",\n true,\n true,\n true\n]") .asString(); ``` ```php request('POST', 'https://advanced-api-docs-proxy.galleon8.workers.dev/', [ 'body' => '[ "0x4792bc24356c2ddb93fee10b153e04808ff4a08aca01f276a422eab88a5dd521", "eth", true, true, true ]', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://advanced-api-docs-proxy.galleon8.workers.dev/"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "[\n \"0x4792bc24356c2ddb93fee10b153e04808ff4a08aca01f276a422eab88a5dd521\",\n \"eth\",\n true,\n true,\n true\n]", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Content-Type": "application/json"] let parameters = ["0x4792bc24356c2ddb93fee10b153e04808ff4a08aca01f276a422eab88a5dd521", "eth", true, true, true] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://advanced-api-docs-proxy.galleon8.workers.dev/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```