REST API

The mirror node REST API offers the ability to query cryptocurrency transactions and account information from a Hedera managed mirror node. This REST API is only available for whitelisted partners

For our whitelisted partners, you may use the following root endpoints: https://testnet.mirrornode.hedera.com https://mainnet.mirrornode.hedera.com For all other users, you may check out DragonGlass and Kabuto as alternatives.‌

Accounts

The accounts object represents the information associated with an account and returns a list of account information.‌

Account IDs take the following format: 0.0.<account number>.‌

Example: 0.0.1000‌

Account IDs can also take the account number as an input value. For example, for account ID 0.0.1000, the number 1000 can be specified in the request.

get
accounts

/api/v1/accounts
Request
Response
Request
Path Parameters
{account ID}
optional
string
Returns information for a specific account ID
Query Parameters
account.id
optional
string
The ID of the account to return account information for
account.balance
optional
number
Returns a list of account IDs that have the specified balance
account.publickey
optional
string
Returns the account information for the specified public key
Response
200: OK
{
"accounts": [
{
"balance": {
"timestamp": "1568420100.066845000",
"balance": 628318531
},
"account": "0.0.1",
"expiry_timestamp": null,
"auto_renew_period": null,
"key": null,
"deleted": null,
"entity_type": "account"
}
],
"links": {
"next": "/api/v1/accounts?limit=1&account.id=gt:0.0.1"
}
}

Response Details

Response Item

Description

accounts

The list of information returned for all accounts

balance

The timestamp and account balance of the account

account

The ID of the account

expiry timestamp

The expiry date for the entity as set by a create or update transaction

auto renew period

The period in which the account autorenews

key

The key associated with the account

deleted

Whether the account was deleted or not (Boolean)

entity type

The type of Hedera service: account, file, or contract

links.next

Hyperlink to the next page of results

Optional Filtering

Operator

Example

Description

lt (less than)

/api/v1/accounts?account.id=lt:0.0.1000

Returns account IDs less then 1000

lte (less than or equal to)

/api/v1/accounts?account.id=lte:0.0.1000

Returns account IDs less than or equal to 1000

gt (greater than)

/api/v1/accounts?account.id=gt:0.0.1000

Returns account IDs greater than 1000

gte (greater than or equal to)

/api/v1/accounts?account.id=gte:0.0.1000

Returns account IDs greater than or equal to 1000

order (order asc or desc values)

/api/v1/accounts?order=asc

/api/v1/accounts?order=desc

Returns account information in ascending order

Returns account information in descending order

Addtional Examples

Example Requests

Description

/api/v1/accounts?account.id=0.0.1001

Returns the account information of account 1001

/api/v1/accounts?account.balance=gt:1000

Returns all account information that have a balance greater than 1000 tinybars

/api/v1/accounts?account.publickey=2b60955bcbf0cf5e9ea880b52e5b63f664b08edf6ed 15e301049517438d61864

Returns all account information for 2b60955bcbf0cf5e9ea880b52e5b63f664b08edf6ed15e301049517438d61864 public key

Balances

The balance object represents the balance of accounts on the Hedera network. You can retrieve this to view the most recent balance of all the accounts on the network at that given time. The balances object returns the account ID and the balance in hbars. Balances are checked on a periodic basis and thus return the most recent snapshot of time captured prior to the request.

get
balances

/api/v1/balances
Request
Response
Request
Query Parameters
account.id
optional
string
The ID of the account to return the balance for
account.balance
optional
number
Returns a list of account IDs that have the specified balance (tinybars)
timestamp
optional
string
The timestamp the user would like to return account balances for. The timestamp can be provided in seconds format (15000000000) or in seconds.nanoseconds (15000000000.010000000).
account.publickey
optional
string
Returns the balance object for a specific public key
Response
200: OK
{
"timestamp": "1568420100.066845000",
"balances": [
{
"account": "0.0.16316",
"balance": 500005000
},
{
"account": "0.0.16315",
"balance": 500005000
},
{
"account": "0.0.16314",
"balance": 500005000
},
{
"account": "0.0.16313",
"balance": 500005000
},
{
"account": "0.0.16312",
"balance": 500005000
}
],
"links": {
"next": "/api/v1/balances?limit=5&account.id=lt:0.0.16312"
}
}

Response Details

Response Item

Description

timestamp

The seconds.nanoseconds of the timestamp at which the list of balances for each account are returned

balances

List of balances for each account

account

The ID of the account

balance

The balance of the account

links.next

Hyperlink to the next page of results

Optional Filtering

Operator

Example

Description

lt (less than)

/api/v1/balances?account.id=lt:0.0.1000

Returns the balances of account IDs less than 1,000

lte (less than or equal to)

/api/v1/balances?account.id=lte:0.0.1000

Returns the balances account IDs less than or equal to 1,000

gt (greater than)

/api/v1/balances?account.id=gt:0.0.1000

Returns the balances of account IDs greater than to 1,000

gte (greater than or equal to)

/api/v1/balances?account.id=gte:0.0.1000

Returns the balances of account IDs greater than or equal to 1,000

order (order asc or desc values)

/api/v1/balances?order=asc

/api/v1/balances?order=desc

Lists balances in ascending order

Lists balances in descending order

Additional Examples

Example Requests

Description

/api/v1/balances?account.id=0.0.1000

Returns balance for account ID 1,000

/api/v1/balances?account.balance=gt:1000

Returns all account IDs that have a balance greater than 1000 tinybars

