# Introduction

### Introduction

Welcome to the OpenScan APIs documentation 🚀.

OpenScan <img src="https://3031522054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXu62EOofQp3ILGO91lm4%2Fuploads%2Fgit-blob-4fe1a01894990fe9e1645e1d59d95a1b2688f64c%2FopenscanLogo.jpg?alt=media" alt="" data-size="line"> is the leading blockchain explorer, search, API and analytics platform for XDC Network <img src="https://cdn.xinfinscan.com/tokens/XDC.png" alt="" data-size="line">, a decentralized smart contracts platform.

As a means to provide equitable access to blockchain data, we've developed the **OpenScan Developer APIs** to empower developers with direct access to OpenScan's block explorer data and services via **GET/POST requests.**

OpenScan's APIs are provided as a **community service** and **without warranty**, so please use what you need and no more.

{% hint style="success" %}
**Source attribution** via a backlink or a mention that your app is **"Powered by OpenScan.io APIs"** is required except for personal/private usage.
{% endhint %}

### API Endpoints <a href="#api-endpoints" id="api-endpoints"></a>

> Your app may need to show *a user's ERC-20 token holdings* and their USD value 💰 , check if a transaction has been mined ⛏️ or *get the latest gas price estimates* ⛽ *.*

For that you may find a suitable endpoint from our wide range of APIs that you can simply query to provide data while you remain fully focused on building your applications.

OpenScan offers 2 types of API plans, a set of free **community endpoints** and **API PRO**(Coming soon) which consists of additional derived blockchain data.

### Tutorials <a href="#tutorials" id="tutorials"></a>

> There is an overwhelming amount of data 📈 that can be extracted from the XDC Network blockchain.

We've helped you take the first steps by writing some thorough tutorials on how to query and derive popular blockchain metrics.

For power users, we've also added guides such as how you can *programmatically verify contracts* through API calls and more advanced use cases of endpoints.

### Support & FAQ <a href="#support-and-faq" id="support-and-faq"></a>

If your issue is a unique one or you need more clarification, feel free to reach out to us via our [**support channels.**](https://docs.blocksscan.io/support/getting-help)

[Next Endpoint URLs](https://docs.blocksscan.io/getting-started/endpoint-urls)


# Endpoint URLs

An API key generated on OpenScan <img src="https://docs.blocksscan.io/~gitbook/image?url=https%3A%2F%2F3031522054-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FXu62EOofQp3ILGO91lm4%252Fuploads%252Fgit-blob-4fe1a01894990fe9e1645e1d59d95a1b2688f64c%252FopenscanLogo.jpg%3Falt%3Dmedia&#x26;width=36&#x26;dpr=2&#x26;quality=100&#x26;sign=898479d4&#x26;sv=2" alt="" data-size="line">​ can be used across all **mainnet** and **testnet** explorers.

Similarly, all endpoints and parameter formatting remain the same across testnet explorers, you are only required to change the relevant API endpoint URL as follows.

| Network         | URL                                | Documentation                 |
| --------------- | ---------------------------------- | ----------------------------- |
| Mainnet         | <https://bapi.blocksscan.io/>      | <https://docs.blocksscan.io/> |
| Apothem TestNet | <https://abapi.blocksscan.io/>     |                               |
| DevNet          | <https://devnetapi.blocksscan.io/> |                               |


# Nametags(WIP)

## Get An Address's Nametag

Returns an address's nametag such as "Coinbase 10", as well as associated labels such as "exchange".

```
https://api.xdcscan.io/api
   ?chainid=1
   &module=nametag
   &action=getaddresstag
   &address=0xA9D1e08C7793af67e9d92fe308d5697FB81d3E43
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?chainid=1\&module=nametag\&action=getaddresstag\&address=0xA9D1e08C7793af67e9d92fe308d5697FB81d3E43\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                 |
| ------------ | --------------------------------------------------------------------------- |
| address      | the address to check for name tag and labels                                |
| chainid      | the chain to query labels on, addresses `may not` be the same across chains |
| {% endtab %} |                                                                             |

{% tab title="Response" %}
Sample response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "address":"0xa9d1e08c7793af67e9d92fe308d5697fb81d3e43",
         "nametag":"Coinbase 10",
         "internal_nametag":"",
         "url":"https://coinbase.com",
         "shortdescription":"",
         "notes_1":"",
         "notes_2":"",
         "labels":[
            "Exchange",
            "Coinbase"
         ],
         "labels_slug":[
            "exchange",
            "coinbase"
         ],
         "reputation":0,
         "other_attributes":[
            
         ],
         "lastupdatedtimestamp":1674628276
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Metadata CSV

For enterprise usage of nametags, CSV exports of label categories such as "phish" or "ofac". Reach out for a demo.

## Export CSV for a Specific Label

Returns addresses filtered by a specific label in CSV format.

```
https://api.xdcscan.io/api
   module=nametag
   &action=exportaddresstags
   &label=nft
   &format=csv
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=nametag\&action=exportaddresstags\&label=nft\&format=csv\&apikey=YourAPIKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                          |
| ------------ | -------------------------------------------------------------------- |
| label        | the label name representing the 'category' for clustering addresses. |
| {% endtab %} |                                                                      |

{% tab title="Response" %}
Sample response

```
Sample CSV File
```

{% endtab %}
{% endtabs %}

## Get Label Masterlist

Returns the categories of labels available.

```
https://api.xdcscan.io/api
   module=nametag
   &action=getlabelmasterlist
   &apikey=YourAPIKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=nametag\&action=getlabelmasterlist\&apikey=YourAPIKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter              | Description                                                              |
| ---------------------- | ------------------------------------------------------------------------ |
| labelname              | the label name representing the 'category' for clustering addresses.     |
| labelslug              | the URL slug for the label. can be used for Openscan's Label Word Cloud. |
| shortdescription       | the description of the label.                                            |
| last updated timestamp | the Unix timestamp for the last updated time of the label.               |
| notes                  | private note for the label.                                              |
| {% endtab %}           |                                                                          |

{% tab title="Response" %}
Sample response

```
{
  "status": "1",
  "message": "OK",
  "result": [
    {
      "labelname": "0-Gas Sender",
      "labelslug": "0-gas-sender",
      "shortdescription": "Addresses that sent transactions with 0 gas prices.",
      "notes": "",
      "lastupdatedtimestamp": 1673930922
    },
    {
      "labelname": "0x Protocol",
      "labelslug": "0x-protocol",
      "shortdescription": "0x Protocol is an open protocol that enables the peer-to-peer exchange of assets on the xdcnetwork blockchain.",
      "notes": "",
      "lastupdatedtimestamp": 1670574376
    }
  ]
}
```

{% endtab %}
{% endtabs %}


# Accounts

## Get XDC Balance for a Single Address

Returns the XDC balance of a given address.

```
https://api.xdcscan.io/api
   ?module=account
   &action=balance
   &address=xdcd0ad6bc1c9e6fd9fc1be1d674109e1afcc78b058
   &tag=latest
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=account\&action=balance\&address=xdcd0ad6bc1c9e6fd9fc1be1d674109e1afcc78b058\&tag=latest) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                        |
| ------------ | ---------------------------------------------------------------------------------- |
| address      | the `string` representing the address to check for balance                         |
| tag          | the `string` pre-defined block parameter, either `earliest`, `pending` or `latest` |
| {% endtab %} |                                                                                    |

{% tab title="Response" %}
Sample response

```
{
"status":1,
"message":"OK",
"result":"247034877728026032192152901"
} 
```

{% endtab %}
{% endtabs %}

## Get XDC Balance for Multiple Addresses in a Single Call

Returns the balance of the accounts from a list of addresses.

```
https://api.xdcscan.io/api
   ?module=account
   &action=balancemulti
   &address=xdc3f3fC7F56bA472C5cFE63bc696E3666136938443,xdcb94249638a3cd070794a6896f65b954547685f8f,xdc20b855cc70f6b64c76e20fae544309cc11910fdb
   &tag=latest
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=account\&action=balancemulti\&address=xdc3f3fC7F56bA472C5cFE63bc696E3666136938443,xdcb94249638a3cd070794a6896f65b954547685f8f,xdc20b855cc70f6b64c76e20fae544309cc11910fdb\&tag=latest) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                                                                                                         |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| address      | <p>the <code>strings</code> representing the addresses to check for balance, separated by <code>,</code></p><p><br>up to <strong>20 addresses</strong> per call</p> |
| tag          | the `integer` pre-defined block parameter, either `earliest`, `pending` or `latest`                                                                                 |
| {% endtab %} |                                                                                                                                                                     |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"result": {
"message": "OK",
"result": [
{
"account": "0x3f3fc7f56ba472c5cfe63bc696e3666136938443",
"balance": "921700816087500000000",
"stale": true
},
{
"account": "0xb94249638a3cd070794a6896f65b954547685f8f",
"balance": "2738043636316474609925029682",
"stale": false
},
{
"account": "0x20b855cc70f6b64c76e20fae544309cc11910fdb",
"balance": "0",
"stale": false
}
],
"status": "1"
}
}
```

{% endtab %}
{% endtabs %}

## Get a list of 'Normal' Transactions By Address

Returns the list of transactions performed by an address, with optional pagination.

{% hint style="info" %}
📝**Note :** This API endpoint returns a maximum of **10000 records** only.
{% endhint %}

<pre><code>https://api.xdcscan.io/api
   ?module=account
   &#x26;action=txlist
<strong>   &#x26;address=xdcd77875df9c9de07a5a701f4431743e3a0e9fe03a
</strong>   &#x26;startblock=88480972
   &#x26;endblock=88480972
   &#x26;page=1
   &#x26;offset=10
   &#x26;sort=asc
</code></pre>

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=account\&action=txlist\&address=xdcd77875df9c9de07a5a701f4431743e3a0e9fe03a\&startblock=88480972\&endblock=88480972\&page=1\&offset=10\&sort=asc) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    |                                                                                                                                                                                |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| address      | the `string` representing the addresses to check for balance                                                                                                                   |
| startblock   | the `integer` block number to start searching for transactions                                                                                                                 |
| endblock     | the `integer` block number to stop searching for transactions                                                                                                                  |
| page         | the `integer` page number, if pagination is enabled                                                                                                                            |
| offset       | the number of transactions displayed per page                                                                                                                                  |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descendin **Tip:** Specify a smaller `startblock` and `endblock` range for faster search results. |
| {% endtab %} |                                                                                                                                                                                |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"result": [
{
"hash": "0xb583ef2d4ef74459c080ce3fa637408b1a115d4886e167e743824636563803d3",
"input": null,
"blockHash": "0x1feec3e76f5967dac3e618a1eedd822da77f13697cbb9fcfad1f9739c6377c64",
"blockNumber": 88480972,
"block_consensus": true,
"timeStamp": 1746873623,
"cumulativeGasUsed": "536920",
"from": "0xd77875df9c9de07a5a701f4431743e3a0e9fe03a",
"gas": "21000",
"gasPrice": "0",
"gasUsed": "21000",
"transactionIndex": 3,
"nonce": 25,
"txreceipt_status": 1,
"to": "0x5f1419480dc0ca1686dfbae553468ec50f46cdc2",
"value": "149999900000000000000000000",
"revert_reason": null,
"confirmations": 7550239,
"isError": null
}
]
}
```

{% endtab %}
{% endtabs %}

## Get a list of 'Internal' Transactions by Address

Returns the list of internal transactions performed by an address, with optional pagination.

{% hint style="info" %}
:pencil: **Note :** This API endpoint returns a maximum of **10000 records** only.
{% endhint %}

<pre data-overflow="wrap"><code><strong>https://api.xdcscan.io/api
</strong>   ?module=account
   &#x26;action=txlistinternal
   &#x26;address=xdcffa2d110e1c130d90c1c1228636702c904aa70e8
   &#x26;startblock=0
   &#x26;endblock=57018651
   &#x26;page=1
   &#x26;offset=10
   &#x26;sort=asc
   &#x26;apikey=YourApiKeyToken
</code></pre>

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=account\&action=txlistinternal\&address=xdcffa2d110e1c130d90c1c1228636702c904aa70e8) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter  | Description                                                                             |
| ---------- | --------------------------------------------------------------------------------------- |
| address    | the `string` representing the addresses to check for balance                            |
| startblock | the `integer` block number to start searching for transactions                          |
| endblock   | the `integer` block number to stop searching for transactions                           |
| page       | the `integer` page number, if pagination is enabled                                     |
| offset     | the number of transactions displayed per page                                           |
| sort       | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |

{% hint style="info" %}
:bulb: **Tip:** Specify a smaller `startblock` and `endblock` range for faster search results
{% endhint %}
{% endtab %}

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"data": [
{
"blockNumber": "77010245",
"callType": "call",
"from": "0x6c68c5ba9a2998325f3b9e6658eda130c3ab874f",
"to": "0xffa2d110e1c130d90c1c1228636702c904aa70e8",
"transactionHash": "0x290dc1362b99ca26b92360accf527c395ceeea57f69ac5aaf6f1104fb0afb92f",
"value": "0",
"input": "5339c2960000000000000000000000000000000000000000000000000000000000000075",
"gas": "350652",
"isError": null,
"index": 8,
"gasUsed": "1247",
"contractAddress": "",
"timeStamp": "1720593530"
},
{
"blockNumber": "77010245",
"callType": "call",
"from": "0x6c68c5ba9a2998325f3b9e6658eda130c3ab874f",
"to": "0xffa2d110e1c130d90c1c1228636702c904aa70e8",
"transactionHash": "0x290dc1362b99ca26b92360accf527c395ceeea57f69ac5aaf6f1104fb0afb92f",
"value": "0",
"input": "d0c93a7c",
"gas": "383016",
"isError": null,
"index": 4,
"gasUsed": "234",
"contractAddress": "",
"timeStamp": "1720593530"
},
]
}

```

{% endtab %}
{% endtabs %}

## Get 'Internal Transactions' by Transaction Hash

Returns the list of internal transactions performed within a transaction.

{% hint style="warning" %}
:pencil: **Note :** This API endpoint returns a maximum of **10000 records** only.
{% endhint %}

```
https://api.xdcscan.io/api
   ?module=account
   &action=txlistinternal
   &txhash=0x28223599a92c950d9ace13a67082f05a4f92c38004504472a09ba6039ce4e635
```

