API
Detailed Developer Guide for Using api.ghosttag.xyz/v1/getTransactions
api.ghosttag.xyz/v1/getTransactions
Endpoint Overview
The api.spot.pizza/v1/getTransactions
endpoint allows developers to fetch Ethereum transaction tag data filtered by various parameters.
Base URL
Supported Query Parameters
address
: Filter by transactions involving this address (either sender or receiver).fromBlock
: Filter by transactions starting from this block number.toBlock
: Filter by transactions up to this block number.txHash
: Filter by a specific transaction hash.fromTime
: Filter by transactions from this timestamp (seconds since Unix epoch).toTime
: Filter by transactions up to this timestamp (seconds since Unix epoch).chainId
: Filter by chain ID (e.g., 1 for Ethereum mainnet).dataHex
: Filter by transactions containing this hexadecimal data.dataString
: Filter by transactions containing this string data.key
: Filter by transactions containing this specific key in the parsed data.fromAddress
: Filter by transactions from this address.toAddress
: Filter by transactions to this address.tag
: Filter by transactions containing this tag in the string data.
Making Requests
Using axios
in Node.js
First, install axios
if you haven't already:
Create a script to fetch transactions:
Using Fetch API in Browser
Example Response
A successful response from the API will return a JSON array of transactions that match the specified filters. Each transaction object may contain the following fields:
chainId
: The ID of the blockchain network.blockNumber
: The block number of the transaction.hash
: The transaction hash.from
: The sender's address.to
: The receiver's address.value
: The value transferred in the transaction (in ETH).timestamp
: The timestamp of the transaction.dataHex
: The transaction data in hexadecimal format.dataString
: The transaction data in string format.dataParsed
: The parsed data from the transaction.
Example:
Error Handling
If the request fails, the API will return an error response. Common error codes include:
400 Bad Request
: Invalid query parameters.404 Not Found
: No transactions match the specified filters.500 Internal Server Error
: An unexpected server error occurred.
Conclusion
Using the getTransactions
endpoint of the api.spot.pizza
service, developers can fetch and filter Ethereum transactions based on various parameters. This guide provides the necessary information to make successful requests and handle responses.
Last updated