/api/v1/balances?timestamp=1566562500.040961001

Returns all account balances referencing the latest snapshot that occured prior to 1566562500 seconds and 040961001 nanoseconds

/api/v1/balances?account.publickey=2b60955bcbf0cf5e9ea880b52e5b6 3f664b08edf6ed15e301049517438d61864

Returns balance information for 2b60955bcbf0cf5e9ea880b52e5b63f664b08edf6ed 15e301049517438d61864 public key

Transactions

The transaction object represents the transactions processed on the Hedera network. You can retrieve this to view the transaction metadata information including transaction id, timestamp, transaction fee, transfer list, etc. If a transaction was submitted to multiple nodes, the successful transaction and duplicate transaction(s) will be returned as separate entries in the response with the same transaction ID. Duplicate transactions will still be assessed network fees.

get
transactions

/api/v1/transactions
Request
Response
Request
Query Parameters
account.id
optional
string
The ID of the account the user would like to return transactions for within the transferlist.
timestamp
optional
string
The specific timestamp the user would like to return transactions for
result
optional
string
If result=faill the query returns all failed cryptocurrency transactions If the result=success the query returns all successful cryptocurrency transactions
type
optional
string
If type=credit the query returns all transactions that deposited into an account ID If type=debit the query returns all transactions that withdrew from an account ID
Response
200: OK
{
"transactions":[
{
"consensus_timestamp":"1568542824.686097000",
"valid_start_timestamp":"1568542814.468848000",
"charged_tx_fee":85828,
"memo_base64":"aGFzaC1oYXNoLmluZm8=",
"result":"SUCCESS",
"name":"CRYPTOTRANSFER",
"max_fee":"184000",
"valid_duration_seconds":"120",
"node":"0.0.3",
"transaction_id":"0.0.995-1568542814-468848000",
"transfers":[
{
"account":"0.0.3",
"amount":84000
},
{
"account":"0.0.3",
"amount":3091
},
{
"account":"0.0.98",
"amount":880
},
{
"account":"0.0.98",
"amount":81857
},
{
"account":"0.0.995",
"amount":-84000
},
{
"account":"0.0.995",
"amount":-880
},
{
"account":"0.0.995",
"amount":-84948
}
]
}
]
}

Response Details

Response Item

Description

consensus timestamp

The consensus timestamp in seconds.nanoseconds

valid start timestamp

The time the transaction is valid

charged tx fee

The transaction fee that was charged for that transaction

transaction id

The ID of the transaction

memo base64

The memo attached to the transaction encoded in Base64 format

result

Whether the cryptocurrency transaction was successful or not

name

The type of transaction

max fee

The maximum transaction fee the client is willing to pay

valid duration seconds

The seconds for which a submitted transaction is to be deemed valid beyond the start time. The transaction is invalid if consensusTimestamp is greater than transactionValidStart + valid_duration_seconds.

node

The ID of the node that submitted the transaction to the network

transfers

A list of the account IDs the crypto transfer occurred between and the amount that was transferred. A negative (-) sign indicates a debit to that account. The transfer list includes the transfers between the from account and to account, the transfer of the node fee, the transfer of the network fee, and the transfer of the service fee for that transaction. If the transaction was not processed, a network fee is still assessed.

links.next

A hyperlink to the next page of responses

Optional Filtering

Operator

Example

Description

lt (less than)

/api/v1/transactions?account.id=lt:0.0.1000

Returns account.id transactions less than 1,000

lte (less than or equal to)

/api/v1/transactions?account.id=lte:0.0.1000

Returns account.id transactions less than or equal to 1,000

gt (greater than)

/api/v1/transactions?account.id=gt:0.0.1000

Returns account.id transactions greater than 1,000

gte (greater than or equal to)

api/v1/transactions?account.id=gte:0.0.1000

Returns account.id transactions greater than or equal to 1,000

order (order asc or desc values)

/api/v1/transactions?order=asc

/api/v1/transactions?order=desc

Lists transactions in ascending order Lists transactions descending order

Note: It is recommended that the account.id query should not select no more than 1000 accounts in a query. If the range specified in the query results in selecting more than 1000 accounts, the API will automatically only search for the first 1000 accounts that match the query in the database and return the transactions for those. For example, if you use ?account.id=gt:0.0.15000 or if you use?account.id=gt:0.0.15000&account.id=lt:0.0.30000, then the API will only return results or some 1000 accounts in this range that match the rest of the query filters.‌

A single transaction can also be returned by specifying the transaction ID in the request. If a transaction was submitted to multiple nodes, the response will return entries for the successful transaction along with separate entries for the duplicate transaction(s). The "result" key indicates "success" for the node that processed the transaction and "DUPLICATE_TRANSACTION" for each additional node submission. Duplicate entries are still charged network fees.

Parameter

Description

{transaction_ID}

A specific transaction can be returned by specifying a transaction ID

Additional Examples

Example Request

Description

/api/v1/transactions/?account.id=0.0.1000

Returns transaction for account ID 1,000

/api/v1/transactions?timestamp=1565779209.711927001

Returns transactions at 1565779209 seconds and 711927001 nanoseconds

/api/v1/transactions?result=fail

Returns all transactions that have failed

/api/v1/transactions?account.id=0.0.13622&type=credit /api/v1/transactions?account.id=0.0.13622&type=debit

Returns all transactions that deposited into an account ID 0.0.13622

Returns all transactions that withdrew from account ID 0.0.13622