> Try this endpoint in your [**browse**](https://api.xdcscan.io/api?module=account\&action=txlistinternal\&txhash=0x28223599a92c950d9ace13a67082f05a4f92c38004504472a09ba6039ce4e635) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                       |
| ------------ | --------------------------------------------------------------------------------- |
| txhash       | the `string` representing the transaction hash to check for internal transactions |
| {% endtab %} |                                                                                   |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"data": [
{
"blockNumber": "64947318",
"callType": "staticcall",
"from": "0x8392687c812c5a4d2d026e47f38fbdd540d802ca",
"to": "0x183477253b3773d0ca1d798c83e7e7572c68375b",
"transactionHash": "0x28223599a92c950d9ace13a67082f05a4f92c38004504472a09ba6039ce4e635",
"value": "0",
"input": "d21220a7",
"gas": "42894262",
"isError": null,
"index": 1192,
"gasUsed": "1081",
"contractAddress": "",
"timeStamp": "1693666311"
},
{
"blockNumber": "64947318",
"callType": "staticcall",
"from": "0x8392687c812c5a4d2d026e47f38fbdd540d802ca",
"to": "0x183477253b3773d0ca1d798c83e7e7572c68375b",
"transactionHash": "0x28223599a92c950d9ace13a67082f05a4f92c38004504472a09ba6039ce4e635",
"value": "0",
"input": "d21220a7",
"gas": "42896495",
"isError": null,
"index": 1191,
"gasUsed": "1081",
"contractAddress": "",
"timeStamp": "1693666311"
},
]
}
```

{% endtab %}
{% endtabs %}

## Get "Internal Transactions" by Block Range

Returns the list of internal transactions performed within a block range, with optional pagination.

{% hint style="warning" %}
​​ :pencil: **Note :** This API endpoint returns a maximum of **10000 records** only.
{% endhint %}

```
https://api.xdcscan.io/api
   ?module=account
   &action=txlistinternal
   &startblock=56018742 
   &endblock=57018742 
   &page=1
   &offset=10
   &sort=asc
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=account\&action=txlistinternal\&startblock=56018742\&endblock=57018742\&page=1\&offset=10\&sort=asc) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startblock   | the `integer` block number to start searching for transactions                          |
| endblock     | the `integer` block number to stop searching for transactions                           |
| page         | the `integer` page number, if pagination is enabled                                     |
| offset       | the number of transactions displayed per page                                           |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"data": [
{
"blockNumber": "56239666",
"callType": "call",
"from": "0xd70ef43752571ba7dff8516863a12b7a26b3b45e",
"to": "0x0000000000000000000000000000000000000089",
"transactionHash": "0x054f51fd5640cf58dc01508a7ac77b91ddfb0edf5e8dc5224ae0d231de1f650a",
"value": "0",
"input": "e341eaa400000000000000000000000000000000000000000000000000000000035a26318111d983e5d3044c8a9ff7550b9d4de90a1bd5769d877faf530aabb6b7bf9358",
"gas": "176168",
"isError": null,
"index": 0,
"gasUsed": "0",
"contractAddress": "",
"timeStamp": "1675224440"
},
{
"blockNumber": "56239666",
"callType": "call",
"from": "0xb9a3a97f6a02a86483bf02cb33f8b33d2d117708",
"to": "0x0000000000000000000000000000000000000089",
"transactionHash": "0x1617ee0acd917e6755bd5f73ba85dc212085f9fb53a92615460bdb786f956081",
"value": "0",
"input": "e341eaa400000000000000000000000000000000000000000000000000000000035a26318111d983e5d3044c8a9ff7550b9d4de90a1bd5769d877faf530aabb6b7bf9358",
"gas": "176168",
"isError": null,
"index": 0,
"gasUsed": "0",
"contractAddress": "",
"timeStamp": "1675224440"
},
{
"blockNumber": "56239666",
"callType": "call",
"from": "0x8f2fb5da850042b7da5097061f098493f8ec6dd8",
"to": "0x0000000000000000000000000000000000000089",
"transactionHash": "0x2008c4ec35af9e60fb64c8372da2af22ba879bc677aaef6254f0530899ae741d",
"value": "0",
"input": "e341eaa400000000000000000000000000000000000000000000000000000000035a26318111d983e5d3044c8a9ff7550b9d4de90a1bd5769d877faf530aabb6b7bf9358",
"gas": "176168",
"isError": null,
"index": 0,
"gasUsed": "0",
"contractAddress": "",
"timeStamp": "1675224440"
},
]
}
```

{% endtab %}
{% endtabs %}

## Get a list of 'ERC20 - Token Transfer Events' by Address

Returns the list of ERC-20 tokens transferred by an address, with optional filtering by token contract.

<pre><code>https://api.xdcscan.io/api
   ?module=account
   &#x26;action=tokentx
   &#x26;contractaddress=0x5d5f074837f5d4618b3916ba74de1bf9662a3fed
<strong>   &#x26;address=xdc3e30bedf687ec4de150556575ad3d548e49055c6
</strong>   &#x26;page=1
   &#x26;offset=100
   &#x26;startblock=94600096
   &#x26;endblock=94600096
</code></pre>

Usage:

* ERC-20 transfers from an **address**, specify the `address` parameter
* ERC-20 transfers from a **contract address**, specify the `contract address` parameter
* ERC-20 transfers from an **address** filtered by a **token contract**, specify both `address` and `contract address` parameters.

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=account\&action=tokentx\&contractaddress=0x5d5f074837f5d4618b3916ba74de1bf9662a3fed\&address=xdc3e30bedf687ec4de150556575ad3d548e49055c6\&page=1\&offset=100\&startblock=94600096\&endblock=94600096) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter       | Description                                                                             |
| --------------- | --------------------------------------------------------------------------------------- |
| address         | the `string` representing the address to check for balance                              |
| contractaddress | the `string` representing the token contract address to check for balance               |
| page            | the `integer` page number, if pagination is enabled                                     |
| offset          | the number of transactions displayed per page                                           |
| startblock      | the `integer` block number to start searching for transactions                          |
| endblock        | the `integer` block number to stop searching for transactions                           |
| sort            | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %}    |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"result": [
{
"hash": "0xe951e8f013f937441fd512812b1e2332d232fa23ec047cc4758133ff50d01763",
"contractAddress": "0x5d5f074837f5d4618b3916ba74de1bf9662a3fed",
"blockNumber": "95896372",
"confirmations": "135236",
"blockHash": "0xb436754451dca5e68d7543b5e60517ae25a88bd8211986258419c97ef5aeaed8",
"input": "a212c5aa0000000000000000000000003e30bedf687ec4de150556575ad3d548e49055c6",
"timeStamp": "2025-11-11T06:15:55.000Z",
"gas": "81803",
"gasUsed": "81803",
"gasPrice": "12500000000",
"logIndex": 1,
"nonce": "115632",
"value": "0",
"cumulativeGasUsed": "113648",
"transactionIndex": 1,
"from": "0xe34382d3ecdee6e4087c1d76a98a4eed31f63248",
"to": "0x02fe7b136f5dbff8d00546cb5af45afd1e1d350c",
"tokenName": "STORX",
"tokenSymbol": "SRX",
"tokenDecimal": "18"
},
{
"hash": "0x84048d8bb853c3cb38f5a94707c33f7a116dc3a085bd8a41898a81c6ba87af47",
"contractAddress": "0x5d5f074837f5d4618b3916ba74de1bf9662a3fed",
"blockNumber": "94600131",
"confirmations": "1431477",
"blockHash": "0xdb1a639e3725d19ee3576f783862dd953d53d32f4b87c7263b1710b8eeeda171",
"input": "a9059cbb000000000000000000000000dadf533e664dd18e6057875074e14a09962d9eef0000000000000000000000000000000000000000000033f670f6709a6754d9b4",
"timeStamp": "2025-10-09T14:05:17.000Z",
"gas": "200000",
"gasUsed": "43915",
"gasPrice": "12500000000",
"logIndex": 1,
"nonce": "124",
"value": "0",
"cumulativeGasUsed": "87340",
"transactionIndex": 1,
"from": "0x3e30bedf687ec4de150556575ad3d548e49055c6",
"to": "0x5d5f074837f5d4618b3916ba74de1bf9662a3fed",
"tokenName": "STORX",
"tokenSymbol": "SRX",
"tokenDecimal": "18"
},
]
}
```

{% endtab %}
{% endtabs %}

## Get a list of 'ERC721 - Token Transfer Events' by Address

Returns the list of ERC-721 ( NFT ) tokens transferred by an address, with optional filtering by token contract.

```
https://api.xdcscan.io/api
   ?module=account
   &action=tokennfttx
   &contractaddress=0x1542b0c97eb74e68114dfe7604d6bd838e521c19
   &address=xdc05362284ec790765f678bf5a4747166137f8f6ea
   &page=1
   &offset=100
   &startblock=92577829
   &endblock=92577829
   &sort=asc
```

Usage:

* ERC-721 transfers from an **address**, specify the `address` parameter
* ERC-721 transfers from a **contract address**, specify the `contract address` parameter
* ERC-721 transfers from an **address** filtered by a **token contract**, specify both `address` and `contract address` parameters.

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=account\&action=tokennfttx\&contractaddress=0x1542b0c97eb74e68114dfe7604d6bd838e521c19\&address=xdc05362284ec790765f678bf5a4747166137f8f6ea\&page=1\&offset=100\&startblock=92577829\&endblock=92577829) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter       | Description                                                                             |
| --------------- | --------------------------------------------------------------------------------------- |
| address         | the `string` representing the address to check for balance                              |
| contractaddress | the `string` representing the token contract address to check for balance               |
| page            | the `integer` page number, if pagination is enabled                                     |
| offset          | the number of transactions displayed per page                                           |
| startblock      | the `integer` block number to start searching for transactions                          |
| endblock        | the `integer` block number to stop searching for transactions                           |
| sort            | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %}    |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"result": [
{
"hash": "0xec69a1b1eb6a55f442a74d2a1ab2d9d065c27b13ccd253e90ccd070fd11fbd0f",
"contractAddress": "0x2385bd067826f0ac6ad4727cd07d22b84e7af7e8",
"blockNumber": "77281167",
"confirmations": "488283",
"blockHash": "0x32920fa577f998148427144343061655acd879871906c5e75f47e37fe602c76f",
"input": "027a22550000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005168747470733a2f2f7864636e66742e696e667572612d697066732e696f2f697066732f516d583933676748637638765a415742717258774e4a5861505742684432657a6e70524c73573653516d63746f65000000000000000000000000000000",
"timeStamp": "2024-07-16T19:12:19.000Z",
"gas": "294549",
"gasUsed": "294549",
"gasPrice": "250000000",
"logIndex": 4,
"nonce": "23",
"value": "0",
"cumulativeGasUsed": "708287",
"transactionIndex": 4,
"from": "0x510c8974ae266b5a299579c827faf1f4b24776f0",
"to": "0x2385bd067826f0ac6ad4727cd07d22b84e7af7e8",
"tokenName": "XDCNFT",
"tokenSymbol": "XNFT",
"tokenDecimal": null
}
]
}
```

{% endtab %}
{% endtabs %}

## Get a list of 'ERC1155 - Token Transfer Events' by Address

Returns the list of ERC-1155 ( Multi Token Standard ) tokens transferred by an address, with optional filtering by token contract.

```
https://api.xdcscan.io/api
?module=account
&action=token1155tx
&contractaddress=0x3e50c80f8a6a173a8059830d0cf0c9e5b04c43c0
&address=xdcd64c17cde828456d91b14e820d819f63e24b0160
&page=1
&offset=100
&startblock=0
&endblock=99999999
&sort=asc
```

Usage:

* ERC-1155 transfers from an **address**, specify the `address` parameter
* ERC-1155 transfers from a **contract address**, specify the `contract address` parameter
* ERC-1155 transfers from an **address** filtered by a **token contract**, specify both `address` and `contract address` parameters.

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=account\&action=token1155tx\&contractaddress=0x3e50c80f8a6a173a8059830d0cf0c9e5b04c43c0\&address=xdcd64c17cde828456d91b14e820d819f63e24b0160\&page=1\&offset=100\&startblock=0\&endblock=99999999\&sort=asc) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter       | Description                                                                             |
| --------------- | --------------------------------------------------------------------------------------- |
| address         | the `string` representing the address to check for balance                              |
| contractaddress | the `string` representing the token contract address to check for balance               |
| page            | the `integer` page number, if pagination is enabled                                     |
| offset          | the number of transactions displayed per page                                           |
| startblock      | the `integer` block number to start searching for transactions                          |
| endblock        | the `integer` block number to stop searching for transactions                           |
| sort            | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %}    |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"result": [
{
"hash": "0xd1f0764155512dae2e520c2c61a81b762932b78a1885c9cb6019141621aa3885",
"contractAddress": "0x3e50c80f8a6a173a8059830d0cf0c9e5b04c43c0",
"blockNumber": "63870890",
"confirmations": "13898560",
"blockHash": "0xf9cc85f0518c342e116744e403c5e1caf2cdec4c250ee449c422109c836aee6a",
"input": "6d4de477000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000512068747470733a2f2f78647365612e696e667572612d697066732e696f2f697066732f516d4e7178374b6737453668626e546b3669413661623771397638767554345a6b627954394c644b6a53456464430000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000001900000000000000000000000000000000000000000000000000000000000004830000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000003635c9adc5dea00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006f465794a4f526c524f5957316c496a6f694d6a41794d794243556c6c445253425a5431564f527942535430394c535555675255524a56456c5054694973496b3547564646315957353061585235496a6f694d6a55694c434a4f526c5250636d6470626d4673535731685a3255694f694a6f64485277637a6f764c33686b633256684c584279623251746257566b615745745932397564474670626d56794c6e4d7a4c6d467459587076626d46336379356a62323076626d5a304c7a42345a445930597a45335932526c4f4449344e4455325a446b78596a45305a5467794d4751344d546c6d4e6a4e6c4d6a52694d4445324d433950636d6c6e615735686243394f526c51764d5459354d544d304d7a67784f5455794d6935335a574a7749697769546b5a5554334a6e6157356862456c745957646c55484a6c646d6c6c64794936626e567362437769546b5a55564768316258424a6257466e5a53493649694973496b35475646526f64573177535731685a325651636d563261575633496a6f6949697769546b5a5554334a6e6157356862456c745957646c5358426d63794936496d68306448427a4f6938766547527a5a5745756157356d64584a684c576c775a6e4d75615738766158426d637939526256424d4f45314562565a4b55446c704d56566a4f45746e4e48683462556f78574656485a544d33576e42554d6b746e51584a6a59304e6d566c704b49697769546b5a55564768316258424a6257466e5a556c775a6e4d694f6949694c434a4462323177636d567a6332566b526d6c735a534936496d68306448427a4f6938766547527a5a57457463484a765a4331745a5752705953316a6232353059576c755a584975637a4d7559573168656d39755958647a4c6d4e76625339755a6e51764d48686b4e6a526a4d54646a5a4755344d6a67304e545a6b4f5446694d54526c4f4449775a4467784f5759324d3255794e4749774d5459774c304e76625842795a584e7a5a575176546b5a554c7a45324f54457a4e444d344d546b314d6a49756432566963434973496b4e76625842795a584e7a5a57525561485674596b5a70624755694f6949694c434a4f526c52455a584e6a636d6c7764476c766269493649694d784945354754434245556b46475643425153554e4c584735525169394451564a5054456c4f515342515155355553455653553178755130394d5445564852546f6751557842516b464e515341694c434a5164585250626c4e68624756556558426c496a6f69526d6c345a575251636d6c6a5a534973496c423164453975553246735a53493664484a315a537769546b5a5555484a70593255694f6949784d44417749697769546b5a5554576c756157313162554a705a4349364d43776951327876593274556157316c496a6f69496977695257356b51327876593274556157316c496a6f6949697769546b5a55556d39355957783065534936496a55694c434a4f526c5251636d39775a584a306157567a496a6f6949697769546b5a5551334a6c5958527663694936496a42345a445930597a45335932526c4f4449344e4455325a446b78596a45305a5467794d4751344d546c6d4e6a4e6c4d6a52694d4445324d434973496b354756453933626d5679496a6f694d48686b4e6a526a4d54646a5a4755344d6a67304e545a6b4f5446694d54526c4f4449775a4467784f5759324d3255794e4749774d545977496977695347467a61465a686248566c496a6f694969776954575630526d6c735a534936496a49774d6a4e69636e6c6a5a586c766457356e636d397661326c6c5a57527064476c7662693530654851694c434a4e5a5852685247463059534936496d68306448427a4f6938766547527a5a5745756157356d64584a684c576c775a6e4d75615738766158426d63793952625535786544644c5a7a64464e6d6869626c52724e6d6c424e6d46694e334535646a683264565130576d7469655651355447524c616c4e465a475244496977695132397564484a68593352425a4752795a584e7a496a6f694d48677a5a545577597a67775a6a68684e6d45784e7a4e684f4441314f54677a4d47517759325977597a6c6c4e5749774e474d304d324d77496977695132397564484a68593352556558426c496a6f784d5455314c434a445958526c5a32397965534936496b4e766247786c59335270596d786c63794973496b4e766157354f5957316c496a6f695631684551794973496c56756247396a61304e76626e526c626e51694f6949694c434a44623278735a574e3061573975546d46745a534936496c4e7762334a306379425952454d6749697769513239736247566a64476c76626b356c64486476636d73694f694a5952454d694c434a44623278735a574e306157397555336c74596d3973496a6f694969776959574e3061585a7064486b694f694a4e61573530496e303d000000000000000000000000",
"timeStamp": "2023-08-06T17:43:59.000Z",
"gas": "448641",
"gasUsed": "444074",
"gasPrice": "250000000",
"logIndex": 1,
"nonce": "44",
"value": "0",
"cumulativeGasUsed": "444074",
"transactionIndex": 1,
"from": "0xd64c17cde828456d91b14e820d819f63e24b0160",
"to": "0xcdce3724fba95c29fca1c03f22e0fc77da3c15c1",
"tokenName": "XDSea",
"tokenSymbol": "XDSea",
"tokenDecimal": null
},
{
"hash": "0xe0c0edf7eb50f20627126503953d8bcbf0da7580b149442f57cbecde96269de6",
"contractAddress": "0x3e50c80f8a6a173a8059830d0cf0c9e5b04c43c0",
"blockNumber": "63871471",
"confirmations": "13897979",
"blockHash": "0xd1d3aad1d77dfbc87101124fdf56ce5185219fc040183778cd35e8a3ad48945a",
"input": "6d4de477000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000512068747470733a2f2f78647365612e696e667572612d697066732e696f2f697066732f516d627a48574d43517974513266714b4239455870726446527778325a5947674a4c7a637079387a4450447837450000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000001900000000000000000000000000000000000000000000000000000000000004830000000000000000000000000000000000000000000000001bc16d674ec8000000000000000000000000000000000000000000000000003635c9adc5dea00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006e865794a4f526c524f5957316c496a6f69536b465a5445564f494664425245524d525342535430394c535555675255524a56456c5054694973496b3547564646315957353061585235496a6f694d6a55694c434a4f526c5250636d6470626d4673535731685a3255694f694a6f64485277637a6f764c33686b633256684c584279623251746257566b615745745932397564474670626d56794c6e4d7a4c6d467459587076626d46336379356a62323076626d5a304c7a42345a445930597a45335932526c4f4449344e4455325a446b78596a45305a5467794d4751344d546c6d4e6a4e6c4d6a52694d4445324d433950636d6c6e615735686243394f526c51764d5459354d544d304e5451324d7a55794f5335335a574a7749697769546b5a5554334a6e6157356862456c745957646c55484a6c646d6c6c64794936626e567362437769546b5a55564768316258424a6257466e5a53493649694973496b35475646526f64573177535731685a325651636d563261575633496a6f6949697769546b5a5554334a6e6157356862456c745957646c5358426d63794936496d68306448427a4f6938766547527a5a5745756157356d64584a684c576c775a6e4d75615738766158426d6379395262564e56526a4a485a46646d5154465a4e6e5649626d646e536c707759335272556d5a475447396d574774325a475a7a5456597a61466b32626b704849697769546b5a55564768316258424a6257466e5a556c775a6e4d694f6949694c434a4462323177636d567a6332566b526d6c735a534936496d68306448427a4f6938766547527a5a57457463484a765a4331745a5752705953316a6232353059576c755a584975637a4d7559573168656d39755958647a4c6d4e76625339755a6e51764d48686b4e6a526a4d54646a5a4755344d6a67304e545a6b4f5446694d54526c4f4449775a4467784f5759324d3255794e4749774d5459774c304e76625842795a584e7a5a575176546b5a554c7a45324f54457a4e4455304e6a4d314d6a6b756432566963434973496b4e76625842795a584e7a5a57525561485674596b5a70624755694f6949694c434a4f526c52455a584e6a636d6c7764476c7662694936496b704257557846546942585155524554455567497a4533584735585569394e5355464e535342455430785153456c4f55794263626b4e5054457846523055364945464d51554a42545545694c434a5164585250626c4e68624756556558426c496a6f69526d6c345a575251636d6c6a5a534973496c423164453975553246735a53493664484a315a537769546b5a5555484a70593255694f6949784d44417749697769546b5a5554576c756157313162554a705a4349364d43776951327876593274556157316c496a6f69496977695257356b51327876593274556157316c496a6f6949697769546b5a55556d39355957783065534936496a49694c434a4f526c5251636d39775a584a306157567a496a6f6949697769546b5a5551334a6c5958527663694936496a42345a445930597a45335932526c4f4449344e4455325a446b78596a45305a5467794d4751344d546c6d4e6a4e6c4d6a52694d4445324d434973496b354756453933626d5679496a6f694d48686b4e6a526a4d54646a5a4755344d6a67304e545a6b4f5446694d54526c4f4449775a4467784f5759324d3255794e4749774d545977496977695347467a61465a686248566c496a6f694969776954575630526d6c735a534936496d70686557786c626e64685a4752735a584a76623274705a57566b615852706232347564486830496977695457563059555268644745694f694a6f64485277637a6f764c33686b633256684c6d6c755a6e56795953317063475a7a4c6d6c764c326c775a6e4d7655573169656b685854554e52655852524d6d5a785330493552566877636d5247556e64344d6c705a5232644b5448706a63486b34656b52515248673352534973496b4e76626e527959574e305157526b636d567a63794936496a42344d3255314d474d344d47593459545a684d54637a595467774e546b344d7a426b4d474e6d4d474d355a5456694d44526a4e444e6a4d434973496b4e76626e527959574e3056486c775a5349364d5445314e537769513246305a576476636e6b694f694a44623278735a574e3061574a735a584d694c434a4462326c75546d46745a534936496c645952454d694c434a56626d787659327444623235305a573530496a6f6949697769513239736247566a64476c76626b3568625755694f694a546347397964484d675745524449434973496b4e766247786c593352706232354f5a58523362334a72496a6f695745524449697769513239736247566a64476c76626c4e3562574a766243493649694973496d466a64476c3261585235496a6f6954576c7564434a39000000000000000000000000000000000000000000000000",
"timeStamp": "2023-08-06T18:11:19.000Z",
"gas": "428368",
"gasUsed": "424106",
"gasPrice": "250000000",
"logIndex": 1,
"nonce": "46",
"value": "0",
"cumulativeGasUsed": "424106",
"transactionIndex": 1,
"from": "0xd64c17cde828456d91b14e820d819f63e24b0160",
"to": "0xcdce3724fba95c29fca1c03f22e0fc77da3c15c1",
"tokenName": "XDSea",
"tokenSymbol": "XDSea",
"tokenDecimal": null
},
   ]
}
```

