# getTransaction

## getTransaction RPC Method

> Returns transaction details for a confirmed transaction signature. Provides comprehensive information about the transaction including its status, fees, logs, and account changes. This method is essential for transaction explorers, wallets, and dApps that need to analyze transaction execution details.\
> \
> \*\*Important\*\*: For most modern Solana transactions, you must include  maxSupportedTransactionVersion: 0 in the request parameters, otherwise  the request will fail with an error if the transaction is a versioned transaction.\
>

OpenAPI:

````json
{"openapi":"3.0.3","info":{"title":"Solana RPC API - getTransaction Method","version":"1.0.0"},"tags":[{"name":"Transaction Data","description":"Methods related to transaction data retrieval. These methods provide\ninformation about transaction execution, fees, logs, and state changes.\n"}],"servers":[{"url":"https://public.rpc.solanavibestation.com"},{"url":"https://basic.rpc.solanavibestation.com"},{"url":"https://ultra.rpc.solanavibestation.com"},{"url":"https://elite.rpc.solanavibestation.com"},{"url":"https://epic.rpc.solanavibestation.com"},{"url":"https://basic.swqos.solanavibestation.com"},{"url":"https://ultra.swqos.solanavibestation.com"},{"url":"https://elite.swqos.solanavibestation.com"}],"security":[{},{"AuthHeader":[]},{"URLParameter":[]}],"components":{"securitySchemes":{"AuthHeader":{"type":"apiKey","in":"header","name":"Authorization","description":"Authorization header for API key authentication.\n\n**Example:**\n```\nAuthorization: your-api-key-here\n```\n"},"URLParameter":{"type":"apiKey","in":"query","name":"api_key","description":"API key passed as a URL parameter for authentication.\n\n**Example:**\n```\nhttps://public.rpc.solanavibestation.com/historical?api_key=your-api-key-here\n```\n"}}},"paths":{"/historical":{"post":{"summary":"getTransaction RPC Method","description":"Returns transaction details for a confirmed transaction signature. Provides comprehensive information about the transaction including its status, fees, logs, and account changes. This method is essential for transaction explorers, wallets, and dApps that need to analyze transaction execution details.\n\n**Important**: For most modern Solana transactions, you must include  maxSupportedTransactionVersion: 0 in the request parameters, otherwise  the request will fail with an error if the transaction is a versioned transaction.\n","operationId":"getTransaction","tags":["Transaction Data"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","id","method","params"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"number"}],"description":"Request identifier that will be returned in the response"},"method":{"type":"string","description":"The RPC method name","enum":["getTransaction"]},"params":{"type":"array","description":"Method parameters:\n\n1. Transaction signature (base58 encoded string) - required\n2. Configuration object (optional)\n","minItems":1,"maxItems":2,"items":{"oneOf":[{"type":"string","description":"Transaction signature (base58 encoded) - REQUIRED PARAMETER","pattern":"^[1-9A-HJ-NP-Za-km-z]{87,88}$"},{"type":"object","description":"Configuration options for the getTransaction request","properties":{"encoding":{"type":"string","description":"Encoding format for transaction data:\n- `json`: Return transaction data in JSON format\n- `jsonParsed`: Attempts to use program-specific instruction parsers for more human-readable data\n- `base58`: Return transaction data encoded in base58\n- `base64`: Return transaction data encoded in base64\n","enum":["json","jsonParsed","base58","base64"],"default":"json"},"maxSupportedTransactionVersion":{"type":"integer","description":"**REQUIRED for most transactions**: Set the max transaction version to return. Currently, the only valid value is 0.\nSetting it to 0 allows you to fetch all transactions, including both Versioned and legacy transactions.\nIf you omit this parameter, only legacy transactions will be returned—any versioned transaction will cause the request to fail with an error.\nSince most modern Solana transactions are versioned, this parameter is effectively required.\n","enum":[0]}}}]}}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","description":"RPC response containing transaction information","required":["jsonrpc","id"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"number"}],"description":"Request identifier matching the original request"},"result":{"oneOf":[{"type":"object","description":"Transaction information object","required":["slot","transaction","meta"],"properties":{"slot":{"type":"integer","format":"int64","description":"The slot this transaction was processed in","minimum":0},"transaction":{"type":"object","description":"Transaction object containing message and signatures","required":["message","signatures"],"properties":{"message":{"type":"object","description":"Transaction message containing the instruction data","required":["accountKeys","instructions","recentBlockhash"],"properties":{"accountKeys":{"type":"array","items":{"type":"string","description":"Account public key (base58 encoded)","pattern":"^[1-9A-HJ-NP-Za-km-z]{32,44}$"},"description":"Array of account keys used in the transaction"},"instructions":{"type":"array","items":{"type":"object","description":"Compiled instruction within a transaction","required":["programIdIndex","accounts","data"],"properties":{"programIdIndex":{"type":"integer","description":"Index into the message.accountKeys array indicating which account is the program ID"},"accounts":{"type":"array","items":{"type":"integer"},"description":"List of ordered indices into the message.accountKeys array"},"data":{"type":"string","description":"The program input data (base58 encoded)"},"stackHeight":{"oneOf":[{"type":"integer"},{"type":"null"}],"description":"Stack height of the instruction"}}},"description":"Array of program instructions"},"recentBlockhash":{"type":"string","description":"A recent blockhash used for the transaction","pattern":"^[1-9A-HJ-NP-Za-km-z]{32,44}$"},"header":{"type":"object","description":"Message header information","properties":{"numRequiredSignatures":{"type":"integer","description":"The number of signatures required to validate this transaction"},"numReadonlySignedAccounts":{"type":"integer","description":"The number of signed accounts that are read-only"},"numReadonlyUnsignedAccounts":{"type":"integer","description":"The number of unsigned accounts that are read-only"}}},"addressTableLookups":{"type":"array","items":{"type":"object","description":"Address table lookup for loading additional accounts"},"description":"Array of address table lookups used to load additional accounts for this transaction"}}},"signatures":{"type":"array","items":{"type":"string","description":"Transaction signature (base58 encoded)","pattern":"^[1-9A-HJ-NP-Za-km-z]{87,88}$"},"description":"Array of transaction signatures"}}},"meta":{"oneOf":[{"type":"object","description":"Transaction metadata containing execution results and state changes","required":["fee","preBalances","postBalances"],"properties":{"err":{"oneOf":[{"type":"null"},{"type":"object","description":"Error details if transaction failed","properties":{"InstructionError":{"type":"array","items":{"oneOf":[{"type":"integer"},{"type":"object"}]}}}}],"description":"Error information, or null if transaction succeeded"},"fee":{"type":"integer","description":"Fee this transaction was charged in lamports"},"preBalances":{"type":"array","items":{"type":"integer","format":"int64"},"description":"Array of u64 account balances from before the transaction was processed"},"postBalances":{"type":"array","items":{"type":"integer","format":"int64"},"description":"Array of u64 account balances after the transaction was processed"},"logMessages":{"type":"array","items":{"type":"string"},"description":"Array of string log messages or null if log message recording was not enabled during this transaction"},"preTokenBalances":{"type":"array","items":{"type":"object","description":"Token balance before transaction"},"description":"List of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction"},"postTokenBalances":{"type":"array","items":{"type":"object","description":"Token balance after transaction"},"description":"List of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction"},"innerInstructions":{"type":"array","items":{"type":"object","description":"Inner instruction generated during transaction execution"},"description":"List of inner instructions or null if inner instruction recording was not enabled during this transaction"},"status":{"type":"object","description":"Transaction execution status","properties":{"Ok":{"type":"null","description":"Transaction succeeded"},"Err":{"type":"object","description":"Transaction failed with error details"}}},"computeUnitsConsumed":{"type":"integer","description":"Number of compute units consumed by the transaction"},"loadedAddresses":{"type":"object","description":"Transaction addresses loaded from address lookup tables. Undefined if maxSupportedTransactionVersion is not set in request params."},"returnData":{"oneOf":[{"type":"object","description":"Return data from a program instruction"},{"type":"null"}],"description":"The most-recent return data generated by an instruction in the transaction"}}},{"type":"null"}],"description":"Transaction metadata or null if not available"},"blockTime":{"oneOf":[{"type":"integer","format":"int64"},{"type":"null"}],"description":"Estimated production time of when the transaction was processed, as Unix timestamp (seconds since Unix epoch). null if not available.\n"},"version":{"oneOf":[{"type":"string","enum":["legacy"]},{"type":"integer","enum":[0]}],"description":"Transaction version"}}},{"type":"null"}],"description":"Transaction information or null if transaction is not found"},"error":{"type":"object","description":"Standard JSON-RPC error object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Numeric error code following JSON-RPC 2.0 specification:\n- `-32700`: Parse error\n- `-32600`: Invalid request  \n- `-32601`: Method not found\n- `-32602`: Invalid params\n- `-32603`: Internal error\n- `-32005`: Too Many Requests\n- `-32003`: Unauthorized\n- `-32015`: Transaction version not supported\n"},"message":{"type":"string","description":"Human-readable error message"},"data":{"type":"object","description":"Additional structured error information (optional)","additionalProperties":true}}}}}}}},"401":{"description":"Unauthorized","content":{"text/plain":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden","content":{"text/plain":{"schema":{"type":"string"}}}},"429":{"description":"Too Many Requests","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
````
