API ReferenceTransactions APIGet transaction by hashVersion: 2.0Get transaction by hashMainnetTestnetGEThttps://mainnet-aptos-api.moralis.io/transactions/by_hash/:txn_hashGet transaction by transaction hash.PATH PARAMStxn_hashstringrequiredHash of transaction to retrieveResponses200 oneOfOption 1Option 2Option 3Option 4Option 5API KEYTest Live APINode.jsPythoncURLGoPHPimport Moralis from 'moralis';try { await Moralis.start({ apiKey: "YOUR_API_KEY" }); const response = await Moralis.AptosApi.transactions.getTransactionByHash({}); console.log(response);} catch (e) { console.error(e);}from moralis import aptos_apiapi_key = "YOUR_API_KEY"params = {}result = aptos_api.transactions.get_transaction_by_hash( api_key=api_key, params=params,)print(result)curl --request GET \ --url 'https://mainnet-aptos-api.moralis.io/transactions/by_hash/%3Atxn_hash' \ --header 'accept: application/json' \ --header 'X-API-Key: YOUR_API_KEY' package mainimport ( "fmt" "net/http" "io/ioutil")func main() { url := "https://mainnet-aptos-api.moralis.io/transactions/by_hash/%3Atxn_hash" req, _ := http.NewRequest("GET", url, payload) req.Header.Add("Accept", "application/json") req.Header.Add("X-API-Key", "YOUR_API_KEY") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body))}<?php// Dependencies to install:// $ composer require guzzlehttp/guzzlerequire_once('vendor/autoload.php');$client = new \GuzzleHttp\Client();$response = $client->request('GET', 'https://mainnet-aptos-api.moralis.io/transactions/by_hash/%3Atxn_hash', [ 'headers' => [ 'Accept' => 'application/json', 'X-API-Key' => 'YOUR_API_KEY', ],]);echo $response->getBody();Response Example200 { "hash": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "", "function": "", "type_arguments": [ "" ], "arguments": [ "" ] }, "signature": { "type": "", "signature": "", "public_key": "" }}