{% endtab %}
{% endtabs %}

## Get list of Blocks Validated by Address

Returns the list of blocks Validated by an address.

```
https://api.xdcscan.io/api
   ?module=account
   &action=getminedblocks
   &address=0x3bddd35ddf0945c0151a4ccd547d9e7a0b1fa4cd
   &blocktype=blocks
   &page=1
   &offset=10
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=account\&action=getminedblocks\&address=0x3bddd35ddf0945c0151a4ccd547d9e7a0b1fa4cd\&blocktype=blocks\&page=1\&offset=10) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                                                 |
| ------------ | ----------------------------------------------------------------------------------------------------------- |
| address      | the `string` representing the address to check for balance                                                  |
| blocktype    | the `string` pre-defined block type, either `blocks` for canonical blocks or `uncles` for uncle blocks only |
| page         | the `integer` page number, if pagination is enabled                                                         |
| offset       | the number of transactions displayed per page                                                               |
| {% endtab %} |                                                                                                             |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"result": [
{
"blockNumber": "96035947",
"timeStamp": "2025-11-14T16:12:29.000Z"
},
{
"blockNumber": "96035840",
"timeStamp": "2025-11-14T16:08:42.000Z"
},
{
"blockNumber": "96035732",
"timeStamp": "2025-11-14T16:05:06.000Z"
},
{
"blockNumber": "96035624",
"timeStamp": "2025-11-14T16:01:30.000Z"
},
{
"blockNumber": "96035482",
"timeStamp": "2025-11-14T15:56:29.000Z"
},
{
"blockNumber": "96035375",
"timeStamp": "2025-11-14T15:52:47.000Z"
},
{
"blockNumber": "96035270",
"timeStamp": "2025-11-14T15:48:46.000Z"
},
{
"blockNumber": "96035163",
"timeStamp": "2025-11-14T15:45:04.000Z"
},
{
"blockNumber": "96035057",
"timeStamp": "2025-11-14T15:41:16.000Z"
},
{
"blockNumber": "96034951",
"timeStamp": "2025-11-14T15:37:28.000Z"
}
]
}
```

