Skip to main content

getTransactions

The getTransactions method provides developers with a powerful tool to efficiently access and retrieve the count and detailed information about transactions within the specified range. The response items are thoughtfully sorted in descending order according to their block numbers and transaction index for your convenience.

How to use getTransactions method ?

Below, you'll find an in-depth guide that provides a comprehensive explanation of how to utilize the getTransactions Builder API method effectively using Blast.

Parameters

Below, you can find the query parameters accepted by the method.

FieldTypeDescription
fromBlockstringStarting block for the query
toBlockstringEnding block for the query
contractAddressstringThe address of the contract
pageSizenumberNumber of records to be retrieved on one page
pageKeystring

Key used to get the next page of results. Must be set to the value of nextPageKey returned in the previous response

Returns

Discover an insightful explanation of the returned parameters here, offering a deep understanding of their significance and implications.

FieldTypeDescription
countnumberNumber of records returned in the current page
nextPageKeystringKey used to get the next page of results. Must be set to the value of nextPageKey returned in the previous response
transactionarray<object>Array of Transaction objects

Example Request and Result for getTransactions

Explore an example of a request made using the getTransactions method, allowing you to retrieve all transactions within the specified range fromBlock to toBlock that match the specified contractAddress. The response provides a comprehensive overview of the transactions, including block details, events,messages, gas-related data, and more. This example showcases the powerful capabilities of the getTransactions method for accessing and analyzing transaction details within your specified criteria.

info

The example in this section uses a non-existing project id.

Make sure you replace it with your Starknet endpoint when issuing the Builder API calls.

Don't have a project id? Here's a straightforward guide on how to obtain one!

Curl request example

curl -X GET https://starknet-mainnet.blastapi.io/<project-id>/builder/getTransactions?fromBlock=284739&toBlock=313696&contractAddress=0x05c0c9d84f2cea3084e3ac48aa72d4b2cde76ea370d73e1b08f9687f81f28ed2 -H 'Content-Type: application/json'