{% hint style="warning" %}
:hourglass\_flowing\_sand: **Note :** The `timeStamp` is represented in [**Unix timestamp.** ](https://www.unixtimestamp.com/)\*\*\*\*
{% endhint %}
{% endtab %}
{% endtabs %}

## Get Historical XDC Balance for a Single Address By BlockNumber

Returns the balance of an address at a certain block height.

{% hint style="warning" %}
:pencil: **Note :** This endpoint is throttled to **2 calls/second** regardless of API Pro tier.
{% endhint %}

```
https://api.xdcscan.io/api
   ?module=account
   &action=balancehistory
   &address=xdcd77875dF9C9dE07a5a701F4431743e3A0e9Fe03a
   &blockno=50916245
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=account\&action=balancehistory\&address=xdcd77875dF9C9dE07a5a701F4431743e3A0e9Fe03a\&blockno=50916245) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                                                |
| ------------ | ---------------------------------------------------------------------------------------------------------- |
| address      | the `string` representing the address to check for balance                                                 |
| blockno      | the `integer` block number to check balance for eg. [`63025284`](https://xdc.blocksscan.io/block/63025284) |
| {% endtab %} |                                                                                                            |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"result": "14700000799.9987295"
}
```

{% endtab %}
{% endtabs %}


# Contracts

## Get Contract ABI for [Verified Contract Source Codes](https://xdc.blocksscan.io/contracts)

Returns the Contract Application Binary Interface ( ABI ) of a verified smart contract.

{% hint style="info" %}
Find verified contracts :white\_check\_mark:on our [**Verified Contracts Source Code**](https://xdc.blocksscan.io/contracts) page.
{% endhint %}

```
https://api.xdcscan.io/api
   ?module=contract
   &action=getabi
   &address=0xff7412ea7c8445c46a8254dfb557ac1e48094391
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=contract\&action=getabi\&address=0xff7412ea7c8445c46a8254dfb557ac1e48094391\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                            |
| ------------ | ------------------------------------------------------ |
| address      | the `contract address` that has a verified source code |
| {% endtab %} |                                                        |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"result": "[{"constant":false,"inputs":[{"name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newImplementation","type":"address"},{"name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"implementation","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newAdmin","type":"address"}],"name":"changeAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"admin","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_implementation","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"previousAdmin","type":"address"},{"indexed":false,"name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"implementation","type":"address"}],"name":"Upgraded","type":"event"}]",
"status": "1"
}
```

{% endtab %}
{% endtabs %}

## Get Contract Source Code for [Verified Contract Source Codes](https://xdc.blocksscan.io/contracts)

Returns the Solidity source code of a verified smart contract.

```
https://api.xdcscan.io/api
   ?module=contract
   &action=getsourcecode
   &address=0x5d5f074837f5d4618b3916ba74de1bf9662a3fed
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=contract\&action=getsourcecode\&address=0x5d5f074837f5d4618b3916ba74de1bf9662a3fed\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                            |
| ------------ | ------------------------------------------------------ |
| address      | the `contract address` that has a verified source code |
| {% endtab %} |                                                        |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"result": [
{
"ConstructorArguments": "0x000000000000000000000000dc34e983e8558651ebb1fd3d2f2cf303bf8fd00a",
"ImplementationAddress": "0xdc34e983e8558651ebb1fd3d2f2cf303bf8fd00a",
"ImplementationAddresses": [
"0xdc34e983e8558651ebb1fd3d2f2cf303bf8fd00a"
],
"IsProxy": "true",
"SourceCode": "/** *Submitted for verification at Etherscan.io on 2018-08-03 */ pragma solidity ^0.4.24; // File: zos-lib/contracts/upgradeability/Proxy.sol /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ function () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas, implementation, 0, calldatasize, 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize) } default { return(0, returndatasize) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } // File: openzeppelin-solidity/contracts/AddressUtils.sol /** * Utility library of inline functions on addresses */ library AddressUtils { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param addr address to check * @return whether the target address is a contract */ function isContract(address addr) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. // solium-disable-next-line security/no-inline-assembly assembly { size := extcodesize(addr) } return size > 0; } } // File: zos-lib/contracts/upgradeability/UpgradeabilityProxy.sol /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "org.zeppelinos.proxy.implementation", and is * validated in the constructor. */ bytes32 private constant IMPLEMENTATION_SLOT = 0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3; /** * @dev Contract constructor. * @param _implementation Address of the initial implementation. */ constructor(address _implementation) public { assert(IMPLEMENTATION_SLOT == keccak256("org.zeppelinos.proxy.implementation")); _setImplementation(_implementation); } /** * @dev Returns the current implementation. * @return Address of the current implementation */ function _implementation() internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) private { require(AddressUtils.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } // File: zos-lib/contracts/upgradeability/AdminUpgradeabilityProxy.sol /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "org.zeppelinos.proxy.admin", and is * validated in the constructor. */ bytes32 private constant ADMIN_SLOT = 0x10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * Contract constructor. * It sets the `msg.sender` as the proxy administrator. * @param _implementation address of the initial implementation. */ constructor(address _implementation) UpgradeabilityProxy(_implementation) public { assert(ADMIN_SLOT == keccak256("org.zeppelinos.proxy.admin")); _setAdmin(msg.sender); } /** * @return The address of the proxy admin. */ function admin() external view ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external view ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be * called, as described in * https://solidity.readthedocs.io/en/develop/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes data) payable external ifAdmin { _upgradeTo(newImplementation); require(address(this).call.value(msg.value)(data)); } /** * @return The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } } // File: contracts/FiatTokenProxy.sol /** * Copyright CENTRE SECZ 2018 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is furnished to * do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * @title FiatTokenProxy * @dev This contract proxies FiatToken calls and enables FiatToken upgrades */ contract FiatTokenProxy is AdminUpgradeabilityProxy { constructor(address _implementation) public AdminUpgradeabilityProxy(_implementation) { } } ",
"ABI": "[{"constant":false,"inputs":[{"name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newImplementation","type":"address"},{"name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"implementation","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newAdmin","type":"address"}],"name":"changeAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"admin","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_implementation","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"previousAdmin","type":"address"},{"indexed":false,"name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"implementation","type":"address"}],"name":"Upgraded","type":"event"}]",
"ContractName": "FiatTokenProxy",
"CompilerVersion": "v0.4.24+commit.e67f0147",
"OptimizationUsed": "false",
"EVMVersion": "default",
"FileName": "",
"Address": "0x5d5f074837f5d4618b3916ba74de1bf9662a3fed"
}
],
"status": "1"
}
```

{% endtab %}
{% endtabs %}

## Get Contract Creator and Creation Tx Hash

Returns a contract's deployer address and transaction hash it was created, up to 5 at a time.

```
https://api.xdcscan.io/api
   ?module=contract
   &action=getcontractcreation
&contractaddresses=xdcc5e79ea2490822af066959bf71873cc26a60dbad,xdcd80011c69f2a8d4e2f4826abb6367bf159b41a59,xdc051665f2455116e929b9972c36d23070f5054ce0,xdc2a9f896660e802c59a3178b2e8cb7fbaccc04e86,xdc8210c0634ab8f273806e4b7866e9db353773c44b&apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=contract\&action=getcontractcreation\&contractaddresses=xdcc5e79ea2490822af066959bf71873cc26a60dbad,xdcd80011c69f2a8d4e2f4826abb6367bf159b41a59,xdc051665f2455116e929b9972c36d23070f5054ce0,xdc2a9f896660e802c59a3178b2e8cb7fbaccc04e86,xdc8210c0634ab8f273806e4b7866e9db353773c44b\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter         | Description                                |
| ----------------- | ------------------------------------------ |
| contractaddresses | the `contract address` , up to 5 at a time |
| {% endtab %}      |                                            |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"result": [
{
"contractAddress": "0xc5e79ea2490822af066959bf71873cc26a60dbad",
"contractCreator": "0xc4a814f82d1852025a67f6a126fcc19577d397ab",
"txHash": "0xbef25093305f36e60ab9398ae630e91be5a1658c7a521cbba29efc28f43ac6b2"
},
{
"contractAddress": "0xd80011c69f2a8d4e2f4826abb6367bf159b41a59",
"contractCreator": "0xd8ad8ebd97197c816834dddccf3d9ffdf186705e",
"txHash": "0xaa26fe1dd055755a154165425af45021c72cc587c4b7d5e3f22d334ce538d5bd"
},
{
"contractAddress": "0x051665f2455116e929b9972c36d23070f5054ce0",
"contractCreator": "0x062f05cd6c835677b05a8658a351969476861316",
"txHash": "0x7936ece6a6907a23a76a97761a807e60fc5f3e19770339729541dc8f1a088bc2"
},
{
"contractAddress": "0x2a9f896660e802c59a3178b2e8cb7fbaccc04e86",
"contractCreator": "0x062f05cd6c835677b05a8658a351969476861316",
"txHash": "0x224b2c9f51b7fc13f1dd8f5d510d1b4950edf237e4bc4d4da5901972360034b5"
},
{
"contractAddress": "0x8210c0634ab8f273806e4b7866e9db353773c44b",
"contractCreator": "0x50fad3de9f0c113312065cb50c267fceb59a76cb",
"txHash": "0x4b0a4c6d0a40dce77ce4a56e8ddced5615b4eefb3f719cbddfb06b0e5087427f"
}
],
"status": "1"
}
```

{% endtab %}
{% endtabs %}


# Transactions

## Check Contract Execution Status

Returns the status code of a contract execution.

```
https://api.xdcscan.io/api
   ?module=transaction
   &action=getstatus
   &txhash=0x3ac8a2f2db1c13edb2a2e9040f2378f0edc74bc59495365a637fe85ddc88c5fc
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=transaction\&action=getstatus\&txhash=0x3ac8a2f2db1c13edb2a2e9040f2378f0edc74bc59495365a637fe85ddc88c5fc) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                  |
| ------------ | ---------------------------------------------------------------------------- |
| txhash       | the `string` representing the transaction hash to check the execution status |
| {% endtab %} |                                                                              |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":{
      "isError":"1",
      "errDescription":"Transaction fail"
   }
}
```

{% hint style="info" %}
:book: **Tip:** The `isError` field returns `0` for **Successful transactions** and `1` for **Failed transactions.**
{% endhint %}
{% endtab %}
{% endtabs %}

## Check Transaction Receipt Status

Returns the status code of a transaction execution.

```
https://api.xdcscan.io/api
   ?module=transaction
   &action=gettxreceiptstatus
   &txhash=0x8a317d8a24629994da2bf25de2896fb55aec4de837425cb5bcf6ba697e06af89
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=transaction\&action=gettxreceiptstatus\&txhash=0x8a317d8a24629994da2bf25de2896fb55aec4de837425cb5bcf6ba697e06af89\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                  |
| ------------ | ---------------------------------------------------------------------------- |
| txhash       | the `string` representing the transaction hash to check the execution status |
| {% endtab %} |                                                                              |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":{
      "status":"1"
   }
}
```

{% endtab %}
{% endtabs %}


# Blocks (WIP)

## Get Block And Uncle Rewards by BlockNo (WIP)

Returns the block reward and 'Uncle' block rewards.

```
https://api.xdcscan.io/api
   ?module=block
   &action=getblockreward
   &blockno=2165403
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=block\&action=getblockreward\&blockno=2165403) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                                                      |
| ------------ | ---------------------------------------------------------------------------------------------------------------- |
| blockno      | the `integer` block number to check block rewards for eg. [`76986383`](https://xdc.blocksscan.io/block/76986383) |
| {% endtab %} |                                                                                                                  |

{% tab title="Response" %}
Sample Response

```
{
  "status": 0,
  "message": "OK",
  "result": {
    "blockReward": 0.3375,
    "blockNumber": 2165403,
    "timeStamp": 1563977473,
    "blockMiner": "xdc0000000000000000000000000000000000000000"
  }
}
```

{% hint style="info" %}
​​ :hourglass\_flowing\_sand: **Tip :** The `timestamp` field is denoted in [**Unix timestamp.**](https://www.unixtimestamp.com/)
{% endhint %}
{% endtab %}
{% endtabs %}

## Get Estimated Block Countdown Time by BlockNo (WIP)

Returns the estimated time remaining, in seconds, until a certain block is mined.

```
https://api.xdcscan.io/api
   ?module=block
   &action=getblockcountdown
   &blockno=16701588
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=block\&action=getblockcountdown\&blockno=16701588\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                                                               |
| ------------ | ------------------------------------------------------------------------------------------------------------------------- |
| blockno      | the `integer` block number to estimate time remaining to be mined eg. [`76986383`](https://api.xdcscan.io/block/76986383) |
| {% endtab %} |                                                                                                                           |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":{
      "CurrentBlock":"12715477",
      "CountdownBlock":"16701588",
      "RemainingBlock":"3986111",
      "EstimateTimeInSec":"52616680.2"
   }
}
```

{% endtab %}
{% endtabs %}

## Get Block Number by Timestamp (WIP)

Returns the block number that was mined at a certain timestamp.

```
https://api.xdcscan.io/api
   ?module=block
   &action=getblocknobytime
   &timestamp=1720632212
   &closest=before
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=block\&action=getblocknobytime\&timestamp=1720632212\&closest=before\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                       |
| ------------ | --------------------------------------------------------------------------------- |
| timestamp    | the `integer` representing the Unix timestamp in **seconds**.                     |
| closest      | the closest available block to the provided timestamp, either `before` or `after` |
| {% endtab %} |                                                                                   |

{% tab title="Response" %}
Sample Response

```
{
"message": "Invalid `timestamp` param",
"result": null,
"status": "0"
}
```

{% hint style="info" %}
:hourglass\_flowing\_sand: **Tip :** Convert a regular date-time to a [**Unix timestamp.**](https://www.unixtimestamp.com/)
{% endhint %}
{% endtab %}
{% endtabs %}

## Get Daily Average Block Size ***(Coming Soon)***<img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the daily average block size within a date range.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=dailyavgblocksize
   &startdate=2019-02-01
   &enddate=2019-02-28
   &sort=asc
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=dailyavgblocksize\&startdate=2019-02-01\&enddate=2019-02-28\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startdate    | the starting date in `yyyy-MM-dd` format, eg. `2019-02-01`                              |
| enddate      | the ending date in `yyyy-MM-dd` format, eg. `2019-02-28`                                |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "blockSize_bytes":20373
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "blockSize_bytes":25117
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Get Daily Block Count and Rewards ***(Coming Soon)***<img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the number of blocks mined daily and the amount of block rewards.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=dailyblkcount
   &startdate=2019-02-01
   &enddate=2019-02-28
   &sort=asc
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=dailyblkcount\&startdate=2019-02-01\&enddate=2019-02-28\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startdate    | the starting date in `yyyy-MM-dd` format, eg. `2019-02-01`                              |
| enddate      | the ending date in `yyyy-MM-dd` format, eg. `2019-02-28`                                |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "blockCount":4848,
         "blockRewards_Eth":"14929.464690870590355682"
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "blockCount":4366,
         "blockRewards_Eth":"12808.485512162356907132"
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Get Daily Block Rewards ***(Coming Soon)***<img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the amount of block rewards distributed to miners daily.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=dailyblockrewards
   &startdate=2019-02-01
   &enddate=2019-02-28
   &sort=asc
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=dailyblockrewards\&startdate=2019-02-01\&enddate=2019-02-28\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startdate    | the starting date in `yyyy-MM-dd` format, eg. `2019-02-01`                              |
| enddate      | the ending date in `yyyy-MM-dd` format, eg. `2019-02-28`                                |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "blockRewards_Eth":"15300.65625"
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "blockRewards_Eth":"12954.84375"
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Get Daily Average Time for A Block to be Included in the XDC Blockchain ***(Coming Soon)***<img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the daily average of time needed for a block to be successfully mined.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=dailyavgblocktime
   &startdate=2019-02-01
   &enddate=2019-02-28
   &sort=asc
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=dailyavgblocktime\&startdate=2019-02-01\&enddate=2019-02-28\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startdate    | the starting date in `yyyy-MM-dd` format, eg. `2019-02-01`                              |
| enddate      | the ending date in `yyyy-MM-dd` format, eg. `2019-02-28`                                |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "blockTime_sec":"17.67"
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "blockTime_sec":"19.61"
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Get Daily Uncle Block Count and Rewards ***(Coming Soon)***<img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the number of 'Uncle' blocks mined daily and the amount of 'Uncle' block rewards.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=dailyuncleblkcount
   &startdate=2019-02-01
   &enddate=2019-02-28
   &sort=asc
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=dailyuncleblkcount\&startdate=2019-02-01\&enddate=2019-02-28\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter     | Description                                                                             |
| ------------- | --------------------------------------------------------------------------------------- |
| startdate     | the starting date in `yyyy-MM-dd` format, eg. `2019-02-01`                              |
| enddate       | the ending date in `yyyy-MM-dd` format, eg. `2019-02-28`                                |
| sort          | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %}  |                                                                                         |
| {% endtabs %} |                                                                                         |


# Logs

## Get Event Logs by Address

Returns the event logs from an address, with optional filtering by block range.

```
https://api.xdcscan.io/api
   ?module=logs
   &action=getLogs
   &address=0xbd3531da5cf5857e7cfaa92426877b022e612cf8
   &fromBlock=12878196
   &toBlock=12878196
   &page=1
   &offset=1000
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=logs\&action=getLogs\&address=0xbd3531da5cf5857e7cfaa92426877b022e612cf8\&fromBlock=12878196\&toBlock=12878196\&page=1\&offset=1000\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                                                                                                                |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| address      | the `string` representing the address to check for logs                                                                                                                    |
| fromBlock    | the `integer` block number to start searching for logs eg. `12878196`                                                                                                      |
| toBlock      | the `integer` block number to stop searching for logs eg. `12879196`                                                                                                       |
| page         | the `integer` page number, if pagination is enabled                                                                                                                        |
| offset       | <p>the number of transactions displayed per page<br><br>limited to <strong>1000 records</strong> per query, use the <code>page</code> parameter for subsequent records</p> |
| {% endtab %} |                                                                                                                                                                            |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "address":"0xbd3531da5cf5857e7cfaa92426877b022e612cf8",
         "topics":[
            "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
            "0x0000000000000000000000000000000000000000000000000000000000000000",
            "0x000000000000000000000000c45a4b3b698f21f88687548e7f5a80df8b99d93d",
            "0x00000000000000000000000000000000000000000000000000000000000000b5"
         ],
         "data":"0x",
         "blockNumber":"0xc48174",
         "timeStamp":"0x60f9ce56",
         "gasPrice":"0x2e90edd000",
         "gasUsed":"0x247205",
         "logIndex":"0x",
         "transactionHash":"0x4ffd22d986913d33927a392fe4319bcd2b62f3afe1c15a2c59f77fc2cc4c20a9",
         "transactionIndex":"0x"
      },
      {
         "address":"0xbd3531da5cf5857e7cfaa92426877b022e612cf8",
         "topics":[
            "0x645f26e653c951cec836533f8fe0616d301c20a17153debc17d7c3dbe4f32b28",
            "0x00000000000000000000000000000000000000000000000000000000000000b5"
         ],
         "data":"0x",
         "blockNumber":"0xc48174",
         "timeStamp":"0x60f9ce56",
         "gasPrice":"0x2e90edd000",
         "gasUsed":"0x247205",
         "logIndex":"0x1",
         "transactionHash":"0x4ffd22d986913d33927a392fe4319bcd2b62f3afe1c15a2c59f77fc2cc4c20a9",
         "transactionIndex":"0x"
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Get Event Logs by Topics

Returns the events log in a block range, filtered by topics.

```
https://api.xdcscan.io/api
   ?module=logs
   &action=getLogs
   &fromBlock=12878196
   &toBlock=12879196
   &topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
   &topic0_1_opr=and
   &topic1=0x0000000000000000000000000000000000000000000000000000000000000000
   &page=1
   &offset=1000
   &apikey=YourApiKeyToken
```

Usage:

* For a single topic, specify the topic number such as `topic0`, `topic1`, `topic2`, `topic3`
* For multiple topics, specify the topic numbers **and** topic operator either `and` or `or` such as below\
  \
  topic0\_1\_opr (and|or between topic0 & topic1), topic1\_2\_opr (and|or between topic1 & topic2) topic2\_3\_opr (and|or between topic2 & topic3), topic0\_2\_opr (and|or between topic0 & topic2) topic0\_3\_opr (and|or between topic0 & topic3), topic1\_3\_opr (and|or between topic1 & topic3)

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=logs\&action=getLogs\&fromBlock=12878196\&toBlock=12879196\&topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\&topic0_1_opr=and\&topic1=0x0000000000000000000000000000000000000000000000000000000000000000\&page=1\&offset=1000\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter     | Description                                                                                                                                                                |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| fromBlock     | the `integer` block number to start searching for logs eg. `12878196`                                                                                                      |
| toBlock       | the `integer` block number to stop searching for logs eg. `12879196`                                                                                                       |
| topic         | <p>the topic numbers to search for<br><br>limited to<code>topic0</code>, <code>topic1</code>, <code>topic2</code>, <code>topic3</code></p>                                 |
| topicOperator | <p>the topic operator when multiple topic combinations are used<br><br>limited to <code>and</code> or <code>or</code></p>                                                  |
| page          | the `integer` page number, if pagination is enabled                                                                                                                        |
| offset        | <p>the number of transactions displayed per page<br><br>limited to <strong>1000 records</strong> per query, use the <code>page</code> parameter for subsequent records</p> |
| {% endtab %}  |                                                                                                                                                                            |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "address":"0xbd3531da5cf5857e7cfaa92426877b022e612cf8",
         "topics":[
            "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
            "0x0000000000000000000000000000000000000000000000000000000000000000",
            "0x000000000000000000000000c45a4b3b698f21f88687548e7f5a80df8b99d93d",
            "0x00000000000000000000000000000000000000000000000000000000000000b5"
         ],
         "data":"0x",
         "blockNumber":"0xc48174",
         "timeStamp":"0x60f9ce56",
         "gasPrice":"0x2e90edd000",
         "gasUsed":"0x247205",
         "logIndex":"0x",
         "transactionHash":"0x4ffd22d986913d33927a392fe4319bcd2b62f3afe1c15a2c59f77fc2cc4c20a9",
         "transactionIndex":"0x"
      },
      {
         "address":"0xbd3531da5cf5857e7cfaa92426877b022e612cf8",
         "topics":[
            "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
            "0x0000000000000000000000000000000000000000000000000000000000000000",
            "0x000000000000000000000000c45a4b3b698f21f88687548e7f5a80df8b99d93d",
            "0x00000000000000000000000000000000000000000000000000000000000000b6"
         ],
         "data":"0x",
         "blockNumber":"0xc48174",
         "timeStamp":"0x60f9ce56",
         "gasPrice":"0x2e90edd000",
         "gasUsed":"0x247205",
         "logIndex":"0x2",
         "transactionHash":"0x4ffd22d986913d33927a392fe4319bcd2b62f3afe1c15a2c59f77fc2cc4c20a9",
         "transactionIndex":"0x"
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Get Event Logs by Address filtered by Topics

Returns the event logs from an address, filtered by topics and block range.

```
https://api.xdcscan.io/api
   ?module=logs
   &action=getLogs
   &fromBlock=15073139
   &toBlock=15074139
   &address=0x59728544b08ab483533076417fbbb2fd0b17ce3a
   &topic0=0x27c4f0403323142b599832f26acd21c74a9e5b809f2215726e244a4ac588cd7d
   &topic0_1_opr=and
   &topic1=0x00000000000000000000000023581767a106ae21c074b2276d25e5c3e136a68b
   &page=1
   &offset=1000
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=logs\&action=getLogs\&fromBlock=15073139\&toBlock=15074139\&address=0x59728544b08ab483533076417fbbb2fd0b17ce3a\&topic0=0x27c4f0403323142b599832f26acd21c74a9e5b809f2215726e244a4ac588cd7d\&topic0_1_opr=and\&topic1=0x00000000000000000000000023581767a106ae21c074b2276d25e5c3e136a68b\&page=1\&offset=1000\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter     | Description                                                                                                                                                                |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| fromBlock     | the `integer` block number to start searching for logs eg. `12878196`                                                                                                      |
| toBlock       | the `integer` block number to stop searching for logs eg. `12879196`                                                                                                       |
| address       | the `string` representing the address to check for logs                                                                                                                    |
| topic         | <p>the topic numbers to search for<br><br>limited to<code>topic0</code>, <code>topic1</code>, <code>topic2</code>, <code>topic3</code></p>                                 |
| topicOperator | <p>the topic operator when multiple topic combinations are used<br><br>limited to <code>and</code> or <code>or</code></p>                                                  |
| page          | the `integer` page number, if pagination is enabled                                                                                                                        |
| offset        | <p>the number of transactions displayed per page<br><br>limited to <strong>1000 records</strong> per query, use the <code>page</code> parameter for subsequent records</p> |
| {% endtab %}  |                                                                                                                                                                            |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1"
}
```

{% endtab %}
{% endtabs %}


# Geth/Parity Proxy (WIP)

## **eth\_blockNumber (WIP)**

Returns the number of most recent block

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_blockNumber
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_blockNumber\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
No parameters required.
{% endtab %}

{% tab title="Response" %}
Sample response

```
{
   "jsonrpc":"2.0",
   "id":83,
   "result":"0x1104728"
}
```

{% endtab %}
{% endtabs %}

## **eth\_getBlockTransactionCountByNumber (WIP)**

Returns the number of transactions in a block.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_getBlockTransactionCountByNumber
   &tag=0x10FB78
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_getBlockTransactionCountByNumber\&tag=0x10FB78\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                             |
| ------------ | --------------------------------------- |
| tag          | the block number, in hex eg. `0x10FB78` |
| {% endtab %} |                                         |

{% tab title="Response" %}
Sample response

```
{
   "jsonrpc":"2.0",
   "id":1,
   "result":"0x3"
}
```

{% endtab %}
{% endtabs %}

## **eth\_getTransactionByHash (WIP)**

Returns the information about a transaction requested by transaction hash.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_getTransactionByHash
   &txhash=0xbc78ab8a9e9a0bca7d0321a27b2c03addeae08ba81ea98b03cd3dd237eabed44
   &apikey=YourApiKeyToken
```

> Try this endpoint in your[ **browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_getTransactionByHash\&txhash=0xbc78ab8a9e9a0bca7d0321a27b2c03addeae08ba81ea98b03cd3dd237eabed44\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                           |
| ------------ | ----------------------------------------------------- |
| txhash       | the `string` representing the hash of the transaction |
| {% endtab %} |                                                       |

{% tab title="Response" %}
Sample Response

```
{
   "jsonrpc":"2.0",
   "id":1,
   "result":{
      "blockHash":"0xf850331061196b8f2b67e1f43aaa9e69504c059d3d3fb9547b04f9ed4d141ab7",
      "blockNumber":"0xcf2420",
      "from":"0x00192fb10df37c9fb26829eb2cc623cd1bf599e8",
      "gas":"0x5208",
      "gasPrice":"0x19f017ef49",
      "maxFeePerGas":"0x1f6ea08600",
      "maxPriorityFeePerGas":"0x3b9aca00",
      "hash":"0xbc78ab8a9e9a0bca7d0321a27b2c03addeae08ba81ea98b03cd3dd237eabed44",
      "input":"0x",
      "nonce":"0x33b79d",
      "to":"0xc67f4e626ee4d3f272c2fb31bad60761ab55ed9f",
      "transactionIndex":"0x5b",
      "value":"0x19755d4ce12c00",
      "type":"0x2",
      "accessList":[
         
      ],
      "chainId":"0x1",
      "v":"0x0",
      "r":"0xa681faea68ff81d191169010888bbbe90ec3eb903e31b0572cd34f13dae281b9",
      "s":"0x3f59b0fa5ce6cf38aff2cfeb68e7a503ceda2a72b4442c7e2844d63544383e3"
   }
}
```

{% endtab %}
{% endtabs %}

## **eth\_getTransactionByBlockNumberAndIndex (WIP)**

Returns information about a transaction by block number and transaction index position.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_getTransactionByBlockNumberAndIndex
   &tag=0xC6331D
   &index=0x11A
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_getTransactionByBlockNumberAndIndex\&tag=0xC6331D\&index=0x11A\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                      |
| ------------ | ---------------------------------------------------------------- |
| tag          | the block number, in hex eg. `0x10FB78`                          |
| index        | the position of the uncle's index in the block, in hex eg. `0x0` |
| {% endtab %} |                                                                  |

{% tab title="Response" %}
Sample Response

```
{
   "jsonrpc":"2.0",
   "result":{
      "accessList":[
         
      ],
      "blockHash":"0xdce94191f861842c2786e3594da0c0109707fd78409cab5f38e10eb87d0f301c",
      "blockNumber":"0xa36e44",
      "chainId":"0x3",
      "condition":null,
      "creates":null,
      "from":"0xb910ae1db14a9fbc64ce175bdca6d3a743f690ab",
      "gas":"0x186a0",
      "gasPrice":"0x3b9aca09",
      "hash":"0xf96ff62ba5aaf46cd824b6766f7fa6f6b9595b1dd4ef1d31bcf1f765047c2835",
      "input":"0xd0e30db0",
      "maxFeePerGas":"0x3b9aca12",
      "maxPriorityFeePerGas":"0x3b9aca00",
      "nonce":"0xc6",
      "publicKey":"0x6dbf7068e19de8457c426a758a92ea54827ebd5b8467c3a1a5c4ac19bc7570457738fe496a40ea4e1f59d39d89636a430afdec0bf2a8060c6bf7d612bfe90ad3",
      "r":"0xdecdc48821a06bf116e82b355d520dc5a44d6df98234e5344c16565b0b3dfdba",
      "raw":"0x02f8750381c6843b9aca00843b9aca12830186a094c778417e063141139fce010982780140aa0cd5ab8502540be40084d0e30db0c001a0decdc48821a06bf116e82b355d520dc5a44d6df98234e5344c16565b0b3dfdbaa06b85bb6fd8153e86b50f0011787585e8c709a2a25e7ee3c2579572f07acfd42e",
      "s":"0x6b85bb6fd8153e86b50f0011787585e8c709a2a25e7ee3c2579572f07acfd42e",
      "to":"0xc778417e063141139fce010982780140aa0cd5ab",
      "transactionIndex":"0xd",
      "type":"0x2",
      "v":"0x1",
      "value":"0x2540be400"
   },
   "id":1
}
```

{% endtab %}
{% endtabs %}

## **eth\_getTransactionCount (WIP)**

Returns the number of transactions performed by an address.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_getTransactionCount
   &address=0x4bd5900Cb274ef15b153066D736bf3e83A9ba44e
   &tag=latest
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_getTransactionCount\&address=0x4bd5900Cb274ef15b153066D736bf3e83A9ba44e\&tag=latest\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                        |
| ------------ | ---------------------------------------------------------------------------------- |
| address      | the `string` representing the address to get transaction count                     |
| tag          | the `string` pre-defined block parameter, either `earliest`, `pending` or `latest` |
| {% endtab %} |                                                                                    |

{% tab title="Response" %}
Sample Response

```
{
   "jsonrpc":"2.0",
   "id":1,
   "result":"0x44"
}
```

{% endtab %}
{% endtabs %}

## **eth\_sendRawTransaction (WIP)**

Submits a pre-signed transaction for broadcast to the XDC network.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_sendRawTransaction
   &hex=0xf904808000831cfde080
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_sendRawTransaction\&hex=0xf904808000831cfde080\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}

{% endtab %}

{% tab %}
Query Parameters
{% endtab %}
{% endtabs %}

| Parameter | Description                                                             |
| --------- | ----------------------------------------------------------------------- |
| hex       | the `string` representing the signed raw transaction data to broadcast. |

{% tabs %}
{% tab title="Response" %}
Sample Response

```
{
  "id":1,
  "jsonrpc": "2.0",
  "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
:bulb: **Tip:** Send a **POST** request if your hex string is particularly long.
{% endhint %}

{% hint style="info" %}
:pick: **Note:** The `result` represents the **transaction hash** of the submitted raw transaction.

Use **eth\_getTransactionReceipt (WIP)** to retrieve full details.
{% endhint %}

## **eth\_getTransactionReceipt (WIP)**

Returns the receipt of a transaction by transaction hash.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_getTransactionReceipt
   &txhash=0xadb8aec59e80db99811ac4a0235efa3e45da32928bcff557998552250fa672eb
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_getTransactionReceipt\&txhash=0xadb8aec59e80db99811ac4a0235efa3e45da32928bcff557998552250fa672eb\&apikey=YourApiKeyToken) :link:

Query Parameters

| Parameter | Description                                           |
| --------- | ----------------------------------------------------- |
| txhash    | the `string` representing the hash of the transaction |

Sample Response

```
{
   "jsonrpc":"2.0",
   "id":1,
   "result":{
      "blockHash":"0x07c17710dbb7514e92341c9f83b4aab700c5dba7c4fb98caadd7926a32e47799",
      "blockNumber":"0xcf2427",
      "contractAddress":null,
      "cumulativeGasUsed":"0xeb67d5",
      "effectiveGasPrice":"0x1a96b24c26",
      "from":"0x292f04a44506c2fd49bac032e1ca148c35a478c8",
      "gasUsed":"0xb41d",
      "logs":[
         {
            "address":"0xdac17f958d2ee523a2206206994597c13d831ec7",
            "topics":[
               "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
               "0x000000000000000000000000292f04a44506c2fd49bac032e1ca148c35a478c8",
               "0x000000000000000000000000ab6960a6511ff18ed8b8c012cb91c7f637947fc0"
            ],
            "data":"0x00000000000000000000000000000000000000000000000000000000013f81a6",
            "blockNumber":"0xcf2427",
            "transactionHash":"0xadb8aec59e80db99811ac4a0235efa3e45da32928bcff557998552250fa672eb",
            "transactionIndex":"0x122",
            "blockHash":"0x07c17710dbb7514e92341c9f83b4aab700c5dba7c4fb98caadd7926a32e47799",
            "logIndex":"0xdb",
            "removed":false
         }
      ],
      "logsBloom":"0x00000000000000000000000000000000000000000000000000000000000004000000000004000000000000000000010000000000000000000000000000000000000000000000000000000008000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000010000000001100000000000000000000000000000000000000000000000000000200100000000000000000000000000080000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "status":"0x1",
      "to":"0xdac17f958d2ee523a2206206994597c13d831ec7",
      "transactionHash":"0xadb8aec59e80db99811ac4a0235efa3e45da32928bcff557998552250fa672eb",
      "transactionIndex":"0x122",
      "type":"0x2"
   }
}
```

## **eth\_call (WIP)**

Executes a new message call immediately without creating a transaction on the block chain.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_call
   &to=0xAEEF46DB4855E25702F8237E8f403FddcaF931C0
   &data=0x70a08231000000000000000000000000e16359506c028e51f16be38986ec5746251e9724
   &tag=latest
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_call\&to=0xAEEF46DB4855E25702F8237E8f403FddcaF931C0\&data=0x70a08231000000000000000000000000e16359506c028e51f16be38986ec5746251e9724\&tag=latest\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter | Description                                                                        |
| --------- | ---------------------------------------------------------------------------------- |
| to        | the `string` representing the address to interact with                             |
| data      | the hash of the method signature and encoded parameters                            |
| tag       | the `string` pre-defined block parameter, either `earliest`, `pending` or `latest` |

{% hint style="info" %}
:fuelpump: **Note:** The `gas` parameter is capped at **2x** the current block gas limit.
{% endhint %}
{% endtab %}

{% tab title="Response" %}
Sample Response

```
{
   "jsonrpc":"2.0",
   "id":1,
   "result":"0x00000000000000000000000000000000000000000000000000601d8888141c00"
}
```

{% endtab %}
{% endtabs %}

## **eth\_getCode (WIP)**

Returns code at a given address.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_getCode
   &address=0xf75e354c5edc8efed9b59ee9f67a80845ade7d0c
   &tag=latest
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_getCode\&address=0xf75e354c5edc8efed9b59ee9f67a80845ade7d0c\&tag=latest\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                        |
| ------------ | ---------------------------------------------------------------------------------- |
| address      | the `string` representing the address to get code                                  |
| tag          | the `string` pre-defined block parameter, either `earliest`, `pending` or `latest` |
| {% endtab %} |                                                                                    |

{% tab title="Response" %}
Sample Response

```
{
   "jsonrpc":"2.0",
   "id":1,
   "result":"0x"
}
```

{% endtab %}
{% endtabs %}

## **eth\_getStorageAt (WIP)**

Returns the value from a storage position at a given address.

{% hint style="danger" %}
This endpoint is still **experimental** and may have potential issues
{% endhint %}

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_getStorageAt
   &address=0x6e03d9cce9d60f3e9f2597e13cd4c54c55330cfd
   &position=0x0
   &tag=latest
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_getStorageAt\&address=0x6e03d9cce9d60f3e9f2597e13cd4c54c55330cfd\&position=0x0\&tag=latest\&apikey=YourApiKeyToken)

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                        |
| ------------ | ---------------------------------------------------------------------------------- |
| address      | the `string` representing the address to get code                                  |
| position     | the hex code of the position in storage, eg `0x0`                                  |
| tag          | the `string` pre-defined block parameter, either `earliest`, `pending` or `latest` |
| {% endtab %} |                                                                                    |

{% tab title="Response" %}
Sample Response

```
{
   "jsonrpc":"2.0",
   "id":1,
   "result":"0x0000000000000000000000003d0768da09ce77d25e2d998e6a7b6ed4b9116c2d"
}
```

{% endtab %}
{% endtabs %}

## **eth\_gasPrice (WIP)**

Returns the current price per gas in wei.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_gasPrice
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_gasPrice\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
No parameters required.
{% endtab %}

{% tab title="Response" %}
Sample Response

```
{
   "jsonrpc":"2.0",
   "id":73,
   "result":"0x430e23400"
}
```

{% hint style="info" %}
:book: **Tip:** The `result` is returned in **wei**.

Easily convert XDC units using our [**unit converter.**](https://xdc.blocksscan.io/unitconverter)
{% endhint %}
{% endtab %}
{% endtabs %}

## **eth\_estimateGas (WIP)**

Makes a call or transaction, which won't be added to the blockchain and returns the used gas.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_estimateGas
   &data=0x4e71d92d
   &to=0xf0160428a8552ac9bb7e050d90eeade4ddd52843
   &value=0xff22
   &gasPrice=0x51da038cc
   &gas=0x5f5e0ff
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_estimateGas\&data=0x4e71d92d\&to=0xf0160428a8552ac9bb7e050d90eeade4ddd52843\&value=0xff22\&gasPrice=0x51da038cc\&gas=0x5f5e0ff\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter | Description                                                                                                                                                                         |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| data      | the hash of the method signature and encoded parameters                                                                                                                             |
| to        | the `string` representing the address to interact with                                                                                                                              |
| value     | the value sent in this transaction, in hex eg. `0xff22`                                                                                                                             |
| gas       | the amount of gas provided for the transaction, in hex eg. `0x5f5e0ff`                                                                                                              |
| gasPrice  | <p>the gas price paid for each unit of gas, in wei</p><p>post <strong>EIP-1559</strong>, the <code>gasPrice</code> has to be higher than the block's <code>baseFeePerGas</code></p> |

{% hint style="info" %}
:fuelpump: **Note:** The `gas` parameter is capped at **2x** the current block gas limit.
{% endhint %}
{% endtab %}

{% tab title="Response" %}
Sample Response

```
{
   "jsonrpc":"2.0",
   "id":1,
   "result":"0x6556"
}
```

{% endtab %}
{% endtabs %}


# Tokens

## Get ERC20-Token TotalSupply by ContractAddress

Returns the current amount of an ERC-20 token in circulation.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=tokensupply
   &contractaddress=0xff7412ea7c8445c46a8254dfb557ac1e48094391
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=tokensupply\&contractaddress=0xff7412ea7c8445c46a8254dfb557ac1e48094391) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter       | Description                                |
| --------------- | ------------------------------------------ |
| contractaddress | the `contract address` of the ERC-20 token |
| {% endtab %}    |                                            |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"result": "500000000000000000000000000"
}
```

{% hint style="info" %}
:chart\_with\_upwards\_trend: **Tip** : The `result` is returned in the token's **smallest decimal representation.**

Eg. a token with a balance of `215.241526476136819398` and 18 decimal places will be returned as `215241526476136819398`
{% endhint %}
{% endtab %}
{% endtabs %}

## Get ERC20-Token Account Balance for TokenContractAddress

Returns the current balance of an ERC-20 token of an address.

```
https://api.xdcscan.io/api
   ?module=account
   &action=tokenbalance
   &contractaddress=0x8b20c72f1b138a41d2193dd056e117dce915ba8b
   &address=xdcaff614f772dd4723bffd5d5cf824b7643688a923
   &tag=latest&apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=account\&action=tokenbalance\&contractaddress=0x8b20c72f1b138a41d2193dd056e117dce915ba8b\&address=xdcaff614f772dd4723bffd5d5cf824b7643688a923\&tag=latest\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter       | Description                                                      |
| --------------- | ---------------------------------------------------------------- |
| contractaddress | the `contract address` of the ERC-20 token                       |
| address         | the `string` representing the address to check for token balance |
| {% endtab %}    |                                                                  |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"result": "78860700000000000000000000"
}
```

{% hint style="info" %}
:chart\_with\_upwards\_trend: **Tip** : The `result` is returned in the token's **smallest decimal representation.**

Eg. a token with a balance of `215.241526476136819398` and 18 decimal places will be returned as `215241526476136819398`
{% endhint %}
{% endtab %}
{% endtabs %}

## Get Historical ERC20-Token TotalSupply by ContractAddress & BlockNo <img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the amount of an ERC-20 token in circulation at a certain block height.

{% hint style="warning" %}
:pencil: **Note :** This endpoint is throttled to **2 calls/second** regardless of API Pro tier.
{% endhint %}

```
https://api.xdcscan.io/api
   ?module=stats
   &action=tokensupplyhistory
   &contractaddress=0x57d90b64a1a57749b0f932f1a3395792e12e7055
   &blockno=8000000
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=tokensupplyhistory\&contractaddress=0x57d90b64a1a57749b0f932f1a3395792e12e7055\&blockno=8000000\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter       | Description                                                                                                     |
| --------------- | --------------------------------------------------------------------------------------------------------------- |
| contractaddress | the `contract address` of the ERC-20 token                                                                      |
| blockno         | the `integer` block number to check total supply for eg. [`76986383`](https://xdc.blocksscan.io/block/76986383) |
| {% endtab %}    |                                                                                                                 |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":"21265524714464"
}
```

{% hint style="info" %}
:chart\_with\_upwards\_trend: **Tip** : The `result` is returned in the token's **smallest decimal representation.**

Eg. a token with a balance of `215.241526476136819398` and 18 decimal places will be returned as `215241526476136819398`
{% endhint %}
{% endtab %}
{% endtabs %}

## Get Historical ERC20-Token Account Balance for TokenContractAddress by BlockNo <img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the balance of an ERC-20 token of an address at a certain block height.

{% hint style="warning" %}
:pencil: **Note :** This endpoint is throttled to **2 calls/second** regardless of API Pro tier.
{% endhint %}

```
https://api.xdcscan.io/api
   ?module=account
   &action=tokenbalancehistory
   &contractaddress=0x57d90b64a1a57749b0f932f1a3395792e12e7055
   &address=0xe04f27eb70e025b78871a2ad7eabe85e61212761
   &blockno=8000000
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=account\&action=tokenbalancehistory\&contractaddress=0x57d90b64a1a57749b0f932f1a3395792e12e7055\&address=0xe04f27eb70e025b78871a2ad7eabe85e61212761\&blockno=8000000\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter       | Description                                                                                                     |
| --------------- | --------------------------------------------------------------------------------------------------------------- |
| contractaddress | the `contract address` of the ERC-20 token                                                                      |
| address         | the `string` representing the address to check for balance                                                      |
| blockno         | the `integer` block number to check total supply for eg. [`76986383`](https://xdc.blocksscan.io/block/76986383) |
| {% endtab %}    |                                                                                                                 |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":"135499"
}
```

{% hint style="info" %}
:chart\_with\_upwards\_trend: **Tip** : The `result` is returned in the token's **smallest decimal representation.**

Eg. a token with a balance of `215.241526476136819398` and 18 decimal places will be returned as `215241526476136819398`
{% endhint %}
{% endtab %}
{% endtabs %}

## Get Token Holder List by Contract Address <img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Return the current ERC20 token holders and number of tokens held.

```
https://api.xdcscan.io/api
   ?module=token
   &action=tokenholderlist
   &contractaddress=0x5d5f074837f5d4618b3916ba74de1bf9662a3fed
   &page=1
   &offset=10
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=token\&action=tokenholderlist\&contractaddress=0x5d5f074837f5d4618b3916ba74de1bf9662a3fed\&page=1\&offset=10\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter       | Description                                         |
| --------------- | --------------------------------------------------- |
| contractaddress | the `contract address` of the ERC-20 token          |
| page            | the `integer` page number, if pagination is enabled |
| offset          | the number of transactions displayed per page       |
| {% endtab %}    |                                                     |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"result": [
{
"TokenHolderAddress": "0x478a72f7424b7be55a48ed51714cfebba561ee3a",
"TokenHolderQuantity": "87500000000000000000000000"
},
{
"TokenHolderAddress": "0x9223fc00642c3020b4b2525619e798636560a0ea",
"TokenHolderQuantity": "60196381000000000000000000"
},
{
"TokenHolderAddress": "0x02fe7b136f5dbff8d00546cb5af45afd1e1d350c",
"TokenHolderQuantity": "28708172094690000000000000"
},
{
"TokenHolderAddress": "0xc1b519019639c7e684c6626440b448582cbe0a75",
"TokenHolderQuantity": "22907106095177981285268107"
},
{
"TokenHolderAddress": "0x07787fa0108d4188c6f58d99058c3967b2f05e6a",
"TokenHolderQuantity": "20719833292342250000000000"
}
    ]
}
```

{% endtab %}
{% endtabs %}

## Get Token Info by ContractAddress <img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns project information and social media links of an ERC20/ERC721/ERC1155 token.

```
https://api.xdcscan.io/api
   ?module=token
   &action=tokeninfo
   &contractaddress=0x5d5f074837f5d4618b3916ba74de1bf9662a3fed
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=token\&action=tokeninfo\&contractaddress=0x5d5f074837f5d4618b3916ba74de1bf9662a3fed) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter       | Description                                                               |
| --------------- | ------------------------------------------------------------------------- |
| contractaddress | the `contract address` of the ERC-20/ERC-721 token to retrieve token info |
| {% endtab %}    |                                                                           |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"result": {
"contractAddress": "0x5d5f074837f5d4618b3916ba74de1bf9662a3fed",
"tokenName": "STORX",
"symbol": "SRX",
"divisor": null,
"tokenType": "ERC-20",
"totalSupply": "596893424.652282",
"blueCheckmark": null,
"description": "StorX helps you securely encrypt, fragment and then distribute important data across multiple hosting nodes spread worldwide. StorX provides a democratic marketplace for hosting data, replacing the centralized intermediaries with a decentralized blockchain network. Exercise complete control and grant access over your data sets without any centralized intermediary.",
"website": "https://storx.tech/",
"email": null,
"blog": null,
"reddit": null,
"slack": null,
"facebook": "https://www.facebook.com/StorXNetwork",
"twitter": "https://twitter.com/StorXNetwork",
"bitcointalk": null,
"github": null,
"telegram": "StorXNetwork",
"webchat": null,
"discord": "https://discord.gg/ha4Jufj2Nm",
"whitepaper": null,
"tokenPriceUSD": "N/A"
}
}
```

{% endtab %}
{% endtabs %}

## Get Address ERC20 Token Holding <img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the ERC-20 tokens and amount held by an address.

{% hint style="warning" %}
**Note :** This endpoint is throttled to **2 calls/second** regardless of API Pro tier.
{% endhint %}

```
https://api.xdcscan.io/api
   ?module=account
   &action=addresstokenbalance
   &address=xdcd77875dF9C9dE07a5a701F4431743e3A0e9Fe03a
   &page=1
   &offset=100
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=account\&action=addresstokenbalance\&address=xdcd77875dF9C9dE07a5a701F4431743e3A0e9Fe03a\&page=1\&offset=100\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                |
| ------------ | ---------------------------------------------------------- |
| address      | the `string` representing the address to check for balance |
| page         | the `integer` page number, if pagination is enabled        |
| offset       | the number of transactions displayed per page              |
| {% endtab %} |                                                            |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"result": [
{
"TokenAddress": "0x4e3037297830c8023d1646937a3d44c018d1a5c3",
"TokenName": "RIPPLERICH",
"TokenSymbol": "RR",
"TokenQuantity": "1000000000000000000",
"TokenDivisor": "18"
},
{
"TokenAddress": "0x834a6cd4cc361e4b9b1694d2e9df3eeb0cb45c5a",
"TokenName": "Xinu",
"TokenSymbol": "XINU",
"TokenQuantity": "5000000000000000000000000",
"TokenDivisor": "18"
},
{
"TokenAddress": "0x9af596a20c94415bf87be8a0a9643c8b76e88dc9",
"TokenName": "BitcoinXTreasury",
"TokenSymbol": "BTCxT",
"TokenQuantity": "1",
"TokenDivisor": "18"
}
]
}
```

{% endtab %}
{% endtabs %}

## Get Address ERC721 Token Holding <img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the ERC-721 tokens and amount held by an address.

{% hint style="warning" %}
**Note :** This endpoint is throttled to **2 calls/second** regardless of API Pro tier.
{% endhint %}

```
https://api.xdcscan.io/api
   ?module=account
   &action=addresstokennftbalance
   &address=xdcb6191f07e66a81ea6b0827cbe2e073ff2a8f5047
   &page=1
   &offset=100
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=account\&action=addresstokennftbalance\&address=xdcb6191f07e66a81ea6b0827cbe2e073ff2a8f5047\&page=1\&offset=100\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                |
| ------------ | ---------------------------------------------------------- |
| address      | the `string` representing the address to check for balance |
| page         | the `integer` page number, if pagination is enabled        |
| offset       | the number of transactions displayed per page              |
| {% endtab %} |                                                            |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"result": [
{
"TokenAddress": "0x134279d46ce98cca734d9a43cc3dda63a1ac755d",
"TokenName": "Prime Numbers PRNT NFT V3",
"TokenSymbol": "PRNTNFTv3",
"TokenQuantity": "14"
},
{
"TokenAddress": "0x9d458330e458f11fd1ce7e44b3a66568af8076a0",
"TokenName": "Prime Numbers XDC NFT V2",
"TokenSymbol": "XDCNFTv2",
"TokenQuantity": "106"
}
]
}
```

{% endtab %}
{% endtabs %}

## Get Address ERC721 Token Inventory By Contract Address <img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line"> <a href="#get-address-erc721-token-inventory-by-contract-address" id="get-address-erc721-token-inventory-by-contract-address"></a>

Returns the ERC-721 token inventory of an address, filtered by contract address.

{% hint style="warning" %}
:pencil: **Note :** This endpoint is throttled to **2 calls/second** regardless of API Pro tier.
{% endhint %}

```
https://api.xdcscan.io/api
   ?module=account
   &action=addresstokennftinventory
   &address=xdcc2f3b189095e3931241b61ce584331dcec146cb9
   &contractaddress=0x134279d46ce98cca734d9a43cc3dda63a1ac755d
   &page=1
   &offset=100
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=account\&action=addresstokennftinventory\&address=xdcc2f3b189095e3931241b61ce584331dcec146cb9\&contractaddress=0x134279d46ce98cca734d9a43cc3dda63a1ac755d\&page=1\&offset=100\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter       | Description                                                                                                                                                           |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| address         | the `string` representing the address to check for inventory                                                                                                          |
| contractaddress | the `string` representing the ERC-721 token contractaddress to check for inventory                                                                                    |
| page            | the `integer` page number, if pagination is enabled                                                                                                                   |
| offset          | <p>the number of records displayed per page<br><br>limited to <strong>1000 records</strong> per query, use the <code>page</code> parameter for subsequent records</p> |
| {% endtab %}    |                                                                                                                                                                       |

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"result": [
{
"TokenAddress": "0x134279d46ce98cca734d9a43cc3dda63a1ac755d",
"TokenId": "30"
}
]
}
```

{% endtab %}
{% endtabs %}


# Gas Tracker (WIP)

## Get Estimation of Confirmation Time (WIP)

Returns the estimated time, in seconds, for a transaction to be confirmed on the blockchain.

```
https://api.xdcscan.io/api
   ?module=gastracker
   &action=gasestimate
   &gasprice=2000000000
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=gastracker\&action=gasestimate\&gasprice=2000000000\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter | Description                              |
| --------- | ---------------------------------------- |
| gasprice  | the price paid per unit of gas, in `wei` |

{% hint style="info" %}
:book: **Tip:** Easily convert XDC units using our [**unit converter.**](https://xdc.blocksscan.io/unitconverter)
{% endhint %}
{% endtab %}

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":"9227"
}
```

{% hint style="info" %}
:pencil: **Note:** The `result` is returned in **seconds.**
{% endhint %}
{% endtab %}
{% endtabs %}

## Get Gas Oracle ***(Coming Soon)***

Returns the current Safe, Proposed and Fast gas prices.

{% hint style="info" %}
Post **EIP-1559** :fire: changes :

* Safe/Proposed/Fast gas price recommendations are now modeled as Priority Fees.
* New field `suggestBaseFee` , the baseFee of the next pending block
* New field `gasUsedRatio`, to estimate how busy the network is

Learn more about the [**gas changes in EIP-1559.**](https://metamask.io/1559)
{% endhint %}

```
https://api.xdcscan.io/api
   ?module=gastracker
   &action=gasoracle
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=gastracker\&action=gasoracle\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
No parameters required.
{% endtab %}

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":{
      "LastBlock":"13053741",
      "SafeGasPrice":"20",
      "ProposeGasPrice":"22",
      "FastGasPrice":"24",
      "suggestBaseFee":"19.230609716",
      "gasUsedRatio":"0.370119078777807,0.8954731,0.550911766666667,0.212457033333333,0.552463633333333"
   }
}
```

{% hint style="info" %}
:fuelpump: **Note:** The gas prices are returned in **Gwei.**
{% endhint %}
{% endtab %}
{% endtabs %}

## Get Daily Average Gas Limit ***(Coming Soon)***<img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the historical daily average gas limit of the XDC network.

```
 https://api.xdcscan.io/api
    ?module=stats
    &action=dailyavggaslimit
    &startdate=2019-02-01
    &enddate=2019-02-28
    &sort=asc
    &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=dailyavggaslimit\&startdate=2019-02-01\&enddate=2019-02-28\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startdate    | the starting date in `yyyy-MM-dd` format, eg. `2019-01-31`                              |
| enddate      | the ending date in `yyyy-MM-dd` format, eg. `2019-02-28`                                |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "gasLimit":"8001360"
      },
      {
         "UTCDate":"2019-02-27",
         "unixTimeStamp":"1551225600",
         "gasLimit":"8001071"
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "gasLimit":"8001137"
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Get XDC Daily Total Gas Used ***(Coming Soon)***<img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the total amount of gas used daily for transctions on the XDC network.

```
 https://api.xdcscan.io/api
    ?module=stats
    &action=dailygasused
    &startdate=2019-02-01
    &enddate=2019-02-28
    &sort=asc
    &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=dailygasused\&startdate=2019-02-01\&enddate=2019-02-28\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startdate    | the starting date in `yyyy-MM-dd` format, eg. `2019-01-31`                              |
| enddate      | the ending date in `yyyy-MM-dd` format, eg. `2019-02-28`                                |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "gasUsed":"32761450415"
      },
      {
         "UTCDate":"2019-02-27",
         "unixTimeStamp":"1551225600",
         "gasUsed":"32657440136"
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "gasUsed":"33081119561"
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Get Daily Average Gas Price ***(Coming Soon)***<img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the daily average gas price used on the XDC network.

```
 https://api.xdcscan.io/api
    ?module=stats
    &action=dailyavggasprice
    &startdate=2024-02-01
    &enddate=2024-02-28
    &sort=asc
    &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=dailyavggasprice\&startdate=2024-02-01\&enddate=2024-02-28\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startdate    | the starting date in `yyyy-MM-dd` format, eg. `2019-01-31`                              |
| enddate      | the ending date in `yyyy-MM-dd` format, eg. `2019-02-28`                                |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "maxGasPrice_Wei":"60814303896257",
         "minGasPrice_Wei":"432495",
         "avgGasPrice_Wei":"13234562600"
      },
      {
         "UTCDate":"2019-02-27",
         "unixTimeStamp":"1551225600",
         "maxGasPrice_Wei":"42000000000000",
         "minGasPrice_Wei":"1000000",
         "avgGasPrice_Wei":"16334617513"
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "maxGasPrice_Wei":"237222222222257",
         "minGasPrice_Wei":"100000000",
         "avgGasPrice_Wei":"18834674068"
      }
   ]
}
```

{% endtab %}
{% endtabs %}


# Stats

## Get Total Supply of XDC

Returns the current amount of Ether in circulation excluding ETH2 Staking rewards and EIP1559 burnt fees.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=ethsupply
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=ethsupply\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
No parameters required.
{% endtab %}

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"result": "38038815606352800279107935780",
"status": "1"
}
```

{% hint style="info" %}
:book: **Tip :** Easily convert XDC units using our [**unit converter.**](https://xdc.blocksscan.io/unitconverter)
{% endhint %}
{% endtab %}
{% endtabs %}

## Get XDC Last Price

Returns the latest price of 1 XDC.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=xdcprice
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=xdcprice\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
No parameters required.
{% endtab %}

{% tab title="Response" %}
Sample Response

```
{
"message": "OK",
"status": "1",
"result": "0.02632"
}

```

{% hint style="info" %}
:hourglass\_flowing\_sand: **Tip :** The `timestamps` are represented in [**Unix timestamp.**](https://www.unixtimestamp.com/)
{% endhint %}
{% endtab %}
{% endtabs %}

## Get XDC Nodes Size ***(Coming Soon)***

Returns the size of the XDC blockchain, in bytes, over a date range.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=chainsize
   &startdate=2024-08-10
   &enddate=2024-08-15
   &clienttype=geth
   &syncmode=default
   &sort=asc
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=chainsize\&startdate=2024-08-10\&enddate=2024-08-15\&clienttype=geth\&syncmode=default\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startdate    | the starting date in `yyyy-MM-dd` format, eg. `2019-06-01`                              |
| enddate      | the ending date in `yyyy-MM-dd` format, eg. `2024-07-10`                                |
| clienttype   | the XDC \[node client] to use, either `geth` or `parity`                                |
| syncmode     | the \[type of node] to run, either `default` or `archive`                               |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "blockNumber":"7156164",
         "chainTimeStamp":"2019-02-01",
         "chainSize":"184726421279",
         "clientType":"Geth",
         "syncMode":"Default"
      }
      {
         "blockNumber":"7276521",
         "chainTimeStamp":"2019-02-28",
         "chainSize":"197073145113",
         "clientType":"Geth",
         "syncMode":"Default"
      }
   ]
}
```

{% hint style="info" %}
:chains: **Tip :** The `chainSize` is represented in **bytes.**
{% endhint %}
{% endtab %}
{% endtabs %}

## Get Total Nodes Count

Returns the total number of discoverable XDC nodes.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=nodecount
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=nodecount\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
No parameters required.
{% endtab %}

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":{
      "UTCDate":"2021-06-29",
      "TotalNodeCount":"6413"
   }
}
```

{% endtab %}
{% endtabs %}

## Get Daily Network Transaction Fee <img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the amount of transaction fees paid to miners per day.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=dailytxnfee
   &startdate=2024-08-10
   &enddate=2024-08-15
   &sort=asc
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=dailytxnfee\&startdate=2024-08-10\&enddate=2024-08-15\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
No parameters required.
{% endtab %}

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "transactionFee_Eth":"358.558440870590355682"
      }
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "transactionFee_Eth":"545.141762162356907132"
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Get Daily New Address Count<img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the number of new XDC addresses created per day.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=dailynewaddress
   &startdate=2024-08-10
   &enddate=2024-08-15
   &sort=asc
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=dailynewaddress\&startdate=2024-08-10\&enddate=2024-08-15\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startdate    | the starting date in `yyyy-MM-dd` format, eg. `2019-02-01`                              |
| enddate      | the ending date in `yyyy-MM-dd` format, eg. `2019-02-28`                                |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "newAddressCount":54081
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "newAddressCount":53117
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Get Daily Network Utilization <img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the daily average gas used over gas limit, in percentage.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=dailynetutilization
   &startdate=2024-08-10
   &enddate=2024-08-15
   &sort=asc
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=dailynetutilization\&startdate=2024-08-10\&enddate=2024-08-15\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startdate    | the starting date in `yyyy-MM-dd` format, eg. `2019-02-01`                              |
| enddate      | the ending date in `yyyy-MM-dd` format, eg. `2019-02-28`                                |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "networkUtilization":"0.8464"
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "networkUtilization":"0.9472"
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Get Daily Average Network Hash Rate ***(Coming Soon)***<img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the historical measure of processing power of the XDC network.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=dailyavghashrate
   &startdate=2024-08-10
   &enddate=2024-08-15
   &sort=asc
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=dailyavghashrate\&startdate=2024-08-10\&enddate=2024-08-15\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startdate    | the starting date in `yyyy-MM-dd` format, eg. `2019-02-01`                              |
| enddate      | the ending date in `yyyy-MM-dd` format, eg. `2019-02-28`                                |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "networkHashRate":"143116.0140"
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "networkHashRate":"157689.3983"
      }
   ]
}
```

{% hint style="info" %}
:fire: **Tip :** The `networkHashRate` is represented in [**GigaHashes ( GH/s )**](https://coinguides.org/hashpower-converter-calculator/)**.**
{% endhint %}
{% endtab %}
{% endtabs %}

## Get Daily Transaction Count <img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the number of transactions performed on the XDC blockchain per day.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=dailytx
   &startdate=2024-08-10
   &enddate=2024-08-15
   &sort=asc
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=dailytx\&startdate=2024-08-10\&enddate=2024-08-15\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startdate    | the starting date in `yyyy-MM-dd` format, eg. `2019-02-01`                              |
| enddate      | the ending date in `yyyy-MM-dd` format, eg. `2019-02-28`                                |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "transactionCount":498856
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "transactionCount":541458
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Get Daily Average Network Difficulty ***(Coming Soon)***<img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the historical mining difficulty of the XDC network.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=dailyavgnetdifficulty
   &startdate=2024-08-10
   &enddate=2024-08-15
   &sort=asc
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=dailyavgnetdifficulty\&startdate=2024-08-10\&enddate=2024-08-15\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startdate    | the starting date in `yyyy-MM-dd` format, eg. `2019-02-01`                              |
| enddate      | the ending date in `yyyy-MM-dd` format, eg. `2019-02-28`                                |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "networkDifficulty":"2,408.028"
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "networkDifficulty":"2,927.453"
      }
   ]
}
```

{% hint style="info" %}
**​**​ :fire: **Tip :** The `networkDifficulty` is represented in [**TeraHashes ( TH/s )**](https://coinguides.org/hashpower-converter-calculator/)**.**
{% endhint %}
{% endtab %}
{% endtabs %}

## Get XDC Historical Daily Market Cap <img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the historical XDC daily market capitalization.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=xdcdailymarketcap
   &startdate=2024-08-10
   &enddate=2024-08-15
   &sort=asc
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=xdcdailymarketcap\&startdate=2024-08-10\&enddate=2024-08-15\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startdate    | the starting date in `yyyy-MM-dd` format, eg. `2019-02-01`                              |
| enddate      | the ending date in `yyyy-MM-dd` format, eg. `2019-02-28`                                |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "supply":"104672819.281250",
         "marketCap":"11203.1318476721875",
         "price":"107.03"
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "supply":"105048576.406250",
         "marketCap":"14317.0704784078125",
         "price":"136.29"
      }
   ]
}
```

{% hint style="info" %}
**​**​ :moneybag: **Tip :** The `marketCap` is represented in [**m**](https://coinguides.org/hashpower-converter-calculator/)**illion US Dollars ( USD ).**
{% endhint %}
{% endtab %}
{% endtabs %}

## Get XDC Historical Price <img src="https://github.com/BlocksScan/Docs/blob/api/broken-reference" alt="" data-size="line">

Returns the historical price of 1 XDC.

```
https://api.xdcscan.io/api
   ?module=stats
   &action=xdcdailyprice
   &startdate=2024-08-10
   &enddate=2024-08-10
   &sort=asc
   &apikey=YourApiKeyToken 
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=stats\&action=xdcdailyprice\&startdate=2024-08-10\&enddate=2024-08-15\&sort=asc\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| startdate    | the starting date in `yyyy-MM-dd` format, eg. `2019-02-01`                              |
| enddate      | the ending date in `yyyy-MM-dd` format, eg. `2019-02-28`                                |
| sort         | the sorting preference, use `asc` to sort by ascending and `desc` to sort by descending |
| {% endtab %} |                                                                                         |

{% tab title="Response" %}
Sample Response

```
{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2019-02-01",
         "unixTimeStamp":"1548979200",
         "value":"107.03"
      },
      {
         "UTCDate":"2019-02-28",
         "unixTimeStamp":"1551312000",
         "value":"136.29"
      }
   ]
}
```

{% hint style="info" %}
**​**​ :moneybag: **Tip :** The `value` is represented in **US Dollars ( USD ).**
{% endhint %}
{% endtab %}
{% endtabs %}


# What's Contract Verification

> Contract verification is essentially **open-sourcing** your contract code :pencil2:

Contract verification allows smart contract developers to prove and publish the **source code** of the contracts deployed on-chain :white\_check\_mark: .

You may have come across some of them when browsing the [**Contract tab**](https://xdc.blocksscan.io/address/0x5d5f074837f5d4618b3916ba74de1bf9662a3fed?tab=contract#code) of any contract address on XDC BlocksScan Explorer.

<figure><img src="https://3031522054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXu62EOofQp3ILGO91lm4%2Fuploads%2Fgit-blob-a4cf3382820cc869c87e90f7951670c5499c7a2f%2FNew%20contract.png?alt=media" alt=""><figcaption></figcaption></figure>

## How do I verify a contract I've deployed ? <a href="#how-do-i-verify-a-contract-ive-deployed" id="how-do-i-verify-a-contract-ive-deployed"></a>

If you've deployed your contract using an online tool such as Remix, or OpenZeppelin's Contract Wizard, consider using the [**contract verification**](https://xdc.blocksscan.io/contracts/verify) page.

<figure><img src="https://3031522054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXu62EOofQp3ILGO91lm4%2Fuploads%2Fgit-blob-f6e505d62770fd1d3b19d60df4ea7f0c8576a6b2%2Fverify.png?alt=media" alt=""><figcaption></figcaption></figure>

If you've deployed your contract using a development tool such as Hardhat, Foundry, Truffle and so on, consider using [**plugins**](/contract-verification/contract-verification-plugins) to automate the verification process.

<figure><img src="https://3031522054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXu62EOofQp3ILGO91lm4%2Fuploads%2Fgit-blob-064bfc5265726fb677ccbf6641a4cb9d61b0f987%2Flibrary.png?alt=media" alt=""><figcaption></figcaption></figure>


# Multichain Verification(WIP)

For repeated or multichain contract verification, it's best to use the Verify Contract endpoint to automate source code submission :rabbit2:.

## 1. Using the Verify Contract Endpoint <a href="#id-1.-using-the-verify-contract-endpoint" id="id-1.-using-the-verify-contract-endpoint"></a>

In Postman, set your request method to **HTTP POST** and your URL to `https://api.xdcscan.io/` .

Under the Body tab and using `form-data`, specify the "module" to `contract` and "action" to `verifysourcecode.`

## 2. Specify Your chainId <a href="#id-2.-specify-your-chainid" id="id-2.-specify-your-chainid"></a>

Select the chain you've deployed your contract, which is supported by an Etherscan-like explorer.

Specify it under the "chainId" parameter, such as `51` for Apothem and `8453` for Base.

## 3. Add Contract Source Code <a href="#id-3.-add-contract-source-code" id="id-3.-add-contract-source-code"></a>

We support 2 formats, `solidity-single-file` or `solidity-standard-json-input.`

Using JSON is the gold standard ✨ for verification, as you can [**include compiler settings and multiple files**](https://gist.github.com/0xV4L3NT1N3/974d6bfb58070e0fe4e38d626cdf1c44) ( if you use imports such as from [**OpenZeppelin**](https://www.openzeppelin.com/contracts) ).

Paste your source code under "sourceCode" and the code format under the "codeformat" parameter.

Optionally if your contract uses \[**constructor arguments**], you may specify them too under the "constructorArguements" parameter in [**ABI encoded**](https://abi.hashex.org/) format.

## 4. Add Contract Metadata <a href="#id-4.-add-contract-metadata" id="id-4.-add-contract-metadata"></a>

Include the contract address as "contractaddress", beginning with "0x".

Specify your contract file path and contract name **separated by a colon** as "contractname", such as "contracts/Verified.sol:Verified".

## 5. Submitting Verification <a href="#id-5.-submitting-verification" id="id-5.-submitting-verification"></a>

If everything went well, you'll see the happy green checkmark on your [**contract code**](https://xdc.blocksscan.io/address/0x1f45725b14d6a87d87e94c9402221f7a2ef18e67?tab=contract#code) ✅


# Supported Chains

| Explorer    | Chain ID |
| ----------- | -------- |
| XDC Network | 50       |
| XDC Apothem | 51       |
| Telos       | 40       |
| WanChain    | 888      |
| Velas       | 106      |


# Common Verification Errors

{% hint style="info" %}
An index of possible errors you may encounter when submitting [**contract verification**](https://docs.blocksscan.io/api-endpoints/contracts#verify-source-code) requests to the endpoint, and potions to debug them :bug:
{% endhint %}

## Contract Doesn't Match <a href="#contract-doesnt-match" id="contract-doesnt-match"></a>

> "Compiled contract deployment bytecode does NOT match the transaction deployment bytecode"

The submitted source code does not match the contract code deployed on chain.

Common causes include using a different compiler version or enabling optimisation runs.

For an exact match to be found, both **source code** and **compiler settings** specified have to exactly match the deployment conditions, for the same bytecode to be reproduced.

## Solidity Compilation Error <a href="#solidity-compilation-error" id="solidity-compilation-error"></a>

> "Solidity Compilation Error: Identifier not found or not unique"

A compilation issue occured due to syntax errors in your Solidity source code.

Consider debugging your contract with any compiler such as [**Remix**](https://remix.xinfin.network/) or [**Hardhat**](https://hardhat.org/) and reference the error from Solidity's [**official documentation**](https://docs.soliditylang.org/).

## Contract Not Deployed <a href="#contract-not-deployed" id="contract-not-deployed"></a>

> "Unable to locate ContractCode at 0x539a277b12a3f6723f4c1769edb11b0be7c214da

The contract has not been deployed at the specific address at the specific chain.

Check the contract address you've deployed, if your contract deployment transaction has succeeded or if the **chainId** specified is correct.

## Missing or Invalid Library Names <a href="#missing-or-invalid-library-names" id="missing-or-invalid-library-names"></a>

> "Library was required but suitable match not found"

A [**library**](https://solidity-by-example.org/library/) was used in your contract deployment, but was not specified, misspelt or using the wrong library address.

Double check on your library names ( **case sensitive** such as "PRBMath" ) or ensure that a matching library name and library address is provided.

## Missing Contract Name <a href="#missing-contract-name" id="missing-contract-name"></a>

> "Unable to locate ContractName , did you specify the correct Contract Name ?"

A match was not found with the name of the contract specified when multiple files are provided.

Ensure that you have provided the correct contract name to be matched against, and making sure you submit the **main contract** name not its dependencies.

## No Deployment Bytecode Match Found <a href="#no-deployment-bytecode-match-found" id="no-deployment-bytecode-match-found"></a>

> "Compiled contract deployment bytecode does NOT match the transaction deployment bytecode"

The compilation of your submitted source code does not match the deployment bytecode, ie the constructor arguments plus general initialisation code and runtime bytecode.

Similar solution as above, do take into account constructor arguments as well below.

## Missing/Invalid Constructor Arguments <a href="#missing-invalid-constructor-arguments" id="missing-invalid-constructor-arguments"></a>

> "Please check if the correct constructor argument was entered"

if your contract utilized the `constructor` keyword, you should provide it in hex format. Otherwise, leave this field empty as it is.

You may reference your original deployment's constructor arguments or determine it from the [**end of your compiled bytecode**](/contract-verification/common-verification-errors).

{% hint style="info" %}
There is an easter egg :hatching\_chick: on the `constructorArguements` field spelling, using it as the "correct" spelling may miss your submission!
{% endhint %}

## Mismatched bytecode metadata hash <a href="#mismatched-bytecode-metadata-hash" id="mismatched-bytecode-metadata-hash"></a>

> "Please check if the correct bytecodehash was specified via standard-json verification."

The [**metadata hash**](https://docs.soliditylang.org/en/v0.8.17/metadata.html#encoding-of-the-metadata-hash-in-the-bytecode) settings of your submitted source code differs from the settings of your original contract deployment, such as being set to `ipfs` or `none`.

Submit your contract verification using the solc json input format, and [**specify the settings**](https://github.com/PaulRBerg/hardhat-template/blob/f6406c4e7c9e23d5169b39fb11d528a975b678e6/hardhat.config.ts#L104) accordingly there.

Other submission formats such as single file or multifile **do not support** changing this setting, and will use the compiler defaults.

## Similar Match Found <a href="#similar-match-found" id="similar-match-found"></a>

> "This contract already Similar Matches the deployed ByteCode at 0x4200000000000000000000000000000000000042"

This error indicates that the contract has already been verified via Similar Match to another contract.

Kindly [**reach out**](https://docs.blocksscan.io/support/getting-help) to us at this point of time to have this updated to Full Match if required.

## Unsupported Solc Version <a href="#unsupported-solc-version" id="unsupported-solc-version"></a>

> "Invalid or not supported solc version, see <https://etherscan.io/solcversions> for list"

This error is thrown when you specify to use an invalid or unsupported version of the Solidity Compiler ie. below `v0.4.11-nightly.2017.3.15+`.

Do **let us know** if you need to verify a contract below this supported version such as to prove you deployed the first NFT!

## Source Code Already Verified <a href="#source-code-already-verified" id="source-code-already-verified"></a>

> "Source code already verified"

An Exact Match has been obtained, get back to having your coffee!

If you think this might be a mistake, do check if you've submitted verification to the right **explorer/chain**, a contract that is verified on Etherscan is **not automatically verified** on other explorers.

## Unsupported File Import Callback <a href="#unsupported-file-import-callback" id="unsupported-file-import-callback"></a>

> "Source "@openzeppelin/contracts/ERC20.sol" not found: File import callback not supported"

This error is thrown when contracts reference imports from external sources, such as [**OpenZeppelin**](https://docs.openzeppelin.com/) libraries or Github links.

Consider [**flattening**](https://hardhat.org/hardhat-runner/docs/advanced/flattening#flattening-your-contracts) your source code into a single file, or use the Solidity Standard Json Input format that comes with tools such as [**Hardhat**](https://hardhat.org/hardhat-runner/docs/guides/verifying#verifying-your-contracts) to resolve these external imports.

## Invalid chainId <a href="#invalid-chainid" id="invalid-chainid"></a>

The chain you've specified does not have an Etherscan-like explorer.

Check the chainId used against our[ **supported list**.](/contract-verification/supported-chains)

#### Temporary Error <a href="#temporary-error" id="temporary-error"></a>

> "This could be a temporary error, please retry or contact us (Error Code 10001/10002/10003)"

Something went wrong on our end, which could include downtime or maintenance windows.

Please retry this in a while or [**ping us**](/support/getting-help) if this continues to persist!


# Contract Verification Plugins

{% hint style="info" %}
The following are **3rd party tools** and **utilities** :wrench: created by the community :raised\_hands: . We do not provide any support or warranties for the solutions listed below.
{% endhint %}

### hardhat-verify <a href="#hardhat-verify" id="hardhat-verify"></a>

A plugin to verifying contracts developed on the [**Hardhat** ](https://hardhat.org/)development environment, built by [**@nomiclabs**](https://nomiclabs.io/)

{% embed url="<https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-verify>" %}

### truffle-plugin-verify <a href="#truffle-plugin-verify" id="truffle-plugin-verify"></a>

A plugin for verifying contracts built using the [**Truffle**](https://www.trufflesuite.com/) development environment, built by [**@rkalis**](https://github.com/rkalis/truffle-plugin-verify)

{% embed url="<https://www.npmjs.com/package/truffle-plugin-verify>" %}


# Libraries (WIP)

The following are **3rd party tools** and **utilities** 🔧 created by the community 🙌 . We do not provide any support or warranties for the solutions listed below.

### Postman <a href="#postman" id="postman"></a>

A simple [**Postman collection**](https://www.postman.com) of the APIs for testing and debugging calls.

### Python <a href="#python" id="python"></a>

An asynchronous Python wrapper for Etherscan ( and other chains ), available on [**PyPI**](https://pypi.org/project/aioetherscan/) and developed by [**@ape364**](https://github.com/ape364)

A Python wrapper for the Etherscan APIs developed by [**@corpetty**](https://github.com/corpetty)

A Python wrapper available as a package on [**PyPI**](https://pypi.org/project/etherscan-python/) developed by [**@pcko1**](https://github.com/pcko1)

### NodeJS <a href="#nodejs" id="nodejs"></a>

A NodeJS wrapper for the Etherscan APIs developed by [**@sebs**](https://github.com/sebs)

### GoLang <a href="#golang" id="golang"></a>

A Go binding for the Etherscan APIs developed by [**@nanmu42**](https://github.com/nanmu42)

### PHP <a href="#php" id="php"></a>

A PHP wrapper, available as a package on [**Packagist** ](https://packagist.org/packages/maslakoff/php-etherscan-api)developed by [**@maslakoff**](https://github.com/maslakoff)

A PHP wrapper for the Etherscan APIs developed by [**@dzarezenko**](https://github.com/dzarezenko)

### .NET <a href="#net" id="net"></a>

A .NET wrapper for the Etherscan APIs, available as a [**NuGet**](https://www.nuget.org/packages/Etherscan.net/) package developed by [**@hossyposs**](https://github.com/hossyposs)

### Lisp <a href="#lisp" id="lisp"></a>

A Common Lisp wrapper available on Github developed by [**@muyinliu**](https://github.com/muyinliu)

### Dart <a href="#dart" id="dart"></a>

A Dart wrapper for Flutter applications available on Pub by [**@Zfinix**](https://github.com/Zfinix)

PreviousContract Verification PluginsNextFAQ


# FAQ

Frequently Asked Questions.

## If you have any doubt related to the API and endpoints, you can connect with us. <a href="#can-the-same-api-keys-be-used-across-different-explorers" id="can-the-same-api-keys-be-used-across-different-explorers"></a>

If you encounter any issues with the API and its endpoints, please connect with us and report your issue in the following format:

Your Name\
The Issue You Are Experiencing\
API Endpoint

For example

```
Hey my name is john 
This api is not working showing XYZ error 
API-Endpoint
```

**Telegram** : BlocksScanIO\
**Email**: support.blocksscan.io

If the issue still persists after a few minutes or with a previously working key, do [**reach out**](/support/getting-help) for us to have a closer look.


# Rate Limits

Reference for various API tiers and their rate limits :construction: .

| API Tier     | Rate Limit                                  |
| ------------ | ------------------------------------------- |
| Free         | 5 calls/second , up to 100,000 calls/day    |
| Standard     | 10 calls/second , up to 200,000 calls/day   |
| Advanced     | 20 calls/second , up to 500,000 calls/day   |
| Professional | 30 calls/second , up to 1,000,000 calls/day |

{% hint style="info" %}
If you require a higher limit than the available plans, kindly [**Contact Us**](https://docs.blocksscan.io/support/getting-help) for pricing of dedicated plans.
{% endhint %}


# Common Error Messages

An API call that encounters an error :warning: will return 0 as its `status code` and display the cause of the error under the `result` field.

```json
{
   "status":"0",
   "message":"NOTOK",
   "result":"Max rate limit reached, please use API Key for higher rate limit"
}
```

## Max rate limit <a href="#max-rate-limit" id="max-rate-limit"></a>

> "Max rate limit reached, please use API Key for higher rate limit"

This error occurs when you **exceed the rate limit** assigned to your specific API key.

To resolve, adhere to the [**rate limits**](/support/rate-limits) of your available plan by waiting for a certain amount of time before each request. If you are using a script or application, **apply throttling** to limit the frequency of calls.

## Missing or invalid action <a href="#missing-or-invalid-action" id="missing-or-invalid-action"></a>

> "Error! Missing Or invalid Action name"

This error occurs when you **do not specify**, or specify an **invalid** `module` and `action` name.

To resolve, **double check** your API query to use a valid module and action name.

If you require some help getting started, try copying the sample queries provided in the [**API Endpoints**](https://docs.blocksscan.io/getting-started/endpoint-urls) and pasting them into your browser.

## Endpoint-specific errors <a href="#endpoint-specific-errors" id="endpoint-specific-errors"></a>

> "Error! Block number already pass"
>
> "Error! Invalid address format"
>
> "Contract source code not verified"

These error messages returned are specific to certain endpoints and their **related parameters.**

To resolve, kindly refer to the specific endpoint's documentation, and check for the **correct format** or **values** to be specified as **parameters.**

## **Query Timeout** <a href="#query-timeout" id="query-timeout"></a>

> "Query Timeout occured. Please select a smaller result dataset"

This error occurs when you have sent a particularly large query that did not manage to be completed in time.

To resolve, consider selecting a smaller date/block range, though you may [**ping us**](/support/getting-help) if you think the issue may be performance related.


# Getting Help

{% hint style="danger" %}
Beware of **phishing attempts** and emails **impersonating the team** at Blocksscan <img src="https://3031522054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXu62EOofQp3ILGO91lm4%2Fuploads%2Fgit-blob-f65c0122a8b582ce1a2d39ff08f4343babedb45c%2FScreenshot%202024-07-10%20205042.png?alt=media" alt="" data-size="line"> Take note of our official support and communication channels as below.
{% endhint %}

The best way to reach out to us regarding general inquiries, advertising, updating token information, and API technical support.

Keep in mind that as a block explorer service, we **cannot cancel, refund or reverse transactions** as we do not process them.

If your issues are related to transactions, you may find helpful articles over at the [**BlocksScan Information Center.**](https://www.xdc.dev/blocksscan)

> Reach out to us via a [**support ticket.**](https://blocksscan.io/#support)

## <img src="https://3031522054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXu62EOofQp3ILGO91lm4%2Fuploads%2Fgit-blob-4127a04aa399a24138b645fa2cff63c59ec2d6de%2Flogo-twitter.png?alt=media" alt="" data-size="line"> Twitter <a href="#twitter" id="twitter"></a>

For general updates, new feature releases and community support, keep in touch with us via Twitter.

> Follow us on [**Twitter.**](https://twitter.com/blocksscan)

## <img src="https://3031522054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXu62EOofQp3ILGO91lm4%2Fuploads%2Fgit-blob-edd1f34c3e071b3766daef6f6f1b06882dfd8369%2Fdev%20logo.png?alt=media" alt="Blocksscan Blogs" data-size="line"> Blocksscan Blogs

For general updates, new features releases and community support, checks out our blogs.

> Check BlocksScan's [latest blogs](https://www.xdc.dev/blocksscan).


