# Welcome to WatchData Docs

Welcome to WatchData Documentation – Your infrastructure for building blockchain apps.

## WatchData overview

Use these docs to learn more about WatchData core products, and check out our API references.&#x20;

{% hint style="info" %}
[Get access WatchData platform!](https://dashboard.watchdata.io/login)
{% endhint %}

### What is WatchData?

WatchData is a platform for blockchain developers. Our toolkit is designed to make it easy to create and run blockchain applications. Our solution that aims at transforming raw and unstructured blockchain data into meaningful form to ease the integration of real-time blockchain data.

Currently we are supporting Ethereum (Mainnet + Goerli), Tron, Binance Smart Chain, Bitcoin and Polygon. We are interested in the development of our product and are ready to add the blockchains you need. Feel free to contact us <marketing@thewatch.io>

{% embed url="<https://youtu.be/iR4kGQ-NfQU>" %}
What is WatchData?
{% endembed %}

### Why use WatchData?

#### Built for blockchain developers

Whether you are using Ethereum for the first time or working on a solo project, WatchData is here to make developer's life much better.

#### Want to build a blockchain app?&#x20;

With the current blockchain landscape, maintaining self-hosted nodes is expensive, unreliable, and extremely time-consuming. WatchData gives you access to our custom API that is built for production, requires only 1-minute to integrate, and has 100% data correctness.

{% content-ref url="/pages/ho82Z0yty99VeASYqVRy" %}
[What products are suitable for our solutions](/welcome-to-watchdata-docs/what-products-are-suitable-for-our-solutions)
{% endcontent-ref %}

### WatchData Products and Features

WatchData developer tools and valuable insights guarantee simple and reliable API access to  blockchains.

We provide raw data from supported blockchains, you can find out more about each method in the Blockchain API section.

{% content-ref url="/pages/pwI6To1k6SKi5f3BRdhO" %}
[Blockchain API](/welcome-to-watchdata-docs/features/blockchain-api)
{% endcontent-ref %}

The requested data is presented in a structured format that is accurate, reliable, and of value, allowing developers to focus on the application. You can find out more about each method in the Powered API section.

{% content-ref url="/pages/0NcKdVAJ1tishOSisgwo" %}
[Powered API](/welcome-to-watchdata-docs/features/powered-api)
{% endcontent-ref %}

**Development for your requirements**

Development for your requirements (integration with the blockchain, data processing, node support) - we are interested in long-term and mutually beneficial cooperation, if you have ideas or suggestions, you can write to us at <marketing@thewatch.io>

### Expectations

* The docs assume that you have some programming knowledge.
* The docs are a work in progress and receive regular updates.
* If you find something confusing in the docs or have suggestions for improvements let us know  and send us an e-mail (<marketing@thewatch.io>)

### Get started!

Get set up to use the WatchData API in under 3 minutes. Learn how to get and use your API key, start making requests, and set up your application to use WatchData's endpoints!

{% content-ref url="/pages/uihAPTlLijn5xGO1GNiN" %}
[Quick start guide to WatchData!](/introduction/quick-start-guide-to-watchdata)
{% endcontent-ref %}

### Community&#x20;

Join us in social media to discuss your Web3 projects with other developers and to get all the fresh info on our service updates weekly, including published articles about WatchData.

{% content-ref url="/pages/6SRmSocI3DwiwOPlsdxt" %}
[Community](/resources/community)
{% endcontent-ref %}


# Features

Hey there, fellow developer. 👨🏻‍💻

:wave: Greetings from the team at WatchData! We're so thrilled to have you join us as we continue to develop and improve our product.

At WatchData, we aim to cover the whole market by providing access to nodes as well as adding a unique dataset that you can find in the Powered API section. Are you a developer who's inspired by innovation? So are we! We're always working on something new and exciting over here at WatchData—and we'd love for you to be a part of it.

<mark style="color:green;">**We look forward to your participation in our community!**</mark>

{% content-ref url="/pages/pwI6To1k6SKi5f3BRdhO" %}
[Blockchain API](/welcome-to-watchdata-docs/features/blockchain-api)
{% endcontent-ref %}

{% content-ref url="/pages/0NcKdVAJ1tishOSisgwo" %}
[Powered API](/welcome-to-watchdata-docs/features/powered-api)
{% endcontent-ref %}

{% content-ref url="/pages/fUgVMXmJLaNXnMrBgoGv" %}
[Price API](/welcome-to-watchdata-docs/features/price-api)
{% endcontent-ref %}


# Blockchain API

With WatchData’s API, you can get to Raw blockchain data: balances, transactions, blocks, tokens transfers, logs, and others.&#x20;

**Interact with multiple blockchains in a unified way!**

## Advantages of our Blockchain API

### ✅ No need to run your own node

Spare yourself from development costs and associated expenses. Call most JSON-RPC methods via our API in the same way as sending to an own node.

### ✅ Data correctness

You can't afford to lose data. And you certainly can't afford to have a single point of failure. <mark style="color:purple;">**This is why**</mark> WatchData Blockchain API is perfect for you: its proprietary coordinator service ensures that your data is always correct, real-time, and in sync.

### ✅ Fast & reliable

Gain instant access to blocks, transactions, and contracts using raw data. <mark style="color:purple;">**Get advantage**</mark> of fast access for blocks, transactions and contracts using the raw data.

{% content-ref url="/pages/VmzfknWbaL5v4RCzgNjk" %}
[Ethereum API](/blockchain-apis/ethereum-api)
{% endcontent-ref %}

{% content-ref url="/pages/SW0bNYJDwJl3eZ2zn90F" %}
[Bitcoin API](/blockchain-apis/bitcoin-api)
{% endcontent-ref %}

{% content-ref url="/pages/b3VNAzw8p04wLAeNFlrm" %}
[Binance Smart Chain API](/blockchain-apis/binance-smart-chain-api)
{% endcontent-ref %}

{% content-ref url="/pages/wPyHAf0OYFNxqpS3FeEU" %}
[Tron API](/blockchain-apis/tron-api)
{% endcontent-ref %}


# Powered API

## Powered API overview

We want to make your life easier. That's why we're announcing the release of our growing suite of Powered API methods. No more complex and costly blockchain requests! You'll be able to get all the data you need for transactions and token information, in fewer requests.

What does this mean? <mark style="color:purple;">**More time**</mark>, <mark style="color:green;">**less money spent**</mark> creating apps that are better and more advanced than ever before. We know how important it is for developers like you to build upon a stable foundation — you want to be able to focus on innovating new features and functionalities, not reinventing the wheel every time you start a new project.

### Get blockchain data both fast and effectively!  :sunglasses:

The requested data is presented in a structured format that is accurate, reliable, and of value, allowing developers to focus on the application. You can find out more about each method in the Structured data section.

{% content-ref url="/pages/QWBDkfBGhSysvxQIeN8u" %}
[Transfers](/powered-api/transfers)
{% endcontent-ref %}

{% content-ref url="/pages/2hiyxNDF7GvFYS2lb6M9" %}
[Parity](/powered-api/parity)
{% endcontent-ref %}

{% content-ref url="/pages/6K5VuOTpWesRxFTd9rk9" %}
[Trace](/powered-api/trace)
{% endcontent-ref %}

{% content-ref url="/pages/y5zIS16TAUsA79lYH42h" %}
[Blocks](/powered-api/blocks)
{% endcontent-ref %}

{% content-ref url="/pages/vDvRDMtxyvFkSN2OzVVy" %}
[Token API](/powered-api/token-api)
{% endcontent-ref %}

{% content-ref url="/pages/wucVsWZEsg2HVgtg0FVd" %}
[Stats](/powered-api/stats)
{% endcontent-ref %}


# Price API

## WatchData Price API

Hey dApp developers! We've got a new API for you!

But before we get to the exciting part, let's talk about why we built this in the first place. When you're creating a decentralized app (dApp), the last thing you want is to be stuck using an unreliable token price. That's why we at WatchData are proud to announce our new Price API—the first of its kind that lets you get accurate token prices from the blockchain.

### WatchData Price API advantage

Our Price API is easy to use and powerful, giving dApp developers access to accurate token prices without having to deal with the hassle of managing their own infrastructure. We make it easy for developers to get what they need so they can focus on what matters most: building great dApps that change the world! And don't worry — our Price API has everything you need! You can check the list of tickers for which you can get prices through the our endpoints.

{% content-ref url="/pages/KYY9BBJbKJ5rRlYDPKIM" %}
[All tickers](/price-api/price-api/all-tickers)
{% endcontent-ref %}

{% content-ref url="/pages/1CaZXreGzlssqbjZwbyP" %}
[Current price](/price-api/price-api/current-price)
{% endcontent-ref %}


# What products are suitable for our solutions

Where can you use our data?

## Products & solutions&#x20;

### Analytics Services

* You can get any historical data on the basis of which you can build analytics for decision making.

### Portfolio Tracking Services

* Collect blockchain data in your application and track users' token balances, transactions, and protocol positions in real time.

### For Wallets

* You can receive all transfers to client addresses (including NFT - transfers, ERC-20 and internal transfers) with one request, instead of checking all blocks of the blockchain. Including for any range of blocks.

### For Investors

* Make better investment decisions with WatchData insights & analytics dashboards and price trend notifications.

### For DeFi Products

* Get all transactions to an address with one request;
* Get all addresses that interacted with your smart contract;
* Get all the owners of your token.

### Different dApps

* Develop applications for any needs, we are ready to take on the correctness of the data so that everything works perfectly.


# Quick start guide to WatchData!

Quick start guide to WatchData! Learn how to create a key, make your first request and get to building!

## Steps to get started with WatchData

1. :globe\_with\_meridians: **Visit our Website** -> <https://www.watchdata.io/>&#x20;
2. :key: **Sign Up** -> <https://dashboard.watchdata.io/login>
3. :gear: **Create an API key;**
4. :tada: **Make a request.**

### Hi, and welcome to WatchData! <a href="#hi-welcome-to-watchdata" id="hi-welcome-to-watchdata"></a>

If you've never heard of us before, WatchData gives developers and enterprises easy and reliable access to Web3 tools and infrastructure.\
In this article, we will tell you how to get started with WatchData so you can connect to the Ethereum blockchain and get started building awesome applications.

**We'll take a look at:**

* Registering an account
* Creating an API Key
* Creating API queries via Postman

<mark style="color:purple;">**Watch this video, which describes the quick process of registering, getting an API KEY and using it**</mark>

{% embed url="<https://www.youtube.com/watch?v=mYcdJTse1CA>" %}

For a more detailed description, read the step-by-step guide

### Step One: Register <a href="#step-one-register" id="step-one-register"></a>

The first thing you need to do is go to [WatchData.io](https://www.watchdata.io/) and create an account. The only information needed to register your account is your email address.

First of all, you need to register.

<figure><img src="/files/4kuDkmfnwoaH6gRL5aJO" alt=""><figcaption></figcaption></figure>

Go to the [Sign Up](https://dashboard.watchdata.io/signup) page and enter your email address.

![](/files/AU4O8RfpZZeHhQJTGT43)

Go to your email client and click on the link in the email to confirm your registration.

![](/files/zf91ULGQ6oBUSaAqIZvk)

Click the button or the link and then go back to your original tab. You'll be automatically redirected to your personal [dashboard](https://dashboard.watchdata.io/).

### Step Two: Create an API Key <a href="#step-two-create-an-api-key" id="step-two-create-an-api-key"></a>

To create an API key, you need to do the following steps:\
On the [Dashboard.watchdata.io](https://dashboard.watchdata.io/login) tab, click Create API key.

![](/files/YcobgYRa91l5jkHJkeCx)

A pop up will appear in front of you, in which you need to fill in the fields&#x20;

* Assign a name to your application&#x20;
* Select the chain in which you plan to work

![](/files/YIVLcpQ66Ctc56wDp3nk)

After you have completed these steps, click Сreate API key button

Congratulations, you were able to create your first API key!! Nice job 😎

![](/files/xNHVPBrXj34No7AsvoGh)

### Step Three: Create API queries via Postman <a href="#step-three-create-api-queries-via-postman" id="step-three-create-api-queries-via-postman"></a>

In the example, we'll show step-by-step instructions for sending some sample queries via Postman. In addition to Postman, you can use data from the WatchData API in any application, using post and curl queries.

First, after you get the API key you have to connect to the blockchain.

For this you can copy your API key, or copy the HTTP Link at once, which will speed up your work several times!

![](/files/ZoZVfH7LrlTzWp378SIP)

The URL of the previously selected chain + your API Key is automatically substituted in the HTTP Link.&#x20;

{% hint style="info" %}
Note that each network requires a different URL
{% endhint %}

Go to [Postman](https://www.postman.com/) and create a new request.

![](/files/TUPhAR2AqWxMxDWRHkev)

All you need to do is insert the previously generated link

![](/files/Ml7tnkB8k7JRJpBomND6)

Now everything is ready to send a request and receive data from the API.\
For the example, we'll look at the [eth\_blockNumber](https://docs.watchdata.io/blockchain-apis/ethereum-api/eth_blocknumber) method first.\
Just copy the body of the example POST request.

![](/files/YX60N5jTztEgmfdSfCjZ)

In Postman select the Body tab, set Raw and JSON on it, insert the request, then click send.

![](/files/PQcEDfUKvCjNILdNKRRN)

Send a request and then we can see the answer at the bottom of the page.

![](/files/hHPywRBiuD285occCwyz)

A similar example of the request sent and response received for the [eth\_getBlockByNumber](https://docs.watchdata.io/blockchain-apis/ethereum-api/eth_getblockbynumber) method. You can work in exactly the same way with any of the methods in our documentation.

![](/files/FyNjjfDgXJb1Kw51gvrt)

You now know how to send requests and receive data from WatchData API 😎

In addition, the WatchData API can be used by being integrated into web3 SDK’s. Read an example of [**how to use the WatchData API to connect to the Ethereum network using Python through Web3.py**](https://coinsbench.com/how-to-connect-to-the-ethereum-network-using-web3-py-7fe451464ad0)**,** [**How to connect to the Ethereum network using Web3.js**](https://coinsbench.com/how-to-connect-to-the-ethereum-network-using-web3-js-b76ed55efdea)

To learn more about SDK libraries :point\_right: [Click HERE](/web3/web3-sdk)

If you have any questions on using the WatchData API you can always get help from the technical support via online chat on the website or in [our discord](https://discord.com/invite/TZRJbZ6bdn).


# Why Use WatchData?

WatchData provides a comprehensive developer platform for your dApps on the Ethereum and others popular Blockchains.

## Access the full potential of Web3 power in one place

### Developing a dApp can be tough 😤

It's a common problem for companies and teams of all sizes: the best engineers spend their days on infrastructure, not applications and features. We've been there, and know how frustrating this can be. This is why we set out to build a platform that would allow teams to focus on building the applications, services, and products they cared about - without getting bogged down in infrastructure management.

❌ You have to set up nodes;

❌ You need to make sure they're secure;

❌ You have to figure out how to use them in your development;

It's a lot of work, especially if you're new to blockchain development.&#x20;

But with WatchData, we make it easy. Our <mark style="color:red;">**Powered API**</mark> gives you access to our custom nodes that are built for production and provide 100% data correctness. And it only takes 1-minute to integrate! 😎

🛑 STOP wasting your time and money!&#x20;

#### Try our products:

✅ WatchData Node API - The fastest access to multiple blockchains

✅ Powered API - Get the keys to more data. More data, less actions

### We love our clients 🥰

In half a year WatchData has already been able to help many businesses and innovative startups add value with cutting-edge solutions. Our clients range from various crypto startups, payment services, wallets to socially important projects, quantum funds and institutions

* <mark style="color:green;">100%</mark> Data Correctness
* More <mark style="color:green;">than</mark> <mark style="color:green;">300</mark> <mark style="color:green;">customers</mark> have been satisfied with WatchData solutions that have brought them great business opportunities and helped them avoid potential risks.
* <mark style="color:green;">30%</mark> faster product development

### Put your trust in us

Register - [**here**](https://dashboard.watchdata.io/login) &#x20;

Api references - [**here**](/powered-api/transfers)&#x20;


# Supported chains

List of chains supported by WatchData

## List of supported chains

<table><thead><tr><th width="202.41783963432195">Blockchain</th><th width="150">Chain</th><th>URL</th></tr></thead><tbody><tr><td><a href="/pages/wPyHAf0OYFNxqpS3FeEU">Tron</a></td><td>Mainnet</td><td>https://tron.api.watchdata.io/</td></tr><tr><td><a href="/pages/VmzfknWbaL5v4RCzgNjk">Ethereum</a></td><td>Mainnet</td><td>https://ethereum.api.watchdata.io/node/jsonrpc</td></tr><tr><td><a href="/pages/VmzfknWbaL5v4RCzgNjk">Ethereum</a> </td><td>Ropsten (depricated)</td><td>https://ropsten.api.watchdata.io/node/jsonrpc</td></tr><tr><td><a href="/pages/VmzfknWbaL5v4RCzgNjk">Ethereum</a></td><td>Görli</td><td>https://goerli.api.watchdata.io/node/jsonrpc</td></tr><tr><td><a href="/pages/SW0bNYJDwJl3eZ2zn90F">Bitcoin</a></td><td>Mainnet</td><td>https://btc.api.watchdata.io/node/jsonrpc</td></tr><tr><td><a href="/pages/SW0bNYJDwJl3eZ2zn90F">Bitcoin</a></td><td>Testnet</td><td>https://btc-testnet.api.watchdata.io/node/jsonprc</td></tr><tr><td><a href="/pages/b3VNAzw8p04wLAeNFlrm">Binance Smart Chain</a></td><td>Mainnet</td><td>https://bsc.api.watchdata.io/node/jsonrpc</td></tr><tr><td><a href="/pages/xIPE9JG9sLclEDCd7FH9">Polygon</a></td><td>Mainnet</td><td>https://polygon.api.watchdata.io/node/jsonrpc</td></tr></tbody></table>


# Error Reference

Learn about the standard JSON-RPC error codes.

## JSON RPC Standard errors <a href="#json-rpc-standard-errors" id="json-rpc-standard-errors"></a>

|                  |                                                                    |                                                                                                       |
| ---------------- | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| Code             | Possible Return message                                            | Description                                                                                           |
| -32700           | Parse error                                                        | Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text. |
| -32600           | Invalid Request                                                    | The JSON sent is not a valid Request object.                                                          |
| -32601           | Method not found                                                   | The method does not exist / is not available.                                                         |
| -32602           | Invalid params                                                     | Invalid method parameter(s).                                                                          |
| -32603           | Internal error                                                     | Internal JSON-RPC error.                                                                              |
| -32000 to -32099 | `Server error`. Reserved for implementation-defined server-errors. |                                                                                                       |

<br>


# Change Log (update)

Records of all notable changes made to WatchData.

## Change Log

### ⚡️27.07.2022

* New [Dashboard interface](https://dashboard.watchdata.io/home)

![](/files/aueRxEFSKYzKBNMZ4M5p)

* Bug fix with Transfers (Powered API).
* [eth\_getTransactionReceipt](/blockchain-apis/ethereum-api/eth_gettransactionreceipt) now gives one object, not a list.

### 17.07.2022

* [Polygon Blochchain API](/blockchain-apis/polygon-api) - Polygon Blockchain enables access to most commonly used Polygon methods.
* Powered API support for Polygon Mainnet
* UI improvements

### 21.06.2022

* Product improvements. (RPS increase)
* Bug fixes (no possibility to choose a blockchain when creating a key)

### 05.06.2022

* [Binance Smart Chain API](/blockchain-apis/binance-smart-chain-api) - BSC Blockchain enables access to most commonly used BSC methods.
* Powered API support for Binance Smart Chain&#x20;

### 23.05.2022

* [Bitcoin API](/blockchain-apis/bitcoin-api) - Bitcoin Blockchain enables access to most commonly used BTC methods.
* Price API improvements&#x20;
* [watch\_getTokenMetadata](/powered-api/token-api/watch_gettokenmetadata) - Check all the necessary information about tokens&#x20;

### 06.05.2022

* Added [Price API](/price-api/price-api). Now you can get lists of currencies and rates to integrate into your applications.
* See the [guides](/tutorials-and-guides/watchdata-price-api-and-how-it-works) how to interact with Price API

### 20.04.2022

* Improved interface. Now you can select the necessary blockchain, name it and get HTTP Link directly from your Dashboard
* Improved stability

### 15.04.2022

* [Tron API](/blockchain-apis/tron-api) - Tron Blockchain enables access to most commonly used Tron methods. It's possible to generate TRON account, send TRX, TRC10 and TRC20 assets. It's also possible to generate custom TRC10 or TRC20 tokens using API.
* [New Pricing model ](https://www.watchdata.io/pricing)
* [MetaMask support](/tutorials-and-guides/how-to-guides/how-do-i-add-watchdata-to-metamask)

### 22.03.2022

* For Ethereum mainnet and Ropsten API added ability to communicate directly with a node&#x20;

Listed endpoints

* [eth\_call](/blockchain-apis/ethereum-api/eth_call)
* [eth\_chainId](/blockchain-apis/ethereum-api/eth_chainid)
* [eth\_estimateGas](/blockchain-apis/ethereum-api/eth_estimategas#parameters)
* [eth\_gasPrice](/blockchain-apis/ethereum-api/eth_gasprice)
* [eth\_getBalance](/blockchain-apis/ethereum-api/eth_getbalance)
* [eth\_getCode](/blockchain-apis/ethereum-api/eth_getcode)
* [eth\_getStorageAt](/blockchain-apis/ethereum-api/eth_getstorageat)
* [eth\_sendRawTransaction](/blockchain-apis/ethereum-api/eth_sendrawtransaction)

Improvements

* A link to the roadmap has been added to the website, personal dashboard and documentation
* Improved methods for obtaining transfers, added token metadata, fee
  * [watch\_getTransfers](/powered-api/transfers/watch_gettransfers)
  * [watch\_getTransfersByAddress](/powered-api/transfers/watch_gettransfersbyaddress)

### 09.03.2022

Listed endpoints

* [watch\_getBlockNumberByTimestamp](/powered-api/blocks/watch_getblocknumberbytimestamp)
* [watch\_getTransfersByAddress](/powered-api/transfers/watch_gettransfersbyaddress)

Improvements

* Added option to use api\_key via query parameter
  * Web3 library support
  * Metamask support
* [watch\_getTransfers](/powered-api/transfers/watch_gettransfers) method became watch\_getTransferByAddress, and watch\_getTrasnfers became the general method without the address filter (all parameters are optional)

### 18.02.2022

**Listed endpoints:**&#x20;

* [watch\_getTokenBalances](/powered-api/token-api/watch_gettokenbalances)
* [watch\_getStatsByDay](/powered-api/stats/watch_getstatsbyday)
* [eth\_getLogs](/blockchain-apis/ethereum-api/eth_getlogs)

**Supported chains:**

* [Ropsten API](/blockchain-apis/ethereum-api)


# Transfers

The Transfers API allows you get historical transactions for any address

{% content-ref url="/pages/wDzMI9BTmwV0EEgmMbxA" %}
[watch\_getTransfers](/powered-api/transfers/watch_gettransfers)
{% endcontent-ref %}

{% content-ref url="/pages/GYBbkBs1opz1ReBK8heb" %}
[watch\_getTransfersByAddress](/powered-api/transfers/watch_gettransfersbyaddress)
{% endcontent-ref %}


# watch\_getTransfers

This method allows you to receive transfers by certain block parameters, smart contracts or transfer types: trx, erc20, erc721. This method can be useful to watch all transfers for certain tokens or certain blocks

**Parameters**

Object - An object with the following fields&#x20;

1. `fromBlock` (optional): `QUANTITY` - the minimum block number from where to get the transactions
2. `toBlock` (optional): `QUANTITY` - the maximum block number from where to get the transactions.
3. `transferType` (optional): `DATA` - transfer type `(trx/erc20/erc721)`
4. `contractAddresses`(optional): `DATA`, 20 Bytes -  contract address (i.e. `0x1a2b3x`) or array of contract addresses
5. `offset`(optional):  `QUANTITY` - offset.
6. `limit`(optional): `QUANTITY` - limit &#x20;

```
"params": [
        {
            "contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
            "fromBlock": 14046400,
            "toBlock": 14049300,
            "offset": 1,
            "limit": 10
        }
    ]
```

**Returns**

* `Array` - The list of all the transfers&#x20;
* Object schema:

1. blockNumber: : `QUANTITY` - the block number. null when its pending block.
2. blockTimestamp: `DATETIME` - the UTC DATETIME for when the block was collated.
3. transactionHash: `DATA`, 32 Bytes - hash of the transaction.
4. transactionIndex: `QUANTITY` - index of transactions in block&#x20;
5. logIndex: `QUANTITY` - index of transaction logs
6. contractAddress: `DATA`, 20 Bytes - contract address (i.e. `0x1a2b3x`)
7. transferType: `DATA`, transfer type `(trx/erc20/erc721)`
8. from: `DATA`, 20 Bytes - address of the sender.
9. to: `DATA`, 20 Bytes - address of the receiver. null when it's a contract creation transaction.
10. value: `QUANTITY` - value transferred.
11. fee: `QUANTITY`- fee of the transaction.
12. asset: `DATA`- `ETH` or the token's symbol. `null` if not defined in the contract and not available from our sources.
13. decimals: `QUANTITY` - contract decimal. `null` if not defined in the contract and not available from other sources.
14. error (optional):`BOOLEAN` - True, if the transaction was made with an error

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"id": 1, "method": "watch_getTransfers", "jsonrpc": "2.0", "params": ["contractAddresses": "0xdac17f958d2ee523a2206206994597c13d831ec7","fromBlock": 14046400,"toBlock": 14049300,"offset": 1,"limit": 10}]}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "id": 1,
    "method": "watch_getTransfers",
    "jsonrpc": "2.0",
    "params": [
        {
            "contractAddresses": "0xdac17f958d2ee523a2206206994597c13d831ec7",
            "fromBlock": 14046400,
            "toBlock": 14049300,
            "offset": 1,
            "limit": 10
        }
    ]
}
```

{% endtab %}
{% endtabs %}

**Response**

```json
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "blockNumber": 14046400,
            "blockTimestamp": "2022-01-21T03:01:52",
            "transactionHash": "0x2d26ccfaa37f5100c920c2991959df0f486baf4d72a73777b99286ceca133f5f",
            "transactionIndex": 11,
            "logIndex": 3,
            "contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
            "transferType": "erc20transfer",
            "from": "0x56eddb7aa87536c09ccc2793473599fd21a8b17f",
            "to": "0xf450719d9a03955d24b73ed0d8b28be09b5cec4d",
            "value": 396400000,
            "fee": 12072919000000000,
            "asset": "USDT",
            "decimals": 6
        }
    ]
}
```


# watch\_getTransfersByAddress

This method is needed to watch all transfers to certain addresses and other filters. It can be useful to receive historical wallet transfers

**Parameters**

Object - An object with the following fields&#x20;

1. `addresses` : `DATA`, 20 Bytes - a user address (i.e. `0x1a2b3x...`) or array of user addresses.&#x20;
2. `fromBlock` (optional): `QUANTITY` - the minimum block number from where to get the transactions
3. `toBlock` (optional): `QUANTITY` - the maximum block number from where to get the transactions.
4. `transferType` (optional): `DATA` - transfer type `(trx/erc20/erc721)`
5. `transferDirection` (optional):  `DATA` - transfer direction`(from/to)`
6. `contractAddresses`(optional): `DATA`, 20 Bytes -  contract address (i.e. `0x1a2b3x`) or list of contract addresses.
7. `offset`(optional):  `QUANTITY` - offset.
8. `limit`(optional): `QUANTITY` - limit &#x20;

```
"params": [
        {
            "addresses": "0x123f96bc8edcb73bd5b8612c1e5203f90d4628a4",
            "contractAddresses": "0xdac17f958d2ee523a2206206994597c13d831ec7",
            "transferDirection": "to",
            "fromBlock": 14046400,
            "toBlock": 14049300,
            "offset": 1,
            "limit": 10
        }
    ]
```

**Returns**

* `Array` - The list of all the transfers&#x20;
* Object schema:

1. blockNumber: : `QUANTITY` - the block number. null when its pending block.
2. blockTimestamp: `DATETIME` - the UTC DATETIME for when the block was collated.
3. transactionHash: `DATA`, 32 Bytes - hash of the transaction.
4. transactionIndex: `QUANTITY` - index of transactions in block&#x20;
5. logIndex: `QUANTITY` - index of transaction logs
6. contractAddress: `DATA`, 20 Bytes - contract address (i.e. `0x1a2b3x`)
7. transferType: `DATA`, transfer type `(trx/erc20/erc721)`
8. from: `DATA`, 20 Bytes - address of the sender.
9. to: `DATA`, 20 Bytes - address of the receiver. null when it's a contract creation transaction.
10. value: `QUANTITY` - value transferred.
11. fee: `QUANTITY`- fee of the transaction.
12. asset: `DATA`- `ETH` or the token's symbol. `null` if not defined in the contract and not available from our sources.
13. decimals: `QUANTITY` - contract decimal. `null` if not defined in the contract and not available from other sources.
14. error (optional):`BOOLEAN` - True, if the transaction was made with an error

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"id": 1, "method": "watch_getTransfersByAddress", "jsonrpc": "2.0", "params": [{"addresses": "0x123f96bc8edcb73bd5b8612c1e5203f90d4628a4","contractAddresses": "0xdac17f958d2ee523a2206206994597c13d831ec7","transferDirection": "to","fromBlock": 14046400,"toBlock": 14049300,"offset": 1,"limit": 10}]}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "id": 1,
    "method": "watch_getTransfersByAddress",
    "jsonrpc": "2.0",
    "params": [
        {
            "addresses": "0x123f96bc8edcb73bd5b8612c1e5203f90d4628a4",
            "contractAddresses": "0xdac17f958d2ee523a2206206994597c13d831ec7",
            "transferDirection": "to",
            "fromBlock": 14046400,
            "toBlock": 14049300,
            "offset": 1,
            "limit": 10
        }
    ]
}
```

{% endtab %}
{% endtabs %}

**Response**

```json
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "blockNumber": 14049260,
            "blockTimestamp": "2022-01-21T13:47:35",
            "transactionHash": "0x8a1258d3b31fb5ea1d51f65542f1f436e24de8eeb36726e8075e286fea6154b7",
            "transactionIndex": 128,
            "logIndex": 221,
            "contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
            "transferType": "erc20transfer",
            "from": "0x2819c144d5946404c0516b6f817a960db37d4929",
            "to": "0x123f96bc8edcb73bd5b8612c1e5203f90d4628a4",
            "value": 2165000000,
            "fee": 8550565140309632,
            "asset": "USDT",
            "decimals": 6
        }
    ]
}
```


# Parity

Access to OpenEthereum's Parity API which exposes additional Parity-only methods.

{% content-ref url="/pages/7DSxl4E82rKa7i6agtr3" %}
[parity\_getBlockReceipts](/powered-api/parity/parity_getblockreceipts)
{% endcontent-ref %}


# parity\_getBlockReceipts

Access to OpenEthereum's Parity API which exposes additional Parity-only methods.

**Parameters**

1. `Quantity` or `Tag` - integer of a block number, or the string `'earliest'`, `'latest'` or `'pending'`, as in the default block parameter.

```
params: ["0x8D2B29"]
```

**Returns**

* `Array` - The list of all the transaction’s receipts of the given block

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key\
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0", "id":1, "method":"parity_getBlockReceipts","params":["0x8D2B29"]}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"parity_getBlockReceipts",
    "params":["0x2ed119"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Response**

```json
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "blockHash": "0xb1bafee9dceb78e91ba7fdf65abd75daccc4e2083dce83b425c1fcb427600ab9",
            "blockNumber": "0x8d2b29",
            "contractAddress": null,
            "cumulativeGasUsed": "0x5208",
            "from": "0x82acfdb4ce53d37da54c40ac5799c57d81072cfd",
            "gasUsed": "0x5208",
            "logs": [],
            "status": "0x1",
            "effectiveGasPrice": "0xba43b7400",
            "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
            "to": "0x44f14099b8b9c60515e83a0cb1a85e14982bb091",
            "transactionHash": "0xb81841fc6f980341bbb1f02bcaa195f0eb8eea1454c8dde054b4cc773a3ed0af",
            "transactionIndex": "0x0"
        },
        {
            "blockHash": "0xb1bafee9dceb78e91ba7fdf65abd75daccc4e2083dce83b425c1fcb427600ab9",
            "blockNumber": "0x8d2b29",
            "contractAddress": null,
            "cumulativeGasUsed": "0xa410",
            "from": "0x9807f06dbbc43777c325405c0608eb840c38d64c",
            "gasUsed": "0x5208",
            "logs": [],
            "status": "0x1",
            "effectiveGasPrice": "0x98bca5a00",
            "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
            "to": "0xecd7185f453c364b42e201dcddd8e9fb80c958eb",
            "transactionHash": "0xa66a19d18eb998b94cd9dc6a9356be7c7e56c7dfcac0b3773493ce9d7ef7e513",
            "transactionIndex": "0x1"
        },
    ]
}    
```


# Trace

Deeper insight into transaction processing.

Parity Tracing API methods give users access to the most detailed information about on-chain activity. For more information about use, see the [Parity/Open Ethereum Trace API Documentation](https://openethereum.github.io/JSONRPC-trace-module).\
\
These API methods allow you to get a full *externality* trace on any transaction executed throughout the Ethereum chain. Unlike the log filtering API, you are able to search and filter based only upon address information. Information returned includes the execution of all `CREATE,` `SUICIDE` and all variants of `CALL` together with input data, output data, gas usage, amount transferred and the success status of each individual action.

{% content-ref url="/pages/kbsn7UCshQjxZZPCi0Ig" %}
[trace\_transaction](/powered-api/trace/trace_transaction)
{% endcontent-ref %}

{% content-ref url="/pages/xCKbm277josZKbwPLBg6" %}
[trace\_block](/powered-api/trace/trace_block)
{% endcontent-ref %}


# trace\_transaction

Returns all traces of given transaction.

#### **Parameters**

1. `Hash` - Transaction hash

```bash
params: ["0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3"]
```

#### **Returns**

* `Array` - Traces of given transaction

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"method":"trace_transaction","params":["0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3"],"id":1,"jsonrpc":"2.0"}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"trace_transaction",
    "params":["0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "action": {
                "author": "0xea674fdde714fd979de3edf0f56aa9716b898ec8",
                "rewardType": "block",
                "value": "0x4563918244f40000"
            },
            "result": null,
            "subtraces": 0,
            "traceAddress": [],
            "transactionHash": null,
            "transactionPosition": null,
            "type": "reward",
            "blockHash": "0x7eb25504e4c202cf3d62fd585d3e238f592c780cca82dacb2ed3cb5b38883add",
            "blockNumber": 3068185
        },
        {
            "action": {
                "callType": "call",
                "from": "0xaa7b131dc60b80d3cf5e59b5a21a666aa039c951",
                "gas": "0x0",
                "input": "0x",
                "to": "0xd40aba8166a212d6892125f079c33e6f5ca19814",
                "value": "0x4768d7effc3fbe"
            },
            "result": {
                "gasUsed": "0x0",
                "output": "0x"
            },
            "subtraces": 0,
            "traceAddress": [],
            "transactionHash": "0x07da28d752aba3b9dd7060005e554719c6205c8a3aea358599fc9b245c52f1f6",
            "transactionPosition": 0,
            "type": "call",
            "blockHash": "0x7eb25504e4c202cf3d62fd585d3e238f592c780cca82dacb2ed3cb5b38883add",
            "blockNumber": 3068185
        },
        {
            "action": {
                "callType": "call",
                "from": "0x4f11ba23bb526c0486d83c6a8f18f632f3fc172a",
                "gas": "0x0",
                "input": "0x",
                "to": "0x7ed1e469fcb3ee19c0366d829e291451be638e59",
                "value": "0x446cde325fbfbe"
            },
            "result": {
                "gasUsed": "0x0",
                "output": "0x"
            },
            "subtraces": 0,
            "traceAddress": [],
            "transactionHash": "0x056f11efb5da4ff7cf8523cfcef08393e5dd2ff3ab3223e4324426d285d7ae92",
            "transactionPosition": 1,
            "type": "call",
            "blockHash": "0x7eb25504e4c202cf3d62fd585d3e238f592c780cca82dacb2ed3cb5b38883add",
            "blockNumber": 3068185
        },
    ]
}
```


# trace\_block

Returns traces created at given block.

**Parameters**

1. `Quantity` or `Tag` - Integer of a block number, or the string `'earliest'`, `'latest'` or `'pending'`.

```bash
params: [
  "0x2ed119" // 3068185
]
```

**Returns**

* `Array` - Block traces.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"method":"trace_block","params":["0x2ed119"],"id":1,"jsonrpc":"2.0"}' 
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"trace_block",
    "params":["0x2ed119"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Response**

```javascript
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "action": {
                "author": "0xea674fdde714fd979de3edf0f56aa9716b898ec8",
                "rewardType": "block",
                "value": "0x4563918244f40000"
            },
            "result": null,
            "subtraces": 0,
            "traceAddress": [],
            "transactionHash": null,
            "transactionPosition": null,
            "type": "reward",
            "blockHash": "0x7eb25504e4c202cf3d62fd585d3e238f592c780cca82dacb2ed3cb5b38883add",
            "blockNumber": 3068185
        },
        {
            "action": {
                "callType": "call",
                "from": "0xaa7b131dc60b80d3cf5e59b5a21a666aa039c951",
                "gas": "0x0",
                "input": "0x",
                "to": "0xd40aba8166a212d6892125f079c33e6f5ca19814",
                "value": "0x4768d7effc3fbe"
            },
            "result": {
                "gasUsed": "0x0",
                "output": "0x"
            },
            "subtraces": 0,
            "traceAddress": [],
            "transactionHash": "0x07da28d752aba3b9dd7060005e554719c6205c8a3aea358599fc9b245c52f1f6",
            "transactionPosition": 0,
            "type": "call",
            "blockHash": "0x7eb25504e4c202cf3d62fd585d3e238f592c780cca82dacb2ed3cb5b38883add",
            "blockNumber": 3068185
        },
        {
            "action": {
                "callType": "call",
                "from": "0x4f11ba23bb526c0486d83c6a8f18f632f3fc172a",
                "gas": "0x0",
                "input": "0x",
                "to": "0x7ed1e469fcb3ee19c0366d829e291451be638e59",
                "value": "0x446cde325fbfbe"
            },
            "result": {
                "gasUsed": "0x0",
                "output": "0x"
            },
            "subtraces": 0,
            "traceAddress": [],
            "transactionHash": "0x056f11efb5da4ff7cf8523cfcef08393e5dd2ff3ab3223e4324426d285d7ae92",
            "transactionPosition": 1,
            "type": "call",
            "blockHash": "0x7eb25504e4c202cf3d62fd585d3e238f592c780cca82dacb2ed3cb5b38883add",
            "blockNumber": 3068185
        },
    ]
}
```

##


# Blocks

The Blocks API allows you to easily get blocks information.

Blocks api allows you to get information about blocks that are beyond the capabilities of the node

{% content-ref url="/pages/NBUU9oMubYJiEpUK827G" %}
[watch\_getBlockNumberByTimestamp](/powered-api/blocks/watch_getblocknumberbytimestamp)
{% endcontent-ref %}


# watch\_getBlockNumberByTimestamp

**Parameters**

* `QUANTITY` - the unix timestamp

{% hint style="info" %}
To convert the unix timestamp you can use <https://www.epochconverter.com/>
{% endhint %}

```javascript
params: [
    1644419586,
]
```

**Returns**

QUANTITY - number of block

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"watch_getBlockNumberByTimestamp","params":[1644419586"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"watch_getBlockNumberByTimestamp",
    "params":[1645170803],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "id": 0,
    "jsonrpc": "2.0",
    "result": 14172626
}
```


# Token API

The Token API allows you to easily get token information.

Token API makes it easy to get information about tokens using a minimum number of requests

{% content-ref url="/pages/346Mu91TBQi24tgjW1Cc" %}
[watch\_getTokenBalances](/powered-api/token-api/watch_gettokenbalances)
{% endcontent-ref %}


# watch\_getTokenBalances

Returns token balances for a specific address given a list of contracts.

{% hint style="warning" %}
This method returns hex encoded values in the `tokenBalance` fields.
{% endhint %}

#### Parameters

1. `DATA`, 20 Bytes - The address for which token balances will be checked
2. One of:
   1. `Array` - A list of contract addresses
   2. The `String`"DEFAULT\_TOKENS" - denotes a query for the top 100 tokens by 24 hour volume

#### Returns

`Object` - An object with the following fields:

* `address`: `DATA`, 20 Bytes - The address for which token balances were checked
* `token_balances`: `Array` - returns an array of token balance objects. Each object contains:
  * `contractAddress`
  * `tokenBalance`
  * `error`
  * One of `tokenBalance` or `error` will be null.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"watch_getTokenBalances","params": ["0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be", ["0x607f4c5bb672230e8672085532f7e901544a7375", "0x618e75ac90b12c6049ba3b27f5d5f8651b0037f6", "0x63b992e6246d88f07fc35a056d2c365e6d441a3d", "0x6467882316dc6e206feef05fba6deaa69277f155", "0x647f274b3a7248d6cf51b35f08e7e7fd6edfb271"]],"id":"42"}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"watch_getTokenBalances",
    "params":["0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be", ["0x607f4c5bb672230e8672085532f7e901544a7375", "0x618e75ac90b12c6049ba3b27f5d5f8651b0037f6", "0x63b992e6246d88f07fc35a056d2c365e6d441a3d", "0x6467882316dc6e206feef05fba6deaa69277f155", "0x647f274b3a7248d6cf51b35f08e7e7fd6edfb271"]],
    "id":42
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
  "jsonrpc": "2.0",
  "id": 42,
  "result": {
    "address": "0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be",
    "token_balances": [
      {
        "contractAddress": "0x607f4c5bb672230e8672085532f7e901544a7375",
        "tokenBalance": "0x00000000000000000000000000000000000000000000000000003c005f81ab00",
        "error": null
      }
    ]
  }
}
```


# watch\_getTokenMetadata

This endpoint returns all the data about the token

#### Parameters

1. `contractaddress`: DATA, 20 Bytes - smart contract address

#### Returns

`Object` - An object with the following fields:

* `contractAddress`: `DATA`, 20 Bytes - smart contract address for which the information was requested
* `blockchain`: the name of Blockchain
* `tokenName`: Full token name
* `tokenSymbol`: Ticker&#x20;
* `tokenDecimals`: Тumber of decimal points
* `lastUpdate` : last request update date&#x20;

**Request example**

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

```bash
curl --location --request POST 'https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key' \
--header 'x-api-key: your_api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc":"2.0",
    "method":"watch_getTokenMetadata",
    "params":["0xdAC17F958D2ee523a2206206994597C13D831ec7"],
    "id":1
}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"watch_getTokenMetadata",
    "params":["0xdAC17F958D2ee523a2206206994597C13D831ec7"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "blockchain": "ETH",
        "tokenName": "Tether USD",
        "tokenSymbol": "USDT",
        "tokenDecimals": 6,
        "lastUpdate": "2022-02-17T15:24:54.133465"
    }
}
```


# Stats

Blockchain analytics may require aggregated data. This is a rather difficult task, since there can be a lot of blocks per day and you have to analyze huge data. Therefore, the Stats api will allow you to quickly get statistics on the blockchain and draw the necessary conclusions.

{% content-ref url="/pages/GQes6ZZzDYTm0z8rxisg" %}
[watch\_getStatsByDay](/powered-api/stats/watch_getstatsbyday)
{% endcontent-ref %}


# watch\_getStatsByDay

**Parameters**

* `QUANTITY` - the unix timestamp

{% hint style="info" %}
To convert the unix timestamp you can use <https://www.epochconverter.com/>
{% endhint %}

```javascript
params: [
    1644419586,
]
```

**Returns**

`Object` - A block object with the following fields, or null when no block was found:

* transactionCount: QUANTITY - number of transactions per day
* averageGasPrice: QUANTITY,  - average gas price per day.
* totalGasUsed: QUANTITY, - total gas used per day
* uncleBlockReward: QUANTITY, - uncle block reward by day
* minersReward: QUANTITY, - miner's reward per day
* blockCount: QUANTITY, - number of blocks per day

{% hint style="info" %}
If you need data with a different range, ask us by mail <support@watchdata.io>
{% endhint %}

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"watch_getStatsByDay","params":[1645170803"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"watch_getStatsByDay",
    "params":[1645170803],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "id": 0,
    "jsonrpc": "2.0",
    "result": {
        "transactionCount": 1252754,
        "averageGasPrice": 99672209984.26283,
        "totalGasUsed": 99200040530,
        "uncleBlockReward": 676500000000000000000,
        "minersReward": 13594383283569909503493,
        "blockCount": 6418
    }
}
```


# Ethereum API

Below you will find the API documentation for the standard Ethereum JSON-RPC calls that WatchData supports.

## Ethereum API overview

<table><thead><tr><th>Blockchain</th><th width="158.06635071090045">Chain</th><th>URL</th></tr></thead><tbody><tr><td>Ethereum</td><td>Mainnet</td><td>https://ethereum.api.watchdata.io/node/jsonrpc</td></tr><tr><td>Ethereum</td><td>Görli</td><td>https://goerli.api.watchdata.io/node/jsonrpc</td></tr><tr><td>Ethereum</td><td>Ropsten (depricated)</td><td>https://ropsten.api.watchdata.io/node/jsonrpc</td></tr></tbody></table>

### Includes the following endpoints:

{% content-ref url="/pages/nVzaNoPiknHDZ6dBwHlx" %}
[eth\_blockNumber](/blockchain-apis/ethereum-api/eth_blocknumber)
{% endcontent-ref %}

{% content-ref url="/pages/bKhMaO26xISjvC7wuhHC" %}
[eth\_getBlockByHash](/blockchain-apis/ethereum-api/eth_getblockbyhash)
{% endcontent-ref %}

{% content-ref url="/pages/TUMtj5MbQgG6CIvngp7G" %}
[eth\_getBlockByNumber](/blockchain-apis/ethereum-api/eth_getblockbynumber)
{% endcontent-ref %}

{% content-ref url="/pages/lWZpEjgxW0LAxMTF3Gc2" %}
[eth\_getTransactionByHash](/blockchain-apis/ethereum-api/eth_gettransactionbyhash)
{% endcontent-ref %}

{% content-ref url="/pages/8P8D74q9Qelc8by5Kt6d" %}
[eth\_getTransactionReceipt](/blockchain-apis/ethereum-api/eth_gettransactionreceipt)
{% endcontent-ref %}

{% content-ref url="/pages/0tP0l3hCYo4IWxNtAltj" %}
[eth\_getBlockTransactionCountByHash](/blockchain-apis/ethereum-api/eth_getblocktransactioncountbyhash)
{% endcontent-ref %}

{% content-ref url="/pages/b4re7zRL6y90s6WKD8Nf" %}
[eth\_getUncleCountByBlockNumber](/blockchain-apis/ethereum-api/eth_getunclecountbyblocknumber)
{% endcontent-ref %}

{% content-ref url="/pages/rV3y4d2NXiNVpcKzeUwK" %}
[eth\_getTransactionByBlockNumberAndIndex](/blockchain-apis/ethereum-api/eth_gettransactionbyblocknumberandindex)
{% endcontent-ref %}

{% content-ref url="/pages/Z4tKMjaUhfFHMsUpf1Xh" %}
[eth\_getTransactionByBlockHashAndIndex](/blockchain-apis/ethereum-api/eth_gettransactionbyblockhashandindex)
{% endcontent-ref %}

{% content-ref url="/pages/YP0WnxJuruiHRdrqY678" %}
[eth\_getUncleCountByBlockHash](/blockchain-apis/ethereum-api/eth_getunclecountbyblockhash)
{% endcontent-ref %}

{% content-ref url="/pages/b4re7zRL6y90s6WKD8Nf" %}
[eth\_getUncleCountByBlockNumber](/blockchain-apis/ethereum-api/eth_getunclecountbyblocknumber)
{% endcontent-ref %}

{% content-ref url="/pages/PqGh75vtYinH7qZen90p" %}
[eth\_getLogs](/blockchain-apis/ethereum-api/eth_getlogs)
{% endcontent-ref %}

{% content-ref url="/pages/JXumx7FeneXWg2l0pEyO" %}
[eth\_call](/blockchain-apis/ethereum-api/eth_call)
{% endcontent-ref %}

{% content-ref url="/pages/RQFWCv8s3AB5gUQzmfjy" %}
[eth\_chainId](/blockchain-apis/ethereum-api/eth_chainid)
{% endcontent-ref %}

{% content-ref url="/pages/5ErHosGOADKlWmFivHG0" %}
[eth\_estimateGas](/blockchain-apis/ethereum-api/eth_estimategas)
{% endcontent-ref %}

{% content-ref url="/pages/hhM1bQipMTliNUFLTzyW" %}
[eth\_gasPrice](/blockchain-apis/ethereum-api/eth_gasprice)
{% endcontent-ref %}

{% content-ref url="/pages/u8HOnyliVA7LKfDGiOCO" %}
[eth\_getBalance](/blockchain-apis/ethereum-api/eth_getbalance)
{% endcontent-ref %}

{% content-ref url="/pages/vl88rifx6qEr6KNVeB71" %}
[eth\_getCode](/blockchain-apis/ethereum-api/eth_getcode)
{% endcontent-ref %}

{% content-ref url="/pages/AV98nS7xG1Y7QggKiBJF" %}
[eth\_getStorageAt](/blockchain-apis/ethereum-api/eth_getstorageat)
{% endcontent-ref %}

{% content-ref url="/pages/XGX2wZ93cbIayXx6hgA5" %}
[eth\_sendRawTransaction](/blockchain-apis/ethereum-api/eth_sendrawtransaction)
{% endcontent-ref %}


# eth\_getBlockByHash

Returns information about a block by hash.

**Parameters**

* `DATA`, 32 Bytes - Hash of a block.
* `Boolean` - If true it returns the full transaction objects, if false it returns only the hashes of the transactions.

```javascript
params: [
    '0xc0f4906fea23cf6f3cce98cb44e8e1449e455b28d684dfa9ff65426495584de6',
    true
]
```

**Returns**

`Object` - A block object with the following fields, or null when no block was found:

* `number`: QUANTITY - the block number. null when its pending block.
* `hash`: DATA, 32 Bytes - hash of the block. null when its pending block.
* `parentHash`: DATA, 32 Bytes - hash of the parent block.
* `nonce`: DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block.
* `sha3Uncles`: DATA, 32 Bytes - SHA3 of the uncles data in the block.
* `logsBloom`: DATA, 256 Bytes - the bloom filter for the logs of the block. null when its pending block.
* `transactionsRoot`: DATA, 32 Bytes - the root of the transaction trie of the block.
* `stateRoot`: DATA, 32 Bytes - the root of the final state trie of the block.
* `receiptsRoot`: DATA, 32 Bytes - the root of the receipts trie of the block.
* `miner`: DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.
* `difficulty`: QUANTITY - integer of the difficulty for this block.
* `totalDifficulty`: QUANTITY - integer of the total difficulty of the chain until this block.
* `extraData`: DATA - the "extra data" field of this block.
* `size`: QUANTITY - integer the size of this block in bytes.
* `gasLimit`: QUANTITY - the maximum gas allowed in this block.
* `gasUsed`: QUANTITY - the total used gas by all transactions in this block.
* `timestamp`: QUANTITY - the unix timestamp for when the block was collated.
* `transactions`: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.
* `uncles`: Array - Array of uncle hashes.
* `baseFeePerGas` - the minimum fee per gas required for a transaction to be included in the block.
* `mixHash` – a unique identifier for that block.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0xc0f4906fea23cf6f3cce98cb44e8e1449e455b28d684dfa9ff65426495584de6", true],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBlockByHash",
    "params":["0xc0f4906fea23cf6f3cce98cb44e8e1449e455b28d684dfa9ff65426495584de6", true],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "id": 0,
    "jsonrpc": "2.0",
    "result": {
        "number": "0x1e8480",
        "hash": "0xc0f4906fea23cf6f3cce98cb44e8e1449e455b28d684dfa9ff65426495584de6",
        "parentHash": "0x57ebf07eb9ed1137d41447020a25e51d30a0c272b5896571499c82c33ecb7288",
        "nonce": "0x3b05c6d5524209f1",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "transactionsRoot": "0xb31f174d27b99cdae8e746bd138a01ce60d8dd7b224f7c60845914def05ecc58",
        "stateRoot": "0x96dbad955b166f5119793815c36f11ffa909859bbfeb64b735cca37cbf10bef1",
        "receiptsRoot": "0x84aea4a7aad5c5899bd5cfc7f309cc379009d30179316a2a7baa4a2ea4a438ac",
        "miner": "0x61c808d82a3ac53231750dadc13c777b59310bd9",
        "difficulty": "0x2d50ba175407",
        "totalDifficulty": "0x262c34a6fd1268f6c",
        "extraData": "0xe4b883e5bda9e7a59ee4bb99e9b1bc",
        "size": "0x28a",
        "gasLimit": "0x47e7c4",
        "gasUsed": "0x5208",
        "timestamp": "0x57a1118a",
        "uncles": [],
        "baseFeePerGas": null,
        "mixHash": "0xc38853328f753c455edaa4dfc6f62a435e05061beac136c13dbdcd0ff38e5f40",
        "transactions": [
            {
                "hash": "0xc55e2b90168af6972193c1f86fa4d7d7b31a29c156665d15b9cd48618b5177ef",
                "nonce": "0x1efc5",
                "transactionIndex": "0x0",
                "from": "0x32be343b94f860124dc4fee278fdcbd38c102d88",
                "to": "0x104994f45d9d697ca104e5704a7b77d7fec3537c",
                "value": "0x821878651a4d70000",
                "gasPrice": "0x6fc23ac00",
                "gas": "0x51615",
                "maxFeePerGas": null,
                "maxPriorityFeePerGas": null,
                "input": "0x",
                "v": "0x1b",
                "r": "0x51222d91a379452395d0abaff981af4cfcc242f25cfaf947dea8245a477731f9",
                "s": "0x3a997c910b4701cca5d933fb26064ee5af7fe3236ff0ef2b58aa50b25aff8ca5",
                "chainId": null,
                "accessList": [],
                "blockHash": "0xc0f4906fea23cf6f3cce98cb44e8e1449e455b28d684dfa9ff65426495584de6",
                "blockNumber": "0x1e8480"
            }
        ]
    }
}
```


# eth\_getBlockByNumber

Returns information about a block by block number.

**Parameters**

* `QUANTITY|TAG` - integer of a block number, or the string "earliest", "latest" or "pending", as in the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).
* `Boolean` - If true it returns the full transaction objects, if false only the hashes of the transactions.

```javascript
params: [
    '0x1b4', 
    true
]
```

**Returns**

See [`eth_getBlockByHash`](/blockchain-apis/ethereum-api/eth_getblockbyhash)

`Object` - A block object with the following fields, or null when no block was found:

* `number`: QUANTITY - the block number. null when its pending block.
* `hash`: DATA, 32 Bytes - hash of the block. null when its pending block.
* `parentHash`: DATA, 32 Bytes - hash of the parent block.
* `nonce`: DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block.
* `sha3Uncles`: DATA, 32 Bytes - SHA3 of the uncles data in the block.
* `logsBloom`: DATA, 256 Bytes - the bloom filter for the logs of the block. null when its pending block.
* `transactionsRoot`: DATA, 32 Bytes - the root of the transaction trie of the block.
* `stateRoot`: DATA, 32 Bytes - the root of the final state trie of the block.
* `receiptsRoot`: DATA, 32 Bytes - the root of the receipts trie of the block.
* `miner`: DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.
* `difficulty`: QUANTITY - integer of the difficulty for this block.
* `totalDifficulty`: QUANTITY - integer of the total difficulty of the chain until this block.
* `extraData`: DATA - the "extra data" field of this block.
* `size`: QUANTITY - integer the size of this block in bytes.
* `gasLimit`: QUANTITY - the maximum gas allowed in this block.
* `gasUsed`: QUANTITY - the total used gas by all transactions in this block.
* `timestamp`: QUANTITY - the unix timestamp for when the block was collated.
* `transactions`: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.
* `uncles`: Array - Array of uncle hashes.
* `baseFeePerGas` - the minimum fee per gas required for a transaction to be included in the block.
* `mixHash` – a unique identifier for that block.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1b4", true],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBlockByNumber",
    "params":["0x1b4", true],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "id": 0,
    "jsonrpc": "2.0",
    "result": {
        "number": "0x1b4",
        "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae",
        "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54",
        "nonce": "0x689056015818adbe",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d",
        "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171",
        "difficulty": "0x4ea3f27bc",
        "totalDifficulty": "0x78ed983323d",
        "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32",
        "size": "0x220",
        "gasLimit": "0x1388",
        "gasUsed": "0x0",
        "timestamp": "0x55ba467c",
        "uncles": [],
        "baseFeePerGas": null,
        "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843",
        "transactions": []
    }
}
```


# eth\_getTransactionCount

Returns the number of transactions sent from an address.

**Parameters**

* `DATA`, 20 Bytes - address.
* `QUANTITY|TAG` - integer block number, or the string "latest", "earliest" or "pending".

```javascript
params: [
    '0xF5F3436A05B5CEd2490DAE07B86EB5BbD02782aA',
    'latest' // state at the latest block
]
```

**Returns**

`QUANTITY` - integer of the number of transactions send from this address.

**Request example**

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

```bash
curl --location --request POST 'https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key' \
--header 'x-api-key: your_api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionCount",
    "params":["0xF5F3436A05B5CEd2490DAE07B86EB5BbD02782aA","latest"],
    "id":1
}'
```

{% endtab %}

{% tab title="Postman" %}

```http
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionCount",
    "params":["0xF5F3436A05B5CEd2490DAE07B86EB5BbD02782aA","latest"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# eth\_getTransactionByHash

Returns the information about a transaction requested by transaction hash. In the response object, \`blockHash\`, \`blockNumber\`, and \`transactionIndex\` are \`null\` when the transaction is pending.

**Parameters**

`DATA`, 32 Bytes - hash of a transaction

```javascript
params: [
    "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"
]
```

**Returns**

`Object` - A transaction object, or null when no transaction was found:

* `blockHash`: `DATA`, 32 Bytes - hash of the block where this transaction was in. null when its pending.
* `blockNumber`: `QUANTITY` - block number where this transaction was in. null when it's pending.
* `from`: `DATA`, 20 Bytes - address of the sender.
* `gas`: `QUANTITY` - gas provided by the sender.
* `gasPrice`: `QUANTITY` - gas price provided by the sender in Wei.
* `hash`: `DATA`, 32 Bytes - hash of the transaction.
* `input`: `DATA` - the data send along with the transaction.
* `nonce`: `QUANTITY` - the number of transactions made by the sender prior to this one.
* `to`: `DATA`, 20 Bytes - address of the receiver. null when it's a contract creation transaction.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position in the block. null when its pending.
* `value`: `QUANTITY` - value transferred in Wei.
* `v`: `QUANTITY` - ECDSA recovery id
* `r`: `DATA`, 32 Bytes - ECDSA signature r
* `s`: `DATA`, 32 Bytes - ECDSA signature s

#### Request example

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d'{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionByHash",
    "params":["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "id": 0,
    "jsonrpc": "2.0",
    "result": {
        "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b",
        "nonce": "0x15",
        "transactionIndex": "0x41",
        "from_": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d",
        "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb",
        "value": "0xf3dbb76162000",
        "gasPrice": "0x4a817c800",
        "gas": "0xc350",
        "maxFeePerGas": null,
        "maxPriorityFeePerGas": null,
        "input": "0x68656c6c6f21",
        "v": "0x25",
        "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea",
        "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c",
        "chainId": "0x1",
        "accessList": [],
        "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2",
        "blockNumber": "0x5daf3b"
    }
}
```


# eth\_getTransactionReceipt

Returns the receipt of a transaction by transaction hash.

**Parameters**

`DATA`, 32 Bytes - hash of a transaction

```javascript
params: [ 
    '0xab059a62e22e230fe0f56d8555340a29b2e9532360368f810595453f6fdd213b' 
]
```

**Returns**

`Object` - A transaction receipt object, or null when no receipt was found:

* `transactionHash`: `DATA`, 32 Bytes - hash of the transaction.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position in the block.
* `blockHash`: `DATA`, 32 Bytes - hash of the block where this transaction was in.
* `blockNumber`: `QUANTITY` - block number where this transaction was in.
* `from`: `DATA`, 20 Bytes - address of the sender.
* `to`: `DATA`, 20 Bytes - address of the receiver. null when its a contract creation transaction.
* `cumulativeGasUsed`: `QUANTITY` - The total amount of gas used when this transaction was executed in the block.
* `gasUsed`: `QUANTITY` - The amount of gas used by this specific transaction alone.
* `contractAddress`: `DATA`, 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null.
* `logs`: `Array` - Array of log objects, which this transaction generated.
* `logsBloom`: `DATA`, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs.

It also returns either:

* `status`: `QUANTITY` either 1 (success) or 0 (failure)

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0xab059a62e22e230fe0f56d8555340a29b2e9532360368f810595453f6fdd213b"],"id":0}
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionReceipt",
    "params":["0xab059a62e22e230fe0f56d8555340a29b2e9532360368f810595453f6fdd213b"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
  "jsonrpc": "2.0",
  "id": 0,
  "result": [{
    "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb",
    "blockNumber": "0x429d3b",
    "contractAddress": null,
    "cumulativeGasUsed": "0x64b559",
    "from": "0x00b46c2526e227482e2ebb8f4c69e4674d262e75",
    "gasUsed": "0xcaac",
    "logs": [
        {
            "address": "0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907",
            "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb",
            "blockNumber": "0x429d3b",
            "data": "0x000000000000000000000000000000000000000000000000000000012a05f200",
            "logIndex": "0x56",
            "topics": [
                "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
                "0x00000000000000000000000000b46c2526e227482e2ebb8f4c69e4674d262e75",
                "0x00000000000000000000000054a2d42a40f51259dedd1978f6c118a0f0eff078"
            ],
            "transactionHash": "0xab059a62e22e230fe0f56d8555340a29b2e9532360368f810595453f6fdd213b",
            "transactionIndex": "0xac"
        }
    ],
    "status": null,
    "effectiveGasPrice": "0x4082c7343",
    "logsBloom": "0x00000000040000000000000000000000000000000000000000000000000000080000000010000000000000000000000000000000000040000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000010100000000000000000000000000004000000000000200000000000000000000000000000000000000000000",
    "to": "0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907",
    "transactionHash": "0xab059a62e22e230fe0f56d8555340a29b2e9532360368f810595453f6fdd213b",
    "transactionIndex": "0xac"
    },]
}
```


# eth\_getBlockTransactionCountByHash

Returns the number of transactions in a block matching the given block hash.

**Parameters**

* `DATA`, 32 Bytes - hash of a block.

  ```javascript
  params: [ 
      '0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb' 
  ]
  ```

**Returns**

* `QUANTITY` - integer of the number of transactions in this block.

#### Request example

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByHash","params":["0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBlockTransactionCountByHash",
    "params":["0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
  "jsonrpc": "2.0",
  "id": 0,
  "result": "0xb0"
}
```


# eth\_getBlockTransactionCountByNumber

Returns the number of transactions in a block matching the given block number.

**Parameters**

* `QUANTITY|TAG` - integer of a block number, or the string "earliest", "latest" or "pending", as in the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).

```javascript
params: [
    'latest',
]
```

**Returns**

* `QUANTITY` - integer of the number of transactions in this block.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNumber","params":["latest"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBlockTransactionCountByNumber",
    "params":["latest"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
  "jsonrpc": "2.0",
  "id": 0,
  "result": "0xee"
}
```


# eth\_getTransactionByBlockHashAndIndex

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

**Parameters**

`DATA`, 32 Bytes - hash of a block.

`QUANTITY` - integer of the transaction index position.

```javascript
params: [ 
    '0xc0f4906fea23cf6f3cce98cb44e8e1449e455b28d684dfa9ff65426495584de6', 
    '0x0' // 0 
]
```

**Returns**

See [`eth_getTransactionByHash`](/blockchain-apis/ethereum-api/eth_gettransactionbyhash)

`Object` - A transaction object, or null when no transaction was found:

* `blockHash`: `DATA`, 32 Bytes - hash of the block where this transaction was in. null when its pending.
* `blockNumber`: `QUANTITY` - block number where this transaction was in. null when it's pending.
* `from`: `DATA`, 20 Bytes - address of the sender.
* `gas`: `QUANTITY` - gas provided by the sender.
* `gasPrice`: `QUANTITY` - gas price provided by the sender in Wei.
* `hash`: `DATA`, 32 Bytes - hash of the transaction.
* `input`: `DATA` - the data send along with the transaction.
* `nonce`: `QUANTITY` - the number of transactions made by the sender prior to this one.
* `to`: `DATA`, 20 Bytes - address of the receiver. null when it's a contract creation transaction.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position in the block. null when its pending.
* `value`: `QUANTITY` - value transferred in Wei.
* `v`: `QUANTITY` - ECDSA recovery id
* `r`: `DATA`, 32 Bytes - ECDSA signature r
* `s`: `DATA`, 32 Bytes - ECDSA signature s

**Request**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAndIndex","params":["0xc0f4906fea23cf6f3cce98cb44e8e1449e455b28d684dfa9ff65426495584de6", "0x0"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionByBlockHashAndIndex",
    "params":["0xc0f4906fea23cf6f3cce98cb44e8e1449e455b28d684dfa9ff65426495584de6", "0x0"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "blockHash": "0xc0f4906fea23cf6f3cce98cb44e8e1449e455b28d684dfa9ff65426495584de6",
    "blockNumber": "0x1e8480",
    "from": "0x32be343b94f860124dc4fee278fdcbd38c102d88",
    "gas": "0x51615",
    "gasPrice": "0x6fc23ac00",
    "hash": "0xc55e2b90168af6972193c1f86fa4d7d7b31a29c156665d15b9cd48618b5177ef",
    "input": "0x",
    "nonce": "0x1efc5",
    "to": "0x104994f45d9d697ca104e5704a7b77d7fec3537c",
    "transactionIndex": "0x0",
    "value": "0x821878651a4d70000",
    "v": "0x1b",
    "r": "0x51222d91a379452395d0abaff981af4cfcc242f25cfaf947dea8245a477731f9",
    "s": "0x3a997c910b4701cca5d933fb26064ee5af7fe3236ff0ef2b58aa50b25aff8ca5"
  }
}
```


# eth\_getTransactionByBlockNumberAndIndex

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

**Parameters**

* `QUANTITY|TAG` - a block number, or the string "earliest", "latest" or "pending", as in the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#the-default-block-parameter).
* `QUANTITY` - the transaction index position.

```javascript
 params: [ 
     'latest', // 668 
     '0x0' // 0 
 ]
```

**Returns**

See [`eth_getTransactionByHash`](/blockchain-apis/ethereum-api/eth_gettransactionbyhash)

`Object` - A transaction object, or null when no transaction was found:

* `blockHash`: `DATA`, 32 Bytes - hash of the block where this transaction was in. null when its pending.
* `blockNumber`: `QUANTITY` - block number where this transaction was in. null when it's pending.
* `from`: `DATA`, 20 Bytes - address of the sender.
* `gas`: `QUANTITY` - gas provided by the sender.
* `gasPrice`: `QUANTITY` - gas price provided by the sender in Wei.
* `hash`: `DATA`, 32 Bytes - hash of the transaction.
* `input`: `DATA` - the data send along with the transaction.
* `nonce`: `QUANTITY` - the number of transactions made by the sender prior to this one.
* `to`: `DATA`, 20 Bytes - address of the receiver. null when it's a contract creation transaction.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position in the block. null when its pending.
* `value`: `QUANTITY` - value transferred in Wei.
* `v`: `QUANTITY` - ECDSA recovery id
* `r`: `DATA`, 32 Bytes - ECDSA signature r
* `s`: `DATA`, 32 Bytes - ECDSA signature s

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberAndIndex","params":["latest", "0x0"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionByBlockNumberAndIndex",
    "params":["latest", "0x0"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "id": 0,
    "jsonrpc": "2.0",
    "result": {
        "hash": "0x495255ed9278dbde17574aa7f1343ededf6971d21a853d614249006a702ac8d6",
        "nonce": "0x1",
        "transactionIndex": "0x0",
        "from_": "0xa71a0c2b94a79aef4b2a0b2907f3aa14110d2aba",
        "to": "0x9367daad7677c59b1bd30f62839abdfd06abcc3c",
        "value": "0x6312853b0ccd400",
        "gasPrice": "0x18ae17a400",
        "gas": "0xf6d3",
        "maxFeePerGas": null,
        "maxPriorityFeePerGas": null,
        "input": "0x",
        "v": "0x25",
        "r": "0xb266875604d1e74ed68c960ddc5b556c51f3bcd44f0dd9222470a47a69f2f21f",
        "s": "0x63aaf61b94e266cbf542dc0479468d3a300fc9ad2250f02fd3be7a339b85462d",
        "chainId": null,
        "accessList": [],
        "blockHash": "0x7846b2f522ffb640ab8f94c2fffd0d2cf8157595040f2b5baad575c60b7254fc",
        "blockNumber": "0xd65c96"
    }
}
```


# eth\_getUncleCountByBlockHash

Returns the number of uncles in a block matching the given block hash.

**Parameters**

* `DATA`, 32 Bytes - hash of a block.

```javascript
params: [
 '0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35'
]
```

**Returns**

`QUANTITY` - integer of the number of uncles in this block.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockHash","params":["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```http
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getUncleCountByBlockHash",
    "params":["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
  "jsonrpc": "2.0",
  "id": 0,
  "result": "0x1"
}
```


# eth\_getUncleCountByBlockNumber

Returns the number of uncles in a block matching the give block number.

**Parameters**

`QUANTITY|TAG` - integer of a block number, or the string "latest", "earliest" or "pending", see the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).

```javascript
 params: [ 
  '0xe8', // 232 
 ]
```

**Returns**

`QUANTITY` - integer of the number of uncles in this block.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockNumber","params":["0xe8"],"id":1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getUncleCountByBlockNumber",
    "params":["0xe8"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
  "jsonrpc": "2.0",
  "id": 0,
  "result": "0x0"
}
```


# eth\_getLogs

Returns an array of all logs matching a given filter object.

**Parameters**

`Object` - The filter options:

* `fromBlock`: `QUANTITY|TAG` - (optional, default: "latest") Value:
* Integer block number
* "latest" for the last mined block
* `address`: `DATA|Array`, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate.
* `topics`: `Array` of `DATA`, - (optional) Array of 32 Bytes DATA topics.
  * Topics are order-dependent. Each topic can also be an array of DATA with "or" options.
* `blockHash`: `DATA`, 32 Bytes - (optional) With the addition of EIP-234 (Geth >= v1.8.13 or Parity >= v2.1.0), blockHash is a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to fromBlock = toBlock = the block number with hash `blockHash`. **If blockHash is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed.**

```javascript
params: [
  {
    "address": "0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907",
    "topics": [
      "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
    ],
    "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb"
  }
]
```

**Returns**

`Array` - Array of log objects, or an empty array if nothing has changed since last poll.

* `removed`: `TAG` - `true` when the log was removed, due to a chain reorganization. `false` if its a valid log.
* `logIndex`: `QUANTITY` - integer of the log index position in the block. `null` when its pending log.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position log was created from. `null` when its pending log.
* `transactionHash`: `DATA`, 32 Bytes - hash of the transactions this log was created from. `null` when its pending log.
* `blockHash`: `DATA`, 32 Bytes - hash of the block where this log was in. `null` when its pending. `null` when its pending log.
* `blockNumber`: `QUANTITY` - the block number where this log was in. `null` when its pending. `null` when its pending log.
* `address`: `DATA`, 20 Bytes - address from which this log originated.
* `data`: `DATA` - contains one or more 32 Bytes non-indexed arguments of the log.
* `topics`: `Array of DATA` - Array of 0 to 4 32 Bytes `DATA` of indexed log arguments.
  * In *solidity*: The first topic is the *hash* of the signature of the event (e.g. `Deposit(address,bytes32,uint256)`), except you declare the event with the `anonymous` specifier.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"address": "0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907","topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"],"blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb"}],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getLogs",
    "params":[{"address": "0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907","topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"],"blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb"}],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "id": 0,
    "jsonrpc": "2.0",
    "result": [
        {
            "address": "0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907",
            "blockHash": "0x8243343df08b9751f5ca0c5f8c9c0460d8a9b6351066fae0acbd4d3e776de8bb",
            "blockNumber": "0x429d3b",
            "data": "0x000000000000000000000000000000000000000000000000000000012a05f200",
            "logIndex": "0x56",
            "topics": [
                "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
                "0x00000000000000000000000000b46c2526e227482e2ebb8f4c69e4674d262e75",
                "0x00000000000000000000000054a2d42a40f51259dedd1978f6c118a0f0eff078"
            ],
            "transactionHash": "0xab059a62e22e230fe0f56d8555340a29b2e9532360368f810595453f6fdd213b",
            "transactionIndex": "0xac",
            "removed": false
        }
    ]
}
```


# eth\_call

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

**Parameters**

1. `Object` - The transaction call object

* `from`: `DATA`, 20 Bytes - (optional) The address the transaction is sent from.
* `to`: `DATA`, 20 Bytes - The address the transaction is directed to.
* `gas`: `QUANTITY` - (optional) Integer of the gas provided for the transaction execution. eth\_call consumes zero gas, but this parameter may be needed by some executions.
* `gasPrice`: `QUANTITY` - (optional) Integer of the gasPrice used for each paid gas
* `value`: `QUANTITY` - (optional) Integer of the value sent with this transaction
* `data`: `DATA` - (optional) Hash of the method signature and encoded parameters. For details see [Ethereum Contract ABI in the Solidity documentation](https://docs.soliditylang.org/en/latest/abi-spec.html)

```javascript
params: [
    {
        "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
        "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
        "gas": "0x76c0",
        "gasPrice": "0x9184e72a000",
        "value": "0x9184e72a",
        "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
    }, 
    "latest"
]
```

**Returns**

`DATA` - the return value of executed contract.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_call","params":[{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155","to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567","gas": "0x76c0","gasPrice": "0x9184e72a000","value": "0x9184e72a","data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"],"id":1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
            "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
            "gas": "0x76c0",
            "gasPrice": "0x9184e72a000",
            "value": "0x9184e72a",
            "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
        },
        "latest"
    ],
    "id": 1
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# eth\_chainId

Returns the currently configured chain ID, a value used in replay-protected transaction signing as introduced by EIP-155.

**Parameters**

None.

**Returns**

`QUANTITY` - integer of the current chain ID.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_chainId",
    "params":[],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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

###


# eth\_estimateGas

Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain.

{% hint style="info" %}
Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance.
{% endhint %}

**Parameters**

* `Object` - The transaction call object
  * `from`: `DATA`, 20 Bytes - (optional) The address the transaction is sent from.
  * `to`: `DATA`, 20 Bytes - The address the transaction is directed to.
  * `gas`: `QUANTITY` - (optional) Integer of the gas provided for the transaction execution. `eth_estimateGas` consumes zero gas, but this parameter may be needed by some executions.
  * `gasPrice`: `QUANTITY` - (optional) Integer of the gasPrice used for each paid gas.
  * `value`: `QUANTITY` - (optional) Integer of the value sent with this transaction
  * `data`: `DATA` - (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI

**Returns**

`QUANTITY` - the amount of gas used.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_estimateGas",
    "params": [
        {
            "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9",
            "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",
            "value": "0x186a0"
        }
    ],
    "id": 1
}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc": "2.0",
    "method": "eth_estimateGas",
    "params": [
        {
            "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9",
            "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",
            "value": "0x186a0"
        }
    ],
    "id": 1
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
  "id":1,
  "jsonrpc": "2.0",
  "result": "0x5208" // 21000
}
```


# eth\_gasPrice

Returns the current price per gas in wei.

**Parameters**

none

**Returns**

`QUANTITY` - integer of the current gas price in wei.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_gasPrice",
    "params":[],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
  "jsonrpc": "2.0",
  "id": 0,
  "result": "0x98bca5a00"
}
```


# eth\_getBalance

Returns the balance of the account of a given address.

**Parameters**

1. `DATA`, 20 Bytes - address to check for balance.
2. `QUANTITY|TAG` - integer block number, or the string `"latest"`, `"earliest"` or `"pending"`, see the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).

```javascript
params: [
   '0xc94770007dda54cF92009BFF0dE90c06F603a09f',
   'latest'
]
```

**Returns**

`QUANTITY` - integer of the current balance for the given address in wei.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBalance",
    "params":["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
  "jsonrpc": "2.0",
  "id": 0,
  "result": "0x7c2562030800"
}
```


# eth\_getCode

Returns code at a given address.

**Parameters**

* `DATA`, 20 Bytes - address.
* `QUANTITY|TAG` - integer block number, or the string "latest", "earliest" or "pending", see the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).

```javascript
params: [
    '0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907',
    'latest'
]
```

**Returns**

* `DATA` - the code from the given address.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_getCode","params":["0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907", "latest"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getCode",
    "params":["0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907", "latest"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
  "jsonrpc": "2.0",
  "id": 0,
  "result": "0x606060405236156100965763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100a557806313af40351461012f57806318160ddd1461014e578063313ce5671461017357806370a082311461019c57806375ad319a146101bb5780638da5cb5b146101ee57806395d89b411461021d578063a9059cbb14610230575b34156100a157600080fd5bfe5b005b34156100b057600080fd5b6100b8610252565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100f45780820151838201526020016100dc565b50505050905090810190601f1680156101215780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561013a57600080fd5b6100a3600160a060020a0360043516610289565b341561015957600080fd5b61016161030f565b60405190815260200160405180910390f35b341561017e57600080fd5b610186610315565b60405160ff909116815260200160405180910390f35b34156101a757600080fd5b610161600160a060020a036004351661031a565b34156101c657600080fd5b6101da600160a060020a0360043516610335565b604051901515815260200160405180910390f35b34156101f957600080fd5b61020161038e565b604051600160a060020a03909116815260200160405180910390f35b341561022857600080fd5b6100b861039d565b341561023b57600080fd5b6101da600160a060020a03600435166024356103d4565b60408051908101604052601881527f444f5420416c6c6f636174696f6e20496e64696361746f720000000000000000602082015281565b60005433600160a060020a039081169116146102a457600080fd5b600054600160a060020a0380831691167f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236460405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60015481565b600381565b600160a060020a031660009081526002602052604090205490565b33600160a060020a03811660009081526002602052604081206001015490919060ff16151561036357600080fd5b5050600160a060020a031660009081526002602052604090206001908101805460ff19168217905590565b600054600160a060020a031681565b60408051908101604052600381527f444f540000000000000000000000000000000000000000000000000000000000602082015281565b33600160a060020a03811660009081526002602052604081205490919083908190101561040057600080fd5b33600160a060020a03811660009081526002602052604090206001015460ff16151561042b57600080fd5b85600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8760405190815260200160405180910390a3600160a060020a033381166000908152600260205260408082208054899003905591881681522080548601905560019350505050929150505600a165627a7a72305820228dfae3e67abcdc7f73fb3f83a7d23f45acd853774acad9d2e1ac83b940fbe90029"
}
```


# net\_version

returns the current network id.

**Parameters**

none

**Returns**

`String` - The current network id.

* `"0x1"`: Ethereum Mainnet
* `"0x3"`: Ropsten Testnet

**Request example**

Request

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

```bash
curl --location --request POST 'https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key' \
--header 'x-api-key: your_api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc":"2.0",
    "method":"net_version",
    "params":[],
    "id":1
}'
```

{% endtab %}

{% tab title="Postman" %}

```http
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"net_version",
    "params":[],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# eth\_getStorageAt

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

**Parameters**

* `DATA`, 20 Bytes - address of the storage.
* `QUANTITY` - integer of the position in the storage.
* `QUANTITY|TAG` - integer block number, or the string "latest", "earliest" or "pending", see the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).

**Returns**

* `DATA` - the value at this storage position.

**Example**

Calculating the correct position depends on the storage to retrieve. Consider the following contract deployed at `0x295a70b2de5e3953354a6a8344e616ed314d7251` by address `0x391694e7e0b0cce554cb130d723a9d27458f9298`.

```javascript
contract Storage {
    uint pos0;
    mapping(address => uint) pos1;
    function Storage() {
        pos0 = 1234;
        pos1[msg.sender] = 5678;
    }
}
```

Retrieving the value of `pos0` is straight forward:

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getStorageAt",
    "params":["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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

Retrieving an element of the map is harder. The position of an element in the map is calculated with:

```javascript
keccack(LeftPad32(key, 0), LeftPad32(map position, 0))
```

This means to retrieve the storage on `pos1[“0x391694e7e0b0cce554cb130d723a9d27458f9298”]` we need to calculate the position with:

```javascript
keccak(decodeHex("000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298" + "0000000000000000000000000000000000000000000000000000000000000001"))
```

The geth console which comes with the web3 library can be used to make the calculation:

```bash
> var key = "000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298" + "0000000000000000000000000000000000000000000000000000000000000001"
undefined
> web3.sha3(key, {"encoding": "hex"})
"0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9"
```

Now to fetch the storage:

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "latest"], "id": 1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getStorageAt",
    "params":["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "latest"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# eth\_sendRawTransaction

Creates new message call transaction or a contract creation for signed transactions.

**Parameters**

`DATA`, The signed transaction data.

```javascript
params: ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"]
```

**Returns**

`DATA`, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available.

Use [`eth_getTransactionReceipt`](/blockchain-apis/ethereum-api/eth_gettransactionreceipt) to get the contract address after the transaction was mined when you created a contract.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"],"id":1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_sendRawTransaction",
    "params":["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# eth\_blockNumber

Returns the number of the most recent block.

**Parameters**

none

**Returns**

`QUANTITY` - integer of the current block number the client is on.

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_blockNumber",
    "params":[],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
  "jsonrpc": "2.0",
  "id": 0,
  "result": "0xa1c054"
}
```


# Polygon API

The Polygon API follows a JSON-RPC standard. This doc contains the methods that WatchData supports for Polygon development on mainnet.

## Polygon API overview

<table><thead><tr><th>Blockchain</th><th width="158.06635071090045">Chain</th><th>URL</th></tr></thead><tbody><tr><td>Polygon</td><td>Mainnet</td><td>https://polygon.api.watchdata.io/node/jsonrpc</td></tr></tbody></table>

### Includes the following endpoints:

{% content-ref url="/pages/nVzaNoPiknHDZ6dBwHlx" %}
[eth\_blockNumber](/blockchain-apis/ethereum-api/eth_blocknumber)
{% endcontent-ref %}

{% content-ref url="/pages/bKhMaO26xISjvC7wuhHC" %}
[eth\_getBlockByHash](/blockchain-apis/ethereum-api/eth_getblockbyhash)
{% endcontent-ref %}

{% content-ref url="/pages/TUMtj5MbQgG6CIvngp7G" %}
[eth\_getBlockByNumber](/blockchain-apis/ethereum-api/eth_getblockbynumber)
{% endcontent-ref %}

{% content-ref url="/pages/lWZpEjgxW0LAxMTF3Gc2" %}
[eth\_getTransactionByHash](/blockchain-apis/ethereum-api/eth_gettransactionbyhash)
{% endcontent-ref %}

{% content-ref url="/pages/8P8D74q9Qelc8by5Kt6d" %}
[eth\_getTransactionReceipt](/blockchain-apis/ethereum-api/eth_gettransactionreceipt)
{% endcontent-ref %}

{% content-ref url="/pages/0tP0l3hCYo4IWxNtAltj" %}
[eth\_getBlockTransactionCountByHash](/blockchain-apis/ethereum-api/eth_getblocktransactioncountbyhash)
{% endcontent-ref %}

{% content-ref url="/pages/b4re7zRL6y90s6WKD8Nf" %}
[eth\_getUncleCountByBlockNumber](/blockchain-apis/ethereum-api/eth_getunclecountbyblocknumber)
{% endcontent-ref %}

{% content-ref url="/pages/rV3y4d2NXiNVpcKzeUwK" %}
[eth\_getTransactionByBlockNumberAndIndex](/blockchain-apis/ethereum-api/eth_gettransactionbyblocknumberandindex)
{% endcontent-ref %}

{% content-ref url="/pages/Z4tKMjaUhfFHMsUpf1Xh" %}
[eth\_getTransactionByBlockHashAndIndex](/blockchain-apis/ethereum-api/eth_gettransactionbyblockhashandindex)
{% endcontent-ref %}

{% content-ref url="/pages/YP0WnxJuruiHRdrqY678" %}
[eth\_getUncleCountByBlockHash](/blockchain-apis/ethereum-api/eth_getunclecountbyblockhash)
{% endcontent-ref %}

{% content-ref url="/pages/b4re7zRL6y90s6WKD8Nf" %}
[eth\_getUncleCountByBlockNumber](/blockchain-apis/ethereum-api/eth_getunclecountbyblocknumber)
{% endcontent-ref %}

{% content-ref url="/pages/PqGh75vtYinH7qZen90p" %}
[eth\_getLogs](/blockchain-apis/ethereum-api/eth_getlogs)
{% endcontent-ref %}

{% content-ref url="/pages/JXumx7FeneXWg2l0pEyO" %}
[eth\_call](/blockchain-apis/ethereum-api/eth_call)
{% endcontent-ref %}

{% content-ref url="/pages/RQFWCv8s3AB5gUQzmfjy" %}
[eth\_chainId](/blockchain-apis/ethereum-api/eth_chainid)
{% endcontent-ref %}

{% content-ref url="/pages/5ErHosGOADKlWmFivHG0" %}
[eth\_estimateGas](/blockchain-apis/ethereum-api/eth_estimategas)
{% endcontent-ref %}

{% content-ref url="/pages/hhM1bQipMTliNUFLTzyW" %}
[eth\_gasPrice](/blockchain-apis/ethereum-api/eth_gasprice)
{% endcontent-ref %}

{% content-ref url="/pages/u8HOnyliVA7LKfDGiOCO" %}
[eth\_getBalance](/blockchain-apis/ethereum-api/eth_getbalance)
{% endcontent-ref %}

{% content-ref url="/pages/vl88rifx6qEr6KNVeB71" %}
[eth\_getCode](/blockchain-apis/ethereum-api/eth_getcode)
{% endcontent-ref %}

{% content-ref url="/pages/AV98nS7xG1Y7QggKiBJF" %}
[eth\_getStorageAt](/blockchain-apis/ethereum-api/eth_getstorageat)
{% endcontent-ref %}

{% content-ref url="/pages/XGX2wZ93cbIayXx6hgA5" %}
[eth\_sendRawTransaction](/blockchain-apis/ethereum-api/eth_sendrawtransaction)
{% endcontent-ref %}


# eth\_blockNumber - Polygon

Returns the number of the most recent block.

**Parameters**

none

**Returns**

`QUANTITY` - integer of the current block number the client is on.

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_blockNumber",
    "params":[],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "0x1d7600a"
}
```


# eth\_getBlockByHash - Polygon

Returns information about a block by hash.

**Parameters**

* `DATA`, 32 Bytes - Hash of a block.
* `Boolean` - If true it returns the full transaction objects, if false it returns only the hashes of the transactions.

```javascript
params: [
    '0x8d9120cedf65b970b951c4b7a67c20075f32359bf19e310ecd1118d11a12bc69',
    true
]
```

**Returns**

`Object` - A block object with the following fields, or null when no block was found:

* `number`: QUANTITY - the block number. null when its pending block.
* `hash`: DATA, 32 Bytes - hash of the block. null when its pending block.
* `parentHash`: DATA, 32 Bytes - hash of the parent block.
* `nonce`: DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block.
* `sha3Uncles`: DATA, 32 Bytes - SHA3 of the uncles data in the block.
* `logsBloom`: DATA, 256 Bytes - the bloom filter for the logs of the block. null when its pending block.
* `transactionsRoot`: DATA, 32 Bytes - the root of the transaction trie of the block.
* `stateRoot`: DATA, 32 Bytes - the root of the final state trie of the block.
* `receiptsRoot`: DATA, 32 Bytes - the root of the receipts trie of the block.
* `miner`: DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.
* `difficulty`: QUANTITY - integer of the difficulty for this block.
* `totalDifficulty`: QUANTITY - integer of the total difficulty of the chain until this block.
* `extraData`: DATA - the "extra data" field of this block.
* `size`: QUANTITY - integer the size of this block in bytes.
* `gasLimit`: QUANTITY - the maximum gas allowed in this block.
* `gasUsed`: QUANTITY - the total used gas by all transactions in this block.
* `timestamp`: QUANTITY - the unix timestamp for when the block was collated.
* `transactions`: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.
* `uncles`: Array - Array of uncle hashes.

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0x8d9120cedf65b970b951c4b7a67c20075f32359bf19e310ecd1118d11a12bc69", true],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBlockByHash",
    "params":["0x8d9120cedf65b970b951c4b7a67c20075f32359bf19e310ecd1118d11a12bc69", true],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "number": "0x1d763ed",
        "hash": "0x8d9120cedf65b970b951c4b7a67c20075f32359bf19e310ecd1118d11a12bc69",
        "parentHash": "0xf83ad5151f15afab92eafd54674a91484bb99e3e2b08f996f8c94440ab346541",
        "nonce": "0x0000000000000000",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "logsBloom": "0x0910839d381643800481512280e8022c182103c0000850806c057c216380b7007219181acd10e044a441091904200a01e0068e585a362408a443331009ae21c2281ca92c02002009140f108990e90ddb925a306e0904e0085003741100112542ba0082743b62a8c44a012a2b00c08cc0b00d300103d078c8a568423443384e1910145494d89d5c4e084846b10cd220c0003117acc2014325c8586402062a5372320b0a32717682201a800e023ba8004111064090620229023d182806014030407a03c0039e4258ee0d0187cb2216c009405184e1862a808f1d5883581c90e0a6001029ec19212dfdc421603469622920faa80c0b040644850662282460f0700e",
        "transactionsRoot": "0xbc3f787fa03e2b3af644521d20cec04d867685519f7bf2f5c740d2cb5794432c",
        "stateRoot": "0x71646d6cb789c95362eca6eaee7811a6e33207a80f16b65a217a8e52716c9303",
        "receiptsRoot": "0x4c002bc814f434bb6444d540fb4144172fb97cbc97733dc9562031a305dae6f1",
        "miner": "0x0000000000000000000000000000000000000000",
        "difficulty": "0x14",
        "totalDifficulty": "0x1ac4d50f",
        "extraData": "0xd682021083626f7288676f312e31382e33856c696e7578000000000000000000448d1ee49a9f16d8b56744e1d32d4c263ebb6e85620823845be5a3ada1e9ceb5410877b76c0ebd63ad922d6550e2280441a5a666f3aa1dcc4a42c2fe2a2b9d2700",
        "size": "0xa14c",
        "gasLimit": "0x1c9c380",
        "gasUsed": "0x81ff1c",
        "timestamp": "0x62d67b7d",
        "uncles": [],
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "transactions": [
            {
                "hash": "0x92bb0c20f3d256978eda3f75c369497c1a058351581cda26e5df3a96fdcfe15b",
                "nonce": "0x265df2",
                "transactionIndex": "0x0",
                "from": "0x4f27769c38169e402ffbb38b19f2606be60fdf97",
                "to": "0x7abba724a26d23aaca42d9b65cb4c35bbff1f577",
                "value": "0x0",
                "gasPrice": "0x45d964b800",
                "gas": "0x3d0900",
                "input": "0xb5cdffa8000000000000000000000000a34ab23406a237eec17af4d1496bfaadd2f48efd0000000000000000000000000000000000000000000000000000000000b7782f000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000018215cdb4f800000000000000000000000000000000000000000000000000000000000000034e465400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013323032322d30372d31395430393a33323a353900000000000000000000000000",
                "v": "0x136",
                "r": "0x5b2fd90ee53860af8e159e0bf14033d91ab6599948c4ca70ed31a41764d71c35",
                "s": "0x69333f5c60a3a9f7f040279f75fddb2a2b81803866d00c8072dc90a5334eaf01",
                "chainId": null,
                "blockHash": "0x8d9120cedf65b970b951c4b7a67c20075f32359bf19e310ecd1118d11a12bc69",
                "blockNumber": "0x1d763ed"
            }
        ]
    }
}
```


# eth\_getBlockByNumber - Polygon

Returns information about a block by block number.

**Parameters**

* `QUANTITY|TAG` - integer of a block number, or the string "earliest", "latest" or "pending", as in the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).
* `Boolean` - If true it returns the full transaction objects, if false only the hashes of the transactions.

```javascript
params: 
['0x1D763ED',true]
```

**Returns**

See [`eth_getBlockByHash`](/blockchain-apis/ethereum-api/eth_getblockbyhash)

`Object` - A block object with the following fields, or null when no block was found:

* `number`: QUANTITY - the block number. null when its pending block.
* `hash`: DATA, 32 Bytes - hash of the block. null when its pending block.
* `parentHash`: DATA, 32 Bytes - hash of the parent block.
* `nonce`: DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block.
* `sha3Uncles`: DATA, 32 Bytes - SHA3 of the uncles data in the block.
* `logsBloom`: DATA, 256 Bytes - the bloom filter for the logs of the block. null when its pending block.
* `transactionsRoot`: DATA, 32 Bytes - the root of the transaction trie of the block.
* `stateRoot`: DATA, 32 Bytes - the root of the final state trie of the block.
* `receiptsRoot`: DATA, 32 Bytes - the root of the receipts trie of the block.
* `miner`: DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.
* `difficulty`: QUANTITY - integer of the difficulty for this block.
* `totalDifficulty`: QUANTITY - integer of the total difficulty of the chain until this block.
* `extraData`: DATA - the "extra data" field of this block.
* `size`: QUANTITY - integer the size of this block in bytes.
* `gasLimit`: QUANTITY - the maximum gas allowed in this block.
* `gasUsed`: QUANTITY - the total used gas by all transactions in this block.
* `timestamp`: QUANTITY - the unix timestamp for when the block was collated.
* `transactions`: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.
* `uncles`: Array - Array of uncle hashes.

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1D763ED", true],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBlockByNumber",
    "params":["0x1D763ED", true],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```json
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "number": "0x1d763ed",
        "hash": "0x8d9120cedf65b970b951c4b7a67c20075f32359bf19e310ecd1118d11a12bc69",
        "parentHash": "0xf83ad5151f15afab92eafd54674a91484bb99e3e2b08f996f8c94440ab346541",
        "nonce": "0x0000000000000000",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "logsBloom": "0x0910839d381643800481512280e8022c182103c0000850806c057c216380b7007219181acd10e044a441091904200a01e0068e585a362408a443331009ae21c2281ca92c02002009140f108990e90ddb925a306e0904e0085003741100112542ba0082743b62a8c44a012a2b00c08cc0b00d300103d078c8a568423443384e1910145494d89d5c4e084846b10cd220c0003117acc2014325c8586402062a5372320b0a32717682201a800e023ba8004111064090620229023d182806014030407a03c0039e4258ee0d0187cb2216c009405184e1862a808f1d5883581c90e0a6001029ec19212dfdc421603469622920faa80c0b040644850662282460f0700e",
        "transactionsRoot": "0xbc3f787fa03e2b3af644521d20cec04d867685519f7bf2f5c740d2cb5794432c",
        "stateRoot": "0x71646d6cb789c95362eca6eaee7811a6e33207a80f16b65a217a8e52716c9303",
        "receiptsRoot": "0x4c002bc814f434bb6444d540fb4144172fb97cbc97733dc9562031a305dae6f1",
        "miner": "0x0000000000000000000000000000000000000000",
        "difficulty": "0x14",
        "totalDifficulty": "0x1ac4d50f",
        "extraData": "0xd682021083626f7288676f312e31382e33856c696e7578000000000000000000448d1ee49a9f16d8b56744e1d32d4c263ebb6e85620823845be5a3ada1e9ceb5410877b76c0ebd63ad922d6550e2280441a5a666f3aa1dcc4a42c2fe2a2b9d2700",
        "size": "0xa14c",
        "gasLimit": "0x1c9c380",
        "gasUsed": "0x81ff1c",
        "timestamp": "0x62d67b7d",
        "uncles": [],
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "transactions": [
            {
                "hash": "0x92bb0c20f3d256978eda3f75c369497c1a058351581cda26e5df3a96fdcfe15b",
                "nonce": "0x265df2",
                "transactionIndex": "0x0",
                "from": "0x4f27769c38169e402ffbb38b19f2606be60fdf97",
                "to": "0x7abba724a26d23aaca42d9b65cb4c35bbff1f577",
                "value": "0x0",
                "gasPrice": "0x45d964b800",
                "gas": "0x3d0900",
                "input": "0xb5cdffa8000000000000000000000000a34ab23406a237eec17af4d1496bfaadd2f48efd0000000000000000000000000000000000000000000000000000000000b7782f000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000018215cdb4f800000000000000000000000000000000000000000000000000000000000000034e465400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013323032322d30372d31395430393a33323a353900000000000000000000000000",
                "v": "0x136",
                "r": "0x5b2fd90ee53860af8e159e0bf14033d91ab6599948c4ca70ed31a41764d71c35",
                "s": "0x69333f5c60a3a9f7f040279f75fddb2a2b81803866d00c8072dc90a5334eaf01",
                "chainId": null,
                "blockHash": "0x8d9120cedf65b970b951c4b7a67c20075f32359bf19e310ecd1118d11a12bc69",
                "blockNumber": "0x1d763ed"
                ...
                          }
        ]
    }
}
```


# eth\_getTransactionByHash - Polygon

Polygon API - Returns the information about a transaction requested by transaction hash. In the response object, blockHash, blockNumber, and transactionIndex are null when the transaction is pending.

**Parameters**

`DATA`, 32 Bytes - hash of a transaction

```javascript
params: [
    "0x9231efdb89bdd07245c598f41a1dae91a4b7e77dc223721c5c92b45b2cc2ded3"
]
```

**Returns**

`Object` - A transaction object, or null when no transaction was found:

* `blockHash`: `DATA`, 32 Bytes - hash of the block where this transaction was in. null when its pending.
* `blockNumber`: `QUANTITY` - block number where this transaction was in. null when it's pending.
* `from`: `DATA`, 20 Bytes - address of the sender.
* `gas`: `QUANTITY` - gas provided by the sender.
* `gasPrice`: `QUANTITY` - gas price provided by the sender in Wei.
* `hash`: `DATA`, 32 Bytes - hash of the transaction.
* `input`: `DATA` - the data send along with the transaction.
* `nonce`: `QUANTITY` - the number of transactions made by the sender prior to this one.
* `to`: `DATA`, 20 Bytes - address of the receiver. null when it's a contract creation transaction.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position in the block. null when its pending.
* `value`: `QUANTITY` - value transferred in Wei.
* `v`: `QUANTITY` - ECDSA recovery id
* `r`: `DATA`, 32 Bytes - ECDSA signature r
* `s`: `DATA`, 32 Bytes - ECDSA signature s

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d'{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x9231efdb89bdd07245c598f41a1dae91a4b7e77dc223721c5c92b45b2cc2ded3"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionByHash",
    "params":["0x9231efdb89bdd07245c598f41a1dae91a4b7e77dc223721c5c92b45b2cc2ded3"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "hash": "0x9231efdb89bdd07245c598f41a1dae91a4b7e77dc223721c5c92b45b2cc2ded3",
        "nonce": "0xc740",
        "transactionIndex": "0x3a",
        "from": "0xaa26d58df560fad003738596a3a2bf9c910bfb2b",
        "to": "0x4e8966f70fb15f2dfd636610aaa8414dc573a61a",
        "value": "0x0",
        "gasPrice": "0x7029f90df",
        "gas": "0x24f0c",
        "maxFeePerGas": null,
        "maxPriorityFeePerGas": null,
        "input": "0xcf378343000000000000000000000000aa26d58df560fad003738596a3a2bf9c910bfb2b0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004b687474703a2f2f6170692e7975616e7368752e6172742f75706c6f6164732f70726f647563742f31643234313537363337326636373933373837636364633737326135363330622e6a7067000000000000000000000000000000000000000000",
        "v": "0x0",
        "r": "0x7cb3504c493cb96dc92056aa1fdf1dea8444c0758d1f6bd29417202f7a29314f",
        "s": "0x3bc7980400747474d4522732a782b10a9aec6f3e1430db9457291abb2595c6d7",
        "chainId": "0x89",
        "accessList": null,
        "blockHash": "0x8d9120cedf65b970b951c4b7a67c20075f32359bf19e310ecd1118d11a12bc69",
        "blockNumber": "0x1d763ed"
    }
}
```


# eth\_getTransactionCount - Polygon

Returns the number of transactions sent from an address.

**Parameters**

* `DATA`, 20 Bytes - address.
* `QUANTITY|TAG` - integer block number, or the string "latest", "earliest" or "pending".

```javascript
params: [
    '0x0e11795884b28b08f9978bb85938280967cda041',
    'latest' // state at the latest block
]
```

**Returns**

`QUANTITY` - integer of the number of transactions send from this address.

**Request example**

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

```bash
curl --location --request POST 'https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key' \
--header 'x-api-key: your_api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionCount",
    "params":["0x0e11795884b28b08f9978bb85938280967cda041","latest"],
    "id":1
}'
```

{% endtab %}

{% tab title="Postman" %}

```http
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionCount",
    "params":["0x0e11795884b28b08f9978bb85938280967cda041","latest"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "0xb6d7"
}
```


# eth\_getTransactionReceipt -Polygon

Returns the receipt of a transaction by transaction hash.

This can also be used to track the status of a transaction, since result will be null until the transaction is mined. However, unlike [`eth_getTransactionByHash`](/blockchain-apis/ethereum-api/eth_gettransactionbyhash) , which returns `null` for unknown transactions, and a non-null response with 3 `null` fields for a pending transaction, `eth_getTransactionReceipt` returns `null` for both pending and unknown transactions.

This call is also commonly used to get the contract address for a contract creation tx.

{% hint style="warning" %}
**Note:** the receipt is not available for pending transactions.
{% endhint %}

**Parameters**

`DATA`, 32 Bytes - hash of a transaction

```javascript
params: [ 
    '0x1bdff6b39cd8a3de4c4b61435da83014696d788f6e52672333471aa4d329bb19' 
]
```

**Returns**

`Object` - A transaction receipt object, or null when no receipt was found:

* `transactionHash`: `DATA`, 32 Bytes - hash of the transaction.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position in the block.
* `blockHash`: `DATA`, 32 Bytes - hash of the block where this transaction was in.
* `blockNumber`: `QUANTITY` - block number where this transaction was in.
* `from`: `DATA`, 20 Bytes - address of the sender.
* `to`: `DATA`, 20 Bytes - address of the receiver. null when its a contract creation transaction.
* `cumulativeGasUsed`: `QUANTITY` - The total amount of gas used when this transaction was executed in the block.
* `gasUsed`: `QUANTITY` - The amount of gas used by this specific transaction alone.
* `contractAddress`: `DATA`, 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null.
* `logs`: `Array` - Array of log objects, which this transaction generated.
* `logsBloom`: `DATA`, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs.

It also returns either:

* `status`: `QUANTITY` either 1 (success) or 0 (failure)

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x1bdff6b39cd8a3de4c4b61435da83014696d788f6e52672333471aa4d329bb19"],"id":0}
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionReceipt",
    "params":["0x1bdff6b39cd8a3de4c4b61435da83014696d788f6e52672333471aa4d329bb19"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": [
        {
            "blockHash": "0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923",
            "blockNumber": "0x1d765ac",
            "contractAddress": null,
            "cumulativeGasUsed": "0x1249a5e",
            "from": "0xaa26d58df560fad003738596a3a2bf9c910bfb2b",
            "gasUsed": "0x24f0c",
            "status": "0x1",
            "logsBloom": "0x00000000000000000000000000000000000000000000000004000000000000000020000800000000000008000000000000008000000000000000000000000000000000000000000000000008000000800000000000000000000100000000000000000000020000000000000000000800000000000000000080000010000000000000000000000000000040002000000000000000000000000000000000000000200000000000800000000000000000000000000000000000000000000000004000000002000000000001800000000000000000200000000000100000000020000000002000000000000000000000000010000000000000000000000000100002",
            "to": "0x4e8966f70fb15f2dfd636610aaa8414dc573a61a",
            "transactionHash": "0x1bdff6b39cd8a3de4c4b61435da83014696d788f6e52672333471aa4d329bb19",
            "transactionIndex": "0x78",
            "logs": [
                {
                    "address": "0x4e8966f70fb15f2dfd636610aaa8414dc573a61a",
                    "blockHash": "0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923",
                    "blockNumber": "0x1d765ac",
                    "data": "0x",
                    "logIndex": "0x220",
                    "topics": [
                        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
                        "0x0000000000000000000000000000000000000000000000000000000000000000",
                        "0x000000000000000000000000aa26d58df560fad003738596a3a2bf9c910bfb2b",
                        "0x000000000000000000000000000000000000000000000000000000000000c7be"
                    ],
                    "transactionHash": "0x1bdff6b39cd8a3de4c4b61435da83014696d788f6e52672333471aa4d329bb19",
                    "transactionIndex": "0x78"
                },
                {
                    "address": "0x0000000000000000000000000000000000001010",
                    "blockHash": "0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923",
                    "blockNumber": "0x1d765ac",
                    "data": "0x00000000000000000000000000000000000000000000000000125a7343361fcc000000000000000000000000000000000000000000000018f1e4319fed5e03ec000000000000000000000000000000000000000000000fdf081cae93df867638000000000000000000000000000000000000000000000018f1d1d72caa27e420000000000000000000000000000000000000000000000fdf082f090722bc9604",
                    "logIndex": "0x221",
                    "topics": [
                        "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63",
                        "0x0000000000000000000000000000000000000000000000000000000000001010",
                        "0x000000000000000000000000aa26d58df560fad003738596a3a2bf9c910bfb2b",
                        "0x00000000000000000000000046a3a41bd932244dd08186e4c19f1a7e48cbcdf4"
                    ],
                    "transactionHash": "0x1bdff6b39cd8a3de4c4b61435da83014696d788f6e52672333471aa4d329bb19",
                    "transactionIndex": "0x78"
                }
            ]
        }
    ]
}
```


# eth\_getBlockTransactionCountByHash - Polygon

Returns the number of transactions in a block matching the given block hash.

**Parameters**

* `DATA`, 32 Bytes - hash of a block.

  ```javascript
  params: [ 
      '0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923' 
  ]
  ```

**Returns**

* `QUANTITY` - integer of the number of transactions in this block.

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByHash","params":["0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBlockTransactionCountByHash",
    "params":["0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "0x90"
}
```


# eth\_getBlockTransactionCountByNumber - Polygon

Returns the number of transactions in a block matching the given block number.

**Parameters**

* `QUANTITY|TAG` - integer of a block number, or the string "earliest", "latest" or "pending", as in the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).

```javascript
params: [
    'latest',
]
```

**Returns**

* `QUANTITY` - integer of the number of transactions in this block.

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNumber","params":["latest"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBlockTransactionCountByNumber",
    "params":["latest"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "0x34"
}
```


# eth\_getTransactionByBlockHashAndIndex - Polygon

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

**Parameters**

`DATA`, 32 Bytes - hash of a block.

`QUANTITY` - integer of the transaction index position.

```javascript
params: [ 
    '0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923', 
    '0x0' // 0 
]
```

**Returns**

`Object` - A transaction object, or null when no transaction was found:

* `blockHash`: `DATA`, 32 Bytes - hash of the block where this transaction was in. null when its pending.
* `blockNumber`: `QUANTITY` - block number where this transaction was in. null when it's pending.
* `from`: `DATA`, 20 Bytes - address of the sender.
* `gas`: `QUANTITY` - gas provided by the sender.
* `gasPrice`: `QUANTITY` - gas price provided by the sender in Wei.
* `hash`: `DATA`, 32 Bytes - hash of the transaction.
* `input`: `DATA` - the data send along with the transaction.
* `nonce`: `QUANTITY` - the number of transactions made by the sender prior to this one.
* `to`: `DATA`, 20 Bytes - address of the receiver. null when it's a contract creation transaction.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position in the block. null when its pending.
* `value`: `QUANTITY` - value transferred in Wei.
* `v`: `QUANTITY` - ECDSA recovery id
* `r`: `DATA`, 32 Bytes - ECDSA signature r
* `s`: `DATA`, 32 Bytes - ECDSA signature s

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAndIndex","params":["0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923", "0x0"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionByBlockHashAndIndex",
    "params":["0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923", "0x0"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "hash": "0x925820c384c6fc3a25e7a20a278a74f7b7b553c86d19ca83e1fd058b2a321e92",
        "nonce": "0x140ce",
        "transactionIndex": "0x0",
        "from": "0xf89d7b9c864f589bbf53a82105107622b35eaa40",
        "to": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
        "value": "0x0",
        "gasPrice": "0x45d964b800",
        "gas": "0x15f90",
        "maxFeePerGas": null,
        "maxPriorityFeePerGas": null,
        "input": "0xa9059cbb000000000000000000000000066d141687540d1dcade71d1cee04110af504b3200000000000000000000000000000000000000000000000000000000000f4240",
        "v": "0x135",
        "r": "0x2afc3d8c451406c572c2d36f1608b6eabde6a6f5f61f3b560da78f87994e4dd1",
        "s": "0x938aef2c3bf18db3c131b8733a30fdff4183a9dbcfc20c8397200ff083567c",
        "chainId": null,
        "accessList": null,
        "blockHash": "0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923",
        "blockNumber": "0x1d765ac"
    }
}
```


# eth\_getTransactionByBlockNumberAndIndex - Polygon

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

**Parameters**

* `QUANTITY|TAG` - a block number, or the string "earliest", "latest" or "pending", as in the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#the-default-block-parameter).
* `QUANTITY` - the transaction index position.

```javascript
 params: [ 
     'latest', // 668 
     '0x0' // 0 
 ]
```

**Returns**

See [`eth_getTransactionByHash`](/blockchain-apis/ethereum-api/eth_gettransactionbyhash)

`Object` - A transaction object, or null when no transaction was found:

* `blockHash`: `DATA`, 32 Bytes - hash of the block where this transaction was in. null when its pending.
* `blockNumber`: `QUANTITY` - block number where this transaction was in. null when it's pending.
* `from`: `DATA`, 20 Bytes - address of the sender.
* `gas`: `QUANTITY` - gas provided by the sender.
* `gasPrice`: `QUANTITY` - gas price provided by the sender in Wei.
* `hash`: `DATA`, 32 Bytes - hash of the transaction.
* `input`: `DATA` - the data send along with the transaction.
* `nonce`: `QUANTITY` - the number of transactions made by the sender prior to this one.
* `to`: `DATA`, 20 Bytes - address of the receiver. null when it's a contract creation transaction.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position in the block. null when its pending.
* `value`: `QUANTITY` - value transferred in Wei.
* `v`: `QUANTITY` - ECDSA recovery id
* `r`: `DATA`, 32 Bytes - ECDSA signature r
* `s`: `DATA`, 32 Bytes - ECDSA signature s

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberAndIndex","params":["latest", "0x0"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionByBlockNumberAndIndex",
    "params":["latest", "0x0"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "hash": "0xda9e8d53405ac74ea0703f39103aeddfe5cccb5aa8595be63d07eb43a5a90cc8",
        "nonce": "0x593f",
        "transactionIndex": "0x0",
        "from": "0x75767b4d509319ab226fa04777ce15bc11b6189e",
        "to": "0x34ba5726d6f13147f0f13b0a705d0f3c10a74866",
        "value": "0x0",
        "gasPrice": "0x3a35294400",
        "gas": "0xdbda",
        "maxFeePerGas": null,
        "maxPriorityFeePerGas": null,
        "input": "0x1249c58b",
        "v": "0x1",
        "r": "0x5021bfdc87b62b33cce58a269bbb694ed18f93c33c6b3bbaf4dd70938299fa9d",
        "s": "0x67e0c554a7c07751f22d363dacb50a08cde1ba176e0705986e157478d50fda9",
        "chainId": "0x89",
        "accessList": null,
        "blockHash": "0x1285ad419f3e9bdd605fe6233a0624f9f7a62edc9e57ba5dee65af3c73afbfd5",
        "blockNumber": "0x1d76290"
    }
}
```


# eth\_getUncleCountByBlockHash - Polygon

Returns the number of uncles in a block matching the given block hash.

**Parameters**

* `DATA`, 32 Bytes - hash of a block.

```javascript
params: [
 '0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923'
]
```

**Returns**

`QUANTITY` - integer of the number of uncles in this block.

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockHash","params":["0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```http
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getUncleCountByBlockHash",
    "params":["0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
  "jsonrpc": "2.0",
  "id": 0,
  "result": "0x0"
}
```


# eth\_getUncleCountByBlockNumber - Polygon

Returns the number of uncles in a block matching the give block number.

**Parameters**

`QUANTITY|TAG` - integer of a block number, or the string "latest", "earliest" or "pending", see the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).

```javascript
 params: [ 
  'latest', // 232 
 ]
```

**Returns**

`QUANTITY` - integer of the number of uncles in this block.

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockNumber","params":["latest"],"id":1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getUncleCountByBlockNumber",
    "params":["latest"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
  "jsonrpc": "2.0",
  "id": 0,
  "result": "0x0"
}
```


# eth\_getLogs - Polygon

Returns an array of all logs matching a given filter object.

**Parameters**

`Object` - The filter options:

* `fromBlock`: `QUANTITY|TAG` - (optional, default: "latest") Value:
* Integer block number
* "latest" for the last mined block
* `address`: `DATA|Array`, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate.
* `topics`: `Array` of `DATA`, - (optional) Array of 32 Bytes DATA topics.
  * Topics are order-dependent. Each topic can also be an array of DATA with "or" options.
* `blockHash`: `DATA`, 32 Bytes - (optional) With the addition of EIP-234 (Geth >= v1.8.13 or Parity >= v2.1.0), blockHash is a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to fromBlock = toBlock = the block number with hash `blockHash`. **If blockHash is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed.**

```javascript
params: [
  {
    "address": "0x0000000000000000000000000000000000001010",
    "topics": [
      "0xe6497e3ee548a3372136af2fcb0696db31fc6cf20260707645068bd3fe97f3c4"
    ],
    "blockHash": "0x4acde13c82106a719dbe4751fccb70dee8df86975dd387db9f0c85745005c518"
  }
]
```

**Returns**

`Array` - Array of log objects, or an empty array if nothing has changed since last poll.

* `removed`: `TAG` - `true` when the log was removed, due to a chain reorganization. `false` if its a valid log.
* `logIndex`: `QUANTITY` - integer of the log index position in the block. `null` when its pending log.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position log was created from. `null` when its pending log.
* `transactionHash`: `DATA`, 32 Bytes - hash of the transactions this log was created from. `null` when its pending log.
* `blockHash`: `DATA`, 32 Bytes - hash of the block where this log was in. `null` when its pending. `null` when its pending log.
* `blockNumber`: `QUANTITY` - the block number where this log was in. `null` when its pending. `null` when its pending log.
* `address`: `DATA`, 20 Bytes - address from which this log originated.
* `data`: `DATA` - contains one or more 32 Bytes non-indexed arguments of the log.
* `topics`: `Array of DATA` - Array of 0 to 4 32 Bytes `DATA` of indexed log arguments.
  * In *solidity*: The first topic is the *hash* of the signature of the event (e.g. `Deposit(address,bytes32,uint256)`), except you declare the event with the `anonymous` specifier.

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"address": "0x0000000000000000000000000000000000001010","topics": ["0xe6497e3ee548a3372136af2fcb0696db31fc6cf20260707645068bd3fe97f3c4"],"blockHash": "0x4acde13c82106a719dbe4751fccb70dee8df86975dd387db9f0c85745005c518"}],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc": "2.0",
    "method": "eth_getLogs",
    "params": [
        {
            "address": "0x0000000000000000000000000000000000001010",
            "topics": [
                "0xe6497e3ee548a3372136af2fcb0696db31fc6cf20260707645068bd3fe97f3c4"
            ],
            "blockHash": "0x4acde13c82106a719dbe4751fccb70dee8df86975dd387db9f0c85745005c518"
        }
    ],
    "id": 0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": [
        {
            "address": "0x0000000000000000000000000000000000001010",
            "blockHash": "0x5529b5c5bae3ac668620357b2568fd16385c7a2f7efcaad003c5db409f9d0c8f",
            "blockNumber": "0x1d769f3",
            "data": "0x00000000000000000000000000000000000000000000002091222ecb6f9ccf96000000000000000000000000000000000000000000bd79b756dd8480b42942aa00000000000000000000000000000000000000000000000b01c7a2eecb8f32b3000000000000000000000000000000000000000000bd7996c5bb55b5448c731400000000000000000000000000000000000000000000002b92e9d1ba3b2c0249",
            "logIndex": "0x15",
            "topics": [
                "0xe6497e3ee548a3372136af2fcb0696db31fc6cf20260707645068bd3fe97f3c4",
                "0x0000000000000000000000000000000000000000000000000000000000001010",
                "0x0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270",
                "0x000000000000000000000000f2e4209afa4c3c9eaa3fb8e12eed25d8f328171c"
            ],
            "transactionHash": "0x95f3abcd1aff62b8f4116358d0e14a6b97ffe8dbab5fb6de38d7ff25aebfb630",
            "transactionIndex": "0x2",
            "removed": false
        },
        {
            "address": "0x0000000000000000000000000000000000001010",
            "blockHash": "0x5529b5c5bae3ac668620357b2568fd16385c7a2f7efcaad003c5db409f9d0c8f",
            "blockNumber": "0x1d769f3",
            "data": "0x00000000000000000000000000000000000000000000002091222ecb6f9ccf9600000000000000000000000000000000000000000000002b92e9d1ba3b2c02490000000000000000000000000000000000000000000000cf8c0df06442c1499200000000000000000000000000000000000000000000000b01c7a2eecb8f32b30000000000000000000000000000000000000000000000f01d301f2fb25e1928",
            "logIndex": "0x17",
            "topics": [
                "0xe6497e3ee548a3372136af2fcb0696db31fc6cf20260707645068bd3fe97f3c4",
                "0x0000000000000000000000000000000000000000000000000000000000001010",
                "0x000000000000000000000000f2e4209afa4c3c9eaa3fb8e12eed25d8f328171c",
                "0x0000000000000000000000007e243cbf9eee0f7cc269c220beaa1dd8a27eec38"
            ],
            "transactionHash": "0x95f3abcd1aff62b8f4116358d0e14a6b97ffe8dbab5fb6de38d7ff25aebfb630",
            "transactionIndex": "0x2",
            "removed": false
        },
        {
            "address": "0x0000000000000000000000000000000000001010",
            "blockHash": "0x5529b5c5bae3ac668620357b2568fd16385c7a2f7efcaad003c5db409f9d0c8f",
            "blockNumber": "0x1d769f3",
            "data": "0x0000000000000000000000000000000000000000000000000058d15e1762800000000000000000000000000000000000000000000000006bb0eaa4d9271b1d2000000000000000000000000000000000000000000000000000082bd50be3c08800000000000000000000000000000000000000000000006bb091d37b0fb89d200000000000000000000000000000000000000000000000000060fd3323464088",
            "logIndex": "0x56",
            "topics": [
                "0xe6497e3ee548a3372136af2fcb0696db31fc6cf20260707645068bd3fe97f3c4",
                "0x0000000000000000000000000000000000000000000000000000000000001010",
                "0x000000000000000000000000377de3d76d59bbfeb533ce2722c69f5294a520d3",
                "0x0000000000000000000000007652bead345ccf1196c7159480694005f3b96cb8"
            ],
            "transactionHash": "0xb026fad1e3c4790734ec72c297af6ee1ef3231a5b00d3ad27bf7d8caf9dd626b",
            "transactionIndex": "0x14",
            "removed": false
        }
    ]
}
```


# eth\_call - Polygon

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

**Parameters**

1. `Object` - The transaction call object

* `from`: `DATA`, 20 Bytes - (optional) The address the transaction is sent from.
* `to`: `DATA`, 20 Bytes - The address the transaction is directed to.
* `gas`: `QUANTITY` - (optional) Integer of the gas provided for the transaction execution. eth\_call consumes zero gas, but this parameter may be needed by some executions.
* `gasPrice`: `QUANTITY` - (optional) Integer of the gasPrice used for each paid gas
* `value`: `QUANTITY` - (optional) Integer of the value sent with this transaction
* `data`: `DATA` - (optional) Hash of the method signature and encoded parameters. For details see [Ethereum Contract ABI in the Solidity documentation](https://docs.soliditylang.org/en/latest/abi-spec.html)

```javascript
params: [
    {
        "from": "0xa53d90b608c930cb8cdff22048dc942708c4f263",
        "to": "0xa53d90b608c930cb8cdff22048dc942708c4f263"
    }, 
    "latest"
]
```

**Returns**

`DATA` - the return value of executed contract.

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_call","params":[{"from": "0xa53d90b608c930cb8cdff22048dc942708c4f263","to": "0xa53d90b608c930cb8cdff22048dc942708c4f263","latest"],"id":1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0xa53d90b608c930cb8cdff22048dc942708c4f263",
            "to": "0xce5f94f814906fbe7cd151c6ceb9095325612245"
        },
        "latest"
    ],
    "id": 1
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# eth\_chainId - Polygon

Returns the currently configured chain ID, a value used in replay-protected transaction signing as introduced by EIP-155.

**Parameters**

None.

**Returns**

`QUANTITY` - integer of the current chain ID.

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":83}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_chainId",
    "params":[],
    "id":83
}
```

{% endtab %}
{% endtabs %}

**Result**

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

###


# eth\_estimateGas - Polygon

Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain.

{% hint style="info" %}
Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance.
{% endhint %}

**Parameters**

* `Object` - The transaction call object
  * `from`: `DATA`, 20 Bytes - (optional) The address the transaction is sent from.
  * `to`: `DATA`, 20 Bytes - The address the transaction is directed to.
  * `gas`: `QUANTITY` - (optional) Integer of the gas provided for the transaction execution. `eth_estimateGas` consumes zero gas, but this parameter may be needed by some executions.
  * `gasPrice`: `QUANTITY` - (optional) Integer of the gasPrice used for each paid gas.
  * `value`: `QUANTITY` - (optional) Integer of the value sent with this transaction
  * `data`: `DATA` - (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI

**Returns**

`QUANTITY` - the amount of gas used.

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_estimateGas",
    "params": [
        {
            "from": "0xa53d90b608c930cb8cdff22048dc942708c4f263",
            "to": "0xce5f94f814906fbe7cd151c6ceb9095325612245",
        }
    ],
    "id": 1
}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc": "2.0",
    "method": "eth_estimateGas",
    "params": [
        {
            "from": "0xa53d90b608c930cb8cdff22048dc942708c4f263",
            "to": "0xce5f94f814906fbe7cd151c6ceb9095325612245"
        }
    ],
    "id": 1
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# eth\_gasPrice - Polygon

Returns the current price per gas in wei.

**Parameters**

none

**Returns**

`QUANTITY` - integer of the current gas price in wei.

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_gasPrice",
    "params":[],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "0x2cb2dec4a"
}
```


# eth\_getBalance - Polygon

Returns the balance of the account of a given address.

**Parameters**

1. `DATA`, 20 Bytes - address to check for balance.
2. `QUANTITY|TAG` - integer block number, or the string `"latest"`, `"earliest"` or `"pending"`, see the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).

```javascript
params: [
   '0xce5f94f814906fbe7cd151c6ceb9095325612245',
   'latest'
]
```

**Returns**

`QUANTITY` - integer of the current balance for the given address in wei.

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xce5f94f814906fbe7cd151c6ceb9095325612245", "latest"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBalance",
    "params":["0xce5f94f814906fbe7cd151c6ceb9095325612245", "latest"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "0x235bfe7702800e"
}
```


# eth\_getCode - Polygon

Returns code at a given address.

**Parameters**

* `DATA`, 20 Bytes - address.
* `QUANTITY|TAG` - integer block number, or the string "latest", "earliest" or "pending", see the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).

```javascript
params: [
    '0xce5f94f814906fbe7cd151c6ceb9095325612245',
    'latest'
]
```

**Returns**

* `DATA` - the code from the given address.

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_getCode","params":["0xce5f94f814906fbe7cd151c6ceb9095325612245", "latest"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getCode",
    "params":["0xce5f94f814906fbe7cd151c6ceb9095325612245", "latest"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# net\_version - Polygon

returns the current network id.

**Parameters**

none

**Returns**

`String` - The current network id.

* `"0x1"`: Ethereum Mainnet
* `"0x3"`: Ropsten Testnet

**Request example**

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

```bash
curl --location --request POST 'https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key' \
--header 'x-api-key: your_api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc":"2.0",
    "method":"net_version",
    "params":[],
    "id":1
}'
```

{% endtab %}

{% tab title="Postman" %}

```http
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"net_version",
    "params":[],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "137"
}
```


# eth\_getStorageAt - Polygon

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

**Parameters**

* `DATA`, 20 Bytes - address of the storage.
* `QUANTITY` - integer of the position in the storage.
* `QUANTITY|TAG` - integer block number, or the string "latest", "earliest" or "pending", see the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).

**Returns**

* `DATA` - the value at this storage position.

**Example**

Calculating the correct position depends on the storage to retrieve. Consider the following contract deployed at `0x295a70b2de5e3953354a6a8344e616ed314d7251` by address `0x391694e7e0b0cce554cb130d723a9d27458f9298`.

```javascript
contract Storage {
    uint pos0;
    mapping(address => uint) pos1;
    function Storage() {
        pos0 = 1234;
        pos1[msg.sender] = 5678;
    }
}
```

Retrieving the value of `pos0` is straight forward:

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0", "method": "eth_getStorageAt", "params": ["0xa53d90b608c930cb8cdff22048dc942708c4f263", "0x0", "latest"], "id": 1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{{
    "jsonrpc":"2.0",
    "method":"eth_getStorageAt",
    "params":["0xa53d90b608c930cb8cdff22048dc942708c4f263", "0x0", "latest"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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

Retrieving an element of the map is harder. The position of an element in the map is calculated with:

```javascript
keccack(LeftPad32(key, 0), LeftPad32(map position, 0))
```

This means to retrieve the storage on `pos1[“0x391694e7e0b0cce554cb130d723a9d27458f9298”]` we need to calculate the position with:

```javascript
keccak(decodeHex("000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298" + "0000000000000000000000000000000000000000000000000000000000000001"))
```

The geth console which comes with the web3 library can be used to make the calculation:

```bash
> var key = "000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298" + "0000000000000000000000000000000000000000000000000000000000000001"
undefined
> web3.sha3(key, {"encoding": "hex"})
"0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9"
```

Now to fetch the storage:

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0", "method": "eth_getStorageAt", "params": ["0xa53d90b608c930cb8cdff22048dc942708c4f263", "0x4acde13c82106a719dbe4751fccb70dee8df86975dd387db9f0c85745005c518", "latest"], "id": 1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getStorageAt",
    "params":["0xa53d90b608c930cb8cdff22048dc942708c4f263", "0x4acde13c82106a719dbe4751fccb70dee8df86975dd387db9f0c85745005c518", "latest"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# eth\_sendRawTransaction - Polygon

Creates new message call transaction or a contract creation for signed transactions.

**Parameters**

`DATA`, The signed transaction data.

```javascript
params: ["0x29adbbaf99a3f97b2baefa11e865cf9d74435716ef8618caaa388619f5ae7d8e5d2cadab0cd2f5becd4ebf7d48f5584c9e414c2a4a6ea2bc6ea8f02dbf5675cd01"]
```

**Returns**

`DATA`, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available.

Use [`eth_getTransactionReceipt`](/blockchain-apis/ethereum-api/eth_gettransactionreceipt) to get the contract address after the transaction was mined when you created a contract.

**Request example**

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

```bash
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0x29adbbaf99a3f97b2baefa11e865cf9d74435716ef8618caaa388619f5ae7d8e5d2cadab0cd2f5becd4ebf7d48f5584c9e414c2a4a6ea2bc6ea8f02dbf5675cd01"],"id":1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_sendRawTransaction",
    "params":["0x29adbbaf99a3f97b2baefa11e865cf9d74435716ef8618caaa388619f5ae7d8e5d2cadab0cd2f5becd4ebf7d48f5584c9e414c2a4a6ea2bc6ea8f02dbf5675cd01"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# Binance Smart Chain API

Below you will find the api documentation for the standard BSC JSON-RPC calls that WatchData supports.

## Binance Smart Chain API overview

<table><thead><tr><th>Blockchain</th><th width="158.06635071090045">Chain</th><th>URL</th></tr></thead><tbody><tr><td>Binance Smart Chain</td><td>Mainnet</td><td>https://bsc.api.watchdata.io/node/jsonrpc</td></tr></tbody></table>

### Includes the following endpoints:

{% content-ref url="/pages/nVzaNoPiknHDZ6dBwHlx" %}
[eth\_blockNumber](/blockchain-apis/ethereum-api/eth_blocknumber)
{% endcontent-ref %}

{% content-ref url="/pages/bKhMaO26xISjvC7wuhHC" %}
[eth\_getBlockByHash](/blockchain-apis/ethereum-api/eth_getblockbyhash)
{% endcontent-ref %}

{% content-ref url="/pages/TUMtj5MbQgG6CIvngp7G" %}
[eth\_getBlockByNumber](/blockchain-apis/ethereum-api/eth_getblockbynumber)
{% endcontent-ref %}

{% content-ref url="/pages/lWZpEjgxW0LAxMTF3Gc2" %}
[eth\_getTransactionByHash](/blockchain-apis/ethereum-api/eth_gettransactionbyhash)
{% endcontent-ref %}

{% content-ref url="/pages/8P8D74q9Qelc8by5Kt6d" %}
[eth\_getTransactionReceipt](/blockchain-apis/ethereum-api/eth_gettransactionreceipt)
{% endcontent-ref %}

{% content-ref url="/pages/0tP0l3hCYo4IWxNtAltj" %}
[eth\_getBlockTransactionCountByHash](/blockchain-apis/ethereum-api/eth_getblocktransactioncountbyhash)
{% endcontent-ref %}

{% content-ref url="/pages/b4re7zRL6y90s6WKD8Nf" %}
[eth\_getUncleCountByBlockNumber](/blockchain-apis/ethereum-api/eth_getunclecountbyblocknumber)
{% endcontent-ref %}

{% content-ref url="/pages/rV3y4d2NXiNVpcKzeUwK" %}
[eth\_getTransactionByBlockNumberAndIndex](/blockchain-apis/ethereum-api/eth_gettransactionbyblocknumberandindex)
{% endcontent-ref %}

{% content-ref url="/pages/Z4tKMjaUhfFHMsUpf1Xh" %}
[eth\_getTransactionByBlockHashAndIndex](/blockchain-apis/ethereum-api/eth_gettransactionbyblockhashandindex)
{% endcontent-ref %}

{% content-ref url="/pages/YP0WnxJuruiHRdrqY678" %}
[eth\_getUncleCountByBlockHash](/blockchain-apis/ethereum-api/eth_getunclecountbyblockhash)
{% endcontent-ref %}

{% content-ref url="/pages/b4re7zRL6y90s6WKD8Nf" %}
[eth\_getUncleCountByBlockNumber](/blockchain-apis/ethereum-api/eth_getunclecountbyblocknumber)
{% endcontent-ref %}

{% content-ref url="/pages/PqGh75vtYinH7qZen90p" %}
[eth\_getLogs](/blockchain-apis/ethereum-api/eth_getlogs)
{% endcontent-ref %}

{% content-ref url="/pages/JXumx7FeneXWg2l0pEyO" %}
[eth\_call](/blockchain-apis/ethereum-api/eth_call)
{% endcontent-ref %}

{% content-ref url="/pages/RQFWCv8s3AB5gUQzmfjy" %}
[eth\_chainId](/blockchain-apis/ethereum-api/eth_chainid)
{% endcontent-ref %}

{% content-ref url="/pages/5ErHosGOADKlWmFivHG0" %}
[eth\_estimateGas](/blockchain-apis/ethereum-api/eth_estimategas)
{% endcontent-ref %}

{% content-ref url="/pages/hhM1bQipMTliNUFLTzyW" %}
[eth\_gasPrice](/blockchain-apis/ethereum-api/eth_gasprice)
{% endcontent-ref %}

{% content-ref url="/pages/u8HOnyliVA7LKfDGiOCO" %}
[eth\_getBalance](/blockchain-apis/ethereum-api/eth_getbalance)
{% endcontent-ref %}

{% content-ref url="/pages/vl88rifx6qEr6KNVeB71" %}
[eth\_getCode](/blockchain-apis/ethereum-api/eth_getcode)
{% endcontent-ref %}

{% content-ref url="/pages/AV98nS7xG1Y7QggKiBJF" %}
[eth\_getStorageAt](/blockchain-apis/ethereum-api/eth_getstorageat)
{% endcontent-ref %}

{% content-ref url="/pages/XGX2wZ93cbIayXx6hgA5" %}
[eth\_sendRawTransaction](/blockchain-apis/ethereum-api/eth_sendrawtransaction)
{% endcontent-ref %}


# eth\_blockNumber (BSC)

Returns the number of the most recent block.

**Parameters**

none

**Returns**

`QUANTITY` - integer of the current block number the client is on.

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_blockNumber",
    "params":[],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "0x119987e"
}
```


# eth\_getBlockByHash (BSC)

Returns information about a block by hash.

**Parameters**

* `DATA`, 32 Bytes - Hash of a block.
* `Boolean` - If true it returns the full transaction objects, if false it returns only the hashes of the transactions.

```javascript
params: [
    '0x4425074cc8907ed79c1ad7d3909bd4e01daf620717b9b704d211f01ab97174d2',
    false
]
```

**Returns**

`Object` - A block object with the following fields, or null when no block was found:

* `number`: QUANTITY - the block number. null when its pending block.
* `hash`: DATA, 32 Bytes - hash of the block. null when its pending block.
* `parentHash`: DATA, 32 Bytes - hash of the parent block.
* `nonce`: DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block.
* `sha3Uncles`: DATA, 32 Bytes - SHA3 of the uncles data in the block.
* `logsBloom`: DATA, 256 Bytes - the bloom filter for the logs of the block. null when its pending block.
* `transactionsRoot`: DATA, 32 Bytes - the root of the transaction trie of the block.
* `stateRoot`: DATA, 32 Bytes - the root of the final state trie of the block.
* `receiptsRoot`: DATA, 32 Bytes - the root of the receipts trie of the block.
* `miner`: DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.
* `difficulty`: QUANTITY - integer of the difficulty for this block.
* `totalDifficulty`: QUANTITY - integer of the total difficulty of the chain until this block.
* `extraData`: DATA - the "extra data" field of this block.
* `size`: QUANTITY - integer the size of this block in bytes.
* `gasLimit`: QUANTITY - the maximum gas allowed in this block.
* `gasUsed`: QUANTITY - the total used gas by all transactions in this block.
* `timestamp`: QUANTITY - the unix timestamp for when the block was collated.
* `transactions`: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.
* `uncles`: Array - Array of uncle hashes.
* `baseFeePerGas` - the minimum fee per gas required for a transaction to be included in the block.
* `mixHash` – a unique identifier for that block.

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d --data-raw '{"jsonrpc":"2.0", "method":"eth_getBlockByHash", "params":["0x4425074cc8907ed79c1ad7d3909bd4e01daf620717b9b704d211f01ab97174d2", true], "id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBlockByHash",
    "params":["0x4425074cc8907ed79c1ad7d3909bd4e01daf620717b9b704d211f01ab97174d2", true],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "number": "0x1199b94",
        "hash": "0x4425074cc8907ed79c1ad7d3909bd4e01daf620717b9b704d211f01ab97174d2",
        "parentHash": "0x6692eabe0f021be8bc1f61a26783c980ba83819c3775ee30aac076cba91fe852",
        "nonce": "0x0000000000000000",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "logsBloom": "0xb2e8bfdfc3f69a700d2b01b1c19653a6da53e1d0dec7bfc61df5dc767e5aade94d6523eed2205c69fbc0c8f7deea9e7e1f4a8acadf6ccefd75f8515c7ba52eb851d2b2d5d46501e7edd16f2e94317329357d5a3d87d46ca6a32d6db9e46b29ad0556dea8a7278702b563637933b2da7fcf00d348c88dd5ecd763661d066ee441de711bd5b27b3e84d6890e22bdcabd9c04adc54d25e9e82db97f746be8c99cb59f83997ede19f6faa47df3f92b0f499cecb0db432de283ee9a5a60ebc1aad3efe5b3ebe733bd87ee06f0b4b78fb2b0e77d8e92d6121d91195ab35efa5ee8eabcfcd13fe9099356112f3ddf9f48d2110ef48c77dae942794fab690cbc8bb43c11",
        "transactionsRoot": "0x5c47e8663913595b8e07c964cef7ef4d4a8291e066b337801beb8753c1e7bfe0",
        "stateRoot": "0x48500726c3fb40a0fd37d7fe66910f28e93b8b7a4c92c29c73b86ff032ae2633",
        "receiptsRoot": "0xbe0eaa0aa7501a191969479a8ee56ce6d7cd4a442479d1566657b41a608a47ce",
        "miner": "0xbe807dddb074639cd9fa61b47676c064fc50d62c",
        "difficulty": "0x2",
        "totalDifficulty": "0x22fc874",
        "extraData": "0xd88301010a846765746888676f312e31332e34856c696e7578000000c3167bdfc97ba29d7f3aa7035ec84973ae6a41db900e94cec4e03869d82b06bea321cac76534b98d3e1cf187e54f3083201aa957e308d1a6698d45889ab7a475190181c701",
        "size": "0xb4f8",
        "gasLimit": "0x5e3f27b",
        "gasUsed": "0x13d3d02",
        "timestamp": "0x629e171b",
        "uncles": [],
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "transactions": [
            {
                "hash": "0xdcfd6d5c8f0f0c8232b7ad4ca453962d69f4ddb69dbf9e4c1c9c9c1fe0556c27",
                "nonce": "0x10a",
                "transactionIndex": "0x0",
                "from": "0xde586805d97bb06c8fa95534daef7ed75aa15434",
                "to": "0x1111111254fb6c44bac0bed2854e76f90643097d",
                "value": "0x29a2241af62c0000",
                "gasPrice": "0x5d21dba00",
                "gas": "0x51898",
                "input": "0x7c0252000000000000000000000000009c4350f527ff7f96b650ee894ae9103bdfec043200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000950481789959cd6d77f1b88c2e1f61e30608c4e20000000000000000000000009c4350f527ff7f96b650ee894ae9103bdfec0432000000000000000000000000de586805d97bb06c8fa95534daef7ed75aa1543400000000000000000000000000000000000000000000000029a2241af62c00000000000000000000000000000000000000000000000000bf63648a240381a61d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000360000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c00000000000000000000000000000000000000000000000029a2241af62c000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004d0e30db0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000d19ffffac783a7e9f3bb8ceaee41aa42ffd31e1b00000000000000000000000000000000000000000000000029a2241af62c00000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a4b757fed6000000000000000000000000d19ffffac783a7e9f3bb8ceaee41aa42ffd31e1b000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000950481789959cd6d77f1b88c2e1f61e30608c4e20000000000000000002625a09c4350f527ff7f96b650ee894ae9103bdfec0432000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000018414284aab00000000000000000000000000000000000000000000000000000000000000808000000000000000000000000000000000000000000000000000000000000044000000000000000000000000950481789959cd6d77f1b88c2e1f61e30608c4e200000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000950481789959cd6d77f1b88c2e1f61e30608c4e20000000000000000000000001111111254fb6c44bac0bed2854e76f90643097d00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000cfee7c08",
                "v": "0x94",
                "r": "0x4982849e813e9e5ffd4406133767c37370b281112cf7a3e1363e89d83b852e35",
                "s": "0x7bc568bb5852760acceff89877e1710a79dd7ac0cacdf58a1ddc3cea9c1335da",
                "chainId": "0x38",
                "blockHash": "0x4425074cc8907ed79c1ad7d3909bd4e01daf620717b9b704d211f01ab97174d2",
                "blockNumber": "0x1199b94"
                         }
        ]
    }
}
```


# eth\_getBlockByNumber (BSC)

Returns information about a block by block number.

**Parameters**

* `QUANTITY|TAG` - integer of a block number, or the string "earliest", "latest" or "pending", as in the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).
* `Boolean` - If true it returns the full transaction objects, if false only the hashes of the transactions.

```javascript
params: [
    '0x119B705', 
    true
]
```

**Returns**

See [`eth_getBlockByHash`](/blockchain-apis/ethereum-api/eth_getblockbyhash)

`Object` - A block object with the following fields, or null when no block was found:

* `number`: QUANTITY - the block number. null when its pending block.
* `hash`: DATA, 32 Bytes - hash of the block. null when its pending block.
* `parentHash`: DATA, 32 Bytes - hash of the parent block.
* `nonce`: DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block.
* `sha3Uncles`: DATA, 32 Bytes - SHA3 of the uncles data in the block.
* `logsBloom`: DATA, 256 Bytes - the bloom filter for the logs of the block. null when its pending block.
* `transactionsRoot`: DATA, 32 Bytes - the root of the transaction trie of the block.
* `stateRoot`: DATA, 32 Bytes - the root of the final state trie of the block.
* `receiptsRoot`: DATA, 32 Bytes - the root of the receipts trie of the block.
* `miner`: DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.
* `difficulty`: QUANTITY - integer of the difficulty for this block.
* `totalDifficulty`: QUANTITY - integer of the total difficulty of the chain until this block.
* `extraData`: DATA - the "extra data" field of this block.
* `size`: QUANTITY - integer the size of this block in bytes.
* `gasLimit`: QUANTITY - the maximum gas allowed in this block.
* `gasUsed`: QUANTITY - the total used gas by all transactions in this block.
* `timestamp`: QUANTITY - the unix timestamp for when the block was collated.
* `transactions`: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.
* `uncles`: Array - Array of uncle hashes.
* `baseFeePerGas` - the minimum fee per gas required for a transaction to be included in the block.
* `mixHash` – a unique identifier for that block.

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x119B705", true],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBlockByNumber",
    "params":["0x119B705", true],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "number": "0x119b705",
        "hash": "0x0df2cfd6a75770c9b5103c6deb51318d44081e8f1ddc2b5828510a603a4544ce",
        "parentHash": "0x261974b63eea921cfc9be27f4155d84a4724679b30cd83ce92b91e918b82a660",
        "nonce": "0x0000000000000000",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "logsBloom": "0x983063000c198152b44840c091880112ad6b1c4b3621011a455106e8814a4f03cf76e0e414221225c38070880206b004f969960b19f8fe28400cec156aa40aa34b1745926df9423241276ee852557bf237d94b3caae6abc1a59f8889d058a3a812ca3b22d623e251365b10703254cb668965df5bb69c44d6c421d11be442de015a2725038c1f70262c956f86b8f867e0382db50d1c2449c88f388e59aba88bb08601c14e04cad802a007f8014b7e4ce86c34a95321af8d64d262a283891b675e22ce7d8e09e812be27c4060604925668709b23104dea6450504e320a8e38f020b0b0d5820148760c057c98996c07572462144e048945145ca90a409c9a099f5a",
        "transactionsRoot": "0xb7b85c12c7bb213f2108c02f185054433b324436e2398923851e2b0c05b0ce9c",
        "stateRoot": "0x8173efc9fad6f885130c0f9abef78109b52c698986ca6c8dfd2ace4a62d86e90",
        "receiptsRoot": "0xbe937a9da3d388edce6157cd844c3b3b42128d82edf497dcc1c39c6ccd3ec98c",
        "miner": "0x3f349bbafec1551819b8be1efea2fc46ca749aa1",
        "difficulty": "0x2",
        "totalDifficulty": "0x22ffe74",
        "extraData": "0xd883010109846765746888676f312e31372e36856c696e7578000000c3167bdfc7a004af88244c093280c2ee514e2a07371fd57dab056da28bdcab99339115b41ee7ee6e85a738fecf091ad312159ce682d9a0ea42734ec36b94cfadc381056100",
        "size": "0x9e53",
        "gasLimit": "0x48da4bf",
        "gasUsed": "0xfcedaf",
        "timestamp": "0x629e6b2e",
        "uncles": [],
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "transactions": [
            {
                "hash": "0x097573dc0a4512673878362f63382c74b74e5ef45972b0d3c8be2d2d59105cc3",
                "nonce": "0x10e88c",
                "transactionIndex": "0x0",
                "from": "0x90f729f31e20c58b93a7092f1e10bdae9cc4d82b",
                "to": "0x6fa0ae33263e500a6aba7535e5837c8766769847",
                "value": "0x0",
                "gasPrice": "0x3ad9a2d3ae",
                "gas": "0x35b62",
                "input": "0x0000167800000000000006154845044400000000000000267e4ef19e4f160000429cf6bb26f5f63b00b58bb57f6c06db6a2339070d265528b380773747286d8c2b389f286d52b2d546f1ee7678d100eecad33030c798da5c8f8774b6a39fae699901ff8c276751e691f6ac99f76bf1e332",
                "v": "0x93",
                "r": "0x573630ff7be77c9fa9336d2336c8ea7556a69be05f060a0ebd166ef8ec54cd72",
                "s": "0x60bdc76e0af015400d794988c5a048c33a1294384027c92ae566ec11f068110b",
                "chainId": "0x38",
                "blockHash": "0x0df2cfd6a75770c9b5103c6deb51318d44081e8f1ddc2b5828510a603a4544ce",
                "blockNumber": "0x119b705"
                          }
        ]
    }
}
```


# eth\_getTransactionCount (BSC)

Returns the number of transactions sent from an address.

**Parameters**

* `DATA`, 20 Bytes - address.
* `QUANTITY|TAG` - integer block number, or the string "latest", "earliest" or "pending".

```javascript
params: [
    '0xea0A6E3c511bbD10f4519EcE37Dc24887e11b55d',
    'latest' // state at the latest block
]
```

**Returns**

`QUANTITY` - integer of the number of transactions send from this address.

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
--header 'x-api-key: your_api_key' \
--header 'Content-Type: application/json' \
--data-raw '{"jsonrpc":"2.0", "method":"eth_getTransactionCount", "params":["0xea0A6E3c511bbD10f4519EcE37Dc24887e11b55d","latest"], "id":1}'
```

{% endtab %}

{% tab title="Postman" %}

```http
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionCount",
    "params":["0xea0A6E3c511bbD10f4519EcE37Dc24887e11b55d","latest"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# eth\_getTransactionByHash (BSC)

Returns the information about a transaction requested by transaction hash. In the response object, \`blockHash\`, \`blockNumber\`, and \`transactionIndex\` are \`null\` when the transaction is pending.

**Parameters**

`DATA`, 32 Bytes - hash of a transaction

```javascript
params: [
    "0xfaa094639848ffa5c0adb4e3a23f02e8b18a505e4c94a02f913c17bcae4814e8"
]
```

**Returns**

`Object` - A transaction object, or null when no transaction was found:

* `blockHash`: `DATA`, 32 Bytes - hash of the block where this transaction was in. null when its pending.
* `blockNumber`: `QUANTITY` - block number where this transaction was in. null when it's pending.
* `from`: `DATA`, 20 Bytes - address of the sender.
* `gas`: `QUANTITY` - gas provided by the sender.
* `gasPrice`: `QUANTITY` - gas price provided by the sender in Wei.
* `hash`: `DATA`, 32 Bytes - hash of the transaction.
* `input`: `DATA` - the data send along with the transaction.
* `nonce`: `QUANTITY` - the number of transactions made by the sender prior to this one.
* `to`: `DATA`, 20 Bytes - address of the receiver. null when it's a contract creation transaction.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position in the block. null when its pending.
* `value`: `QUANTITY` - value transferred in Wei.
* `v`: `QUANTITY` - ECDSA recovery id
* `r`: `DATA`, 32 Bytes - ECDSA signature r
* `s`: `DATA`, 32 Bytes - ECDSA signature s

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d'{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0xfaa094639848ffa5c0adb4e3a23f02e8b18a505e4c94a02f913c17bcae4814e8"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionByHash",
    "params":["0xfaa094639848ffa5c0adb4e3a23f02e8b18a505e4c94a02f913c17bcae4814e8"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "hash": "0xfaa094639848ffa5c0adb4e3a23f02e8b18a505e4c94a02f913c17bcae4814e8",
        "nonce": "0xe110a",
        "transactionIndex": "0x62",
        "from": "0xea0a6e3c511bbd10f4519ece37dc24887e11b55d",
        "to": "0x0000000000000000000000000000000000001000",
        "value": "0x12c438e2772cae5",
        "gasPrice": "0x0",
        "gas": "0x7fffffffffffffff",
        "input": "0xf340fa01000000000000000000000000ea0a6e3c511bbd10f4519ece37dc24887e11b55d",
        "v": "0x94",
        "r": "0xf23e3c81c405683ad83a01648470eb042981a76682a8465f01423bf0b00e9f91",
        "s": "0x30b752f7cbc98fb5e9a45ca75771084783dae99bf2ddc2b56f914bb167dad66a",
        "chainId": "0x38",
        "blockHash": "0x18b8e20d83a9c9636c6e9828157b1d684934e3e4c540531831460f9c8be60b9f",
        "blockNumber": "0x119b752"
    }
}
```


# eth\_getTransactionReceipt (BSC)

Returns the receipt of a transaction by transaction hash.

**Parameters**

`DATA`, 32 Bytes - hash of a transaction

```javascript
params: [ 
    '0xfaa094639848ffa5c0adb4e3a23f02e8b18a505e4c94a02f913c17bcae4814e8' 
]
```

**Returns**

`Object` - A transaction receipt object, or null when no receipt was found:

* `transactionHash`: `DATA`, 32 Bytes - hash of the transaction.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position in the block.
* `blockHash`: `DATA`, 32 Bytes - hash of the block where this transaction was in.
* `blockNumber`: `QUANTITY` - block number where this transaction was in.
* `from`: `DATA`, 20 Bytes - address of the sender.
* `to`: `DATA`, 20 Bytes - address of the receiver. null when its a contract creation transaction.
* `cumulativeGasUsed`: `QUANTITY` - The total amount of gas used when this transaction was executed in the block.
* `gasUsed`: `QUANTITY` - The amount of gas used by this specific transaction alone.
* `contractAddress`: `DATA`, 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null.
* `logs`: `Array` - Array of log objects, which this transaction generated.
* `logsBloom`: `DATA`, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs.

It also returns either:

* `status`: `QUANTITY` either 1 (success) or 0 (failure)

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0xfaa094639848ffa5c0adb4e3a23f02e8b18a505e4c94a02f913c17bcae4814e8"],"id":0}
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionReceipt",
    "params":["0xfaa094639848ffa5c0adb4e3a23f02e8b18a505e4c94a02f913c17bcae4814e8"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": [
        {
            "blockHash": "0x18b8e20d83a9c9636c6e9828157b1d684934e3e4c540531831460f9c8be60b9f",
            "blockNumber": "0x119b752",
            "contractAddress": null,
            "cumulativeGasUsed": "0xe443dc",
            "from": "0xea0a6e3c511bbd10f4519ece37dc24887e11b55d",
            "gasUsed": "0x6a20",
            "status": "0x1",
            "effectiveGasPrice": "0x0",
            "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002010000000000000000000000000000000200020000200000000000000000000080000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000002000000000000000000000000010000000000000000000000000000000000000080000000",
            "to": "0x0000000000000000000000000000000000001000",
            "transactionHash": "0xfaa094639848ffa5c0adb4e3a23f02e8b18a505e4c94a02f913c17bcae4814e8",
            "transactionIndex": "0x62",
            "logs": [
                {
                    "address": "0x0000000000000000000000000000000000001000",
                    "blockHash": "0x18b8e20d83a9c9636c6e9828157b1d684934e3e4c540531831460f9c8be60b9f",
                    "blockNumber": "0x119b752",
                    "data": "0x000000000000000000000000000000000000000000000000001e06c16a58477d",
                    "logIndex": "0x1bf",
                    "topics": [
                        "0x627059660ea01c4733a328effb2294d2f86905bf806da763a89cee254de8bee5"
                    ],
                    "transactionHash": "0xfaa094639848ffa5c0adb4e3a23f02e8b18a505e4c94a02f913c17bcae4814e8",
                    "transactionIndex": "0x62"
                },
                {
                    "address": "0x0000000000000000000000000000000000001000",
                    "blockHash": "0x18b8e20d83a9c9636c6e9828157b1d684934e3e4c540531831460f9c8be60b9f",
                    "blockNumber": "0x119b752",
                    "data": "0x000000000000000000000000000000000000000000000000010e3cccbd1a8368",
                    "logIndex": "0x1c0",
                    "topics": [
                        "0x93a090ecc682c002995fad3c85b30c5651d7fd29b0be5da9d784a3302aedc055",
                        "0x000000000000000000000000ea0a6e3c511bbd10f4519ece37dc24887e11b55d"
                    ],
                    "transactionHash": "0xfaa094639848ffa5c0adb4e3a23f02e8b18a505e4c94a02f913c17bcae4814e8",
                    "transactionIndex": "0x62"
                }
            ]
        }
    ]
}
```


# eth\_getBlockTransactionCountByHash (BSC)

Returns the number of transactions in a block matching the given block hash.

**Parameters**

* `DATA`, 32 Bytes - hash of a block.

  ```javascript
  params: [ 
      '0x18b8e20d83a9c9636c6e9828157b1d684934e3e4c540531831460f9c8be60b9f' 
  ]
  ```

**Returns**

* `QUANTITY` - integer of the number of transactions in this block.

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByHash","params":["0x18b8e20d83a9c9636c6e9828157b1d684934e3e4c540531831460f9c8be60b9f"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBlockTransactionCountByHash",
    "params":["0x18b8e20d83a9c9636c6e9828157b1d684934e3e4c540531831460f9c8be60b9f"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "0x63"
}
```


# eth\_getBlockTransactionCountByNumber (BSC)

Returns the number of transactions in a block matching the given block number.

**Parameters**

* `QUANTITY|TAG` - integer of a block number, or the string "earliest", "latest" or "pending", as in the [default block parameter.](https://ethereum.org/en/developers/docs/apis/json-rpc/#the-default-block-parameter)

```javascript
params: [
    'latest',
]
```

**Returns**

* `QUANTITY` - integer of the number of transactions in this block.

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNumber","params":["latest"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBlockTransactionCountByNumber",
    "params":["latest"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "0x95"
}
```


# eth\_getTransactionByBlockHashAndIndex (BSC)

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

**Parameters**

`DATA`, 32 Bytes - hash of a block.

`QUANTITY` - integer of the transaction index position.

```javascript
params: [ 
    '0xc0f4906fea23cf6f3cce98cb44e8e1449e455b28d684dfa9ff65426495584de6', 
    '0x0' // 0 
]
```

**Returns**

See [`eth_getTransactionByHash`](/blockchain-apis/ethereum-api/eth_gettransactionbyhash)

`Object` - A transaction object, or null when no transaction was found:

* `blockHash`: `DATA`, 32 Bytes - hash of the block where this transaction was in. null when its pending.
* `blockNumber`: `QUANTITY` - block number where this transaction was in. null when it's pending.
* `from`: `DATA`, 20 Bytes - address of the sender.
* `gas`: `QUANTITY` - gas provided by the sender.
* `gasPrice`: `QUANTITY` - gas price provided by the sender in Wei.
* `hash`: `DATA`, 32 Bytes - hash of the transaction.
* `input`: `DATA` - the data send along with the transaction.
* `nonce`: `QUANTITY` - the number of transactions made by the sender prior to this one.
* `to`: `DATA`, 20 Bytes - address of the receiver. null when it's a contract creation transaction.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position in the block. null when its pending.
* `value`: `QUANTITY` - value transferred in Wei.
* `v`: `QUANTITY` - ECDSA recovery id
* `r`: `DATA`, 32 Bytes - ECDSA signature r
* `s`: `DATA`, 32 Bytes - ECDSA signature s

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAndIndex","params":["0x18b8e20d83a9c9636c6e9828157b1d684934e3e4c540531831460f9c8be60b9f", "0x0"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionByBlockHashAndIndex",
    "params":["0x18b8e20d83a9c9636c6e9828157b1d684934e3e4c540531831460f9c8be60b9f", "0x0"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "hash": "0xb856fb2cc766b2fedf25ec7e235fd1a380fee672a76a5f78af3e077988455d87",
        "nonce": "0x3a6af",
        "transactionIndex": "0x0",
        "from": "0xf5b4c4e9e8fb4b0cc961197b6c512c66dcf55e01",
        "to": "0x18b2a687610328590bc8f2e5fedde3b582a49cda",
        "value": "0x0",
        "gasPrice": "0x59682f000",
        "gas": "0x7a120",
        "input": "0x7b3205f5",
        "v": "0x94",
        "r": "0xa7b6fa0bb3c20e0e5e82d44357790f93a2219d4688b0e99b99cc385bc6a33900",
        "s": "0x38942cb7745848566bde5c142e486d984288dfc9bb431b004aa3b9c166c94e0d",
        "chainId": "0x38",
        "blockHash": "0x18b8e20d83a9c9636c6e9828157b1d684934e3e4c540531831460f9c8be60b9f",
        "blockNumber": "0x119b752"
    }
}
```


# eth\_getTransactionByBlockNumberAndIndex (BSC)

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

**Parameters**

* `QUANTITY|TAG` - a block number, or the string "earliest", "latest" or "pending", as in the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).
* `QUANTITY` - the transaction index position.

```javascript
 params: [ 
     'latest', // 668 
     '0x0' // 0 
 ]
```

**Returns**

See [`eth_getTransactionByHash`](/blockchain-apis/ethereum-api/eth_gettransactionbyhash)

`Object` - A transaction object, or null when no transaction was found:

* `blockHash`: `DATA`, 32 Bytes - hash of the block where this transaction was in. null when its pending.
* `blockNumber`: `QUANTITY` - block number where this transaction was in. null when it's pending.
* `from`: `DATA`, 20 Bytes - address of the sender.
* `gas`: `QUANTITY` - gas provided by the sender.
* `gasPrice`: `QUANTITY` - gas price provided by the sender in Wei.
* `hash`: `DATA`, 32 Bytes - hash of the transaction.
* `input`: `DATA` - the data send along with the transaction.
* `nonce`: `QUANTITY` - the number of transactions made by the sender prior to this one.
* `to`: `DATA`, 20 Bytes - address of the receiver. null when it's a contract creation transaction.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position in the block. null when its pending.
* `value`: `QUANTITY` - value transferred in Wei.
* `v`: `QUANTITY` - ECDSA recovery id
* `r`: `DATA`, 32 Bytes - ECDSA signature r
* `s`: `DATA`, 32 Bytes - ECDSA signature s

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberAndIndex","params":["latest", "0x0"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionByBlockNumberAndIndex",
    "params":["latest", "0x0"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "hash": "0xd7f4fe9ac374329f15f4f6c4fd6292b4768803cc6e48eee4f61e969700a013c2",
        "nonce": "0x25c8",
        "transactionIndex": "0x0",
        "from": "0xc01667054fe2c5a0d6ea6e1ebba9a64291af1e59",
        "to": "0x10ed43c718714eb63d5aa57b78b54704e256024e",
        "value": "0x0",
        "gasPrice": "0x37e11d605",
        "gas": "0x6ddd0",
        "input": "0x38ed17390000000000000000000000000000000000000000000000d8d726b7177a800000000000000000000000000000000000000000000000000016af765ba6f3470b8000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000c01667054fe2c5a0d6ea6e1ebba9a64291af1e5900000000000000000000000000000000000000000000000000000000629e70200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000eceb87cf00dcbf2d4e2880223743ff087a995ad9000000000000000000000000e9e7cea3dedca5984780bafc599bd69add087d5600000000000000000000000055d398326f99059ff775485246999027b3197955",
        "v": "0x94",
        "r": "0x6444ef2644b763fdf6b7a993535eacb7a90c48c86bc820c6d688a4ec9e923e18",
        "s": "0x2385df7f2a543e6a8e130e3c0cda54b146a8929a208d5b06008906ca00f3f368",
        "chainId": "0x38",
        "blockHash": "0x66193e459a0080385e84205c59458a53e39e5c5e97d8b5b119c2f2821c77d684",
        "blockNumber": "0x119b830"
    }
}
```


# eth\_getUncleCountByBlockHash (BSC)

Returns the number of uncles in a block matching the given block hash.

**Parameters**

* `DATA`, 32 Bytes - hash of a block.

```javascript
params: [
 '0x18b8e20d83a9c9636c6e9828157b1d684934e3e4c540531831460f9c8be60b9f'
]
```

**Returns**

`QUANTITY` - integer of the number of uncles in this block.

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockHash","params":["0x18b8e20d83a9c9636c6e9828157b1d684934e3e4c540531831460f9c8be60b9f"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```http
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getUncleCountByBlockHash",
    "params":["0x18b8e20d83a9c9636c6e9828157b1d684934e3e4c540531831460f9c8be60b9f"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "0x0"
}
```


# eth\_getUncleCountByBlockNumber (BSC)

Returns the number of uncles in a block matching the give block number.

**Parameters**

`QUANTITY|TAG` - integer of a block number, or the string "latest", "earliest" or "pending", see the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).

```javascript
 params: [ 
  '0x119B705',
 ]
```

**Returns**

`QUANTITY` - integer of the number of uncles in this block.

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockNumber","params":["0x119B705"],"id":1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getUncleCountByBlockNumber",
    "params":["0x119B705"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# eth\_getLogs (BSC)

Returns an array of all logs matching a given filter object.

**Parameters**

`Object` - The filter options:

* `fromBlock`: `QUANTITY|TAG` - (optional, default: "latest") Value:
* Integer block number
* "latest" for the last mined block
* `address`: `DATA|Array`, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate.
* `topics`: `Array` of `DATA`, - (optional) Array of 32 Bytes DATA topics.
  * Topics are order-dependent. Each topic can also be an array of DATA with "or" options.
* `blockHash`: `DATA`, 32 Bytes - (optional) With the addition of EIP-234 (Geth >= v1.8.13 or Parity >= v2.1.0), blockHash is a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to fromBlock = toBlock = the block number with hash `blockHash`. **If blockHash is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed.**

```javascript
params: [
  {
    "address": "0x0000000000000000000000000000000000001000",
    "topics": [
      "0x627059660ea01c4733a328effb2294d2f86905bf806da763a89cee254de8bee5"
    ],
    "blockHash": "0xcacbb341933a9ad7a62b2024a6bbc69c74152363262b159fb0ef77b28effdc8b"
  }
]
```

**Returns**

`Array` - Array of log objects, or an empty array if nothing has changed since last poll.

* `removed`: `TAG` - `true` when the log was removed, due to a chain reorganization. `false` if its a valid log.
* `logIndex`: `QUANTITY` - integer of the log index position in the block. `null` when its pending log.
* `transactionIndex`: `QUANTITY` - integer of the transactions index position log was created from. `null` when its pending log.
* `transactionHash`: `DATA`, 32 Bytes - hash of the transactions this log was created from. `null` when its pending log.
* `blockHash`: `DATA`, 32 Bytes - hash of the block where this log was in. `null` when its pending. `null` when its pending log.
* `blockNumber`: `QUANTITY` - the block number where this log was in. `null` when its pending. `null` when its pending log.
* `address`: `DATA`, 20 Bytes - address from which this log originated.
* `data`: `DATA` - contains one or more 32 Bytes non-indexed arguments of the log.
* `topics`: `Array of DATA` - Array of 0 to 4 32 Bytes `DATA` of indexed log arguments.
  * In *solidity*: The first topic is the *hash* of the signature of the event (e.g. `Deposit(address,bytes32,uint256)`), except you declare the event with the `anonymous` specifier.

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"address": "0x0000000000000000000000000000000000001000","topics": ["0x627059660ea01c4733a328effb2294d2f86905bf806da763a89cee254de8bee5"],"blockHash": "0xcacbb341933a9ad7a62b2024a6bbc69c74152363262b159fb0ef77b28effdc8b"}],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc": "2.0",
    "method": "eth_getLogs",
    "params": [
        {
            "address": "0x0000000000000000000000000000000000001000",
            "topics": [
                "0x627059660ea01c4733a328effb2294d2f86905bf806da763a89cee254de8bee5"
            ],
            "blockHash": "0xcacbb341933a9ad7a62b2024a6bbc69c74152363262b159fb0ef77b28effdc8b"
        }
    ],
    "id": 0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": [
        {
            "address": "0x0000000000000000000000000000000000001000",
            "blockHash": "0xcacbb341933a9ad7a62b2024a6bbc69c74152363262b159fb0ef77b28effdc8b",
            "blockNumber": "0x11a06c4",
            "data": "0x000000000000000000000000000000000000000000000000002845370de45834",
            "logIndex": "0x26b",
            "topics": [
                "0x627059660ea01c4733a328effb2294d2f86905bf806da763a89cee254de8bee5"
            ],
            "transactionHash": "0xee353552d6386eff50d6b9a8ef863551773d0d32bece432ffe8f5b35fbf35d53",
            "transactionIndex": "0x92",
            "removed": false
        }
    ]
}
```


# eth\_call (BSC)

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

**Parameters**

1. `Object` - The transaction call object

* `from`: `DATA`, 20 Bytes - (optional) The address the transaction is sent from.
* `to`: `DATA`, 20 Bytes - The address the transaction is directed to.
* `gas`: `QUANTITY` - (optional) Integer of the gas provided for the transaction execution. eth\_call consumes zero gas, but this parameter may be needed by some executions.
* `gasPrice`: `QUANTITY` - (optional) Integer of the gasPrice used for each paid gas
* `value`: `QUANTITY` - (optional) Integer of the value sent with this transaction
* `data`: `DATA` - (optional) Hash of the method signature and encoded parameters. For details see [Ethereum Contract ABI in the Solidity documentation](https://docs.soliditylang.org/en/latest/abi-spec.html)

```javascript
params: [
    {
        "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
        "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
        "gas": "0x76c0",
        "gasPrice": "0x9184e72a000",
        "value": "0x9184e72a",
        "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
    }, 
    "latest"
]
```

**Returns**

`DATA` - the return value of executed contract.

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_call","params":[{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155","to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567","gas": "0x76c0","gasPrice": "0x9184e72a000","value": "0x9184e72a","data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"],"id":1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
        {
            "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
            "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
            "gas": "0x76c0",
            "gasPrice": "0x9184e72a000",
            "value": "0x9184e72a",
            "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
        },
        "latest"
    ],
    "id": 1
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# eth\_chainId (BSC)

Returns the currently configured chain ID, a value used in replay-protected transaction signing as introduced by EIP-155.

**Parameters**

None.

**Returns**

`QUANTITY` - integer of the current chain ID.

#### **Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0", "method":"eth_chainId", "params":[], "id":1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_chainId",
    "params":[],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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

###


# eth\_estimateGas (BSC)

Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain.

{% hint style="info" %}
Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance.
{% endhint %}

**Parameters**

* `Object` - The transaction call object
  * `from`: `DATA`, 20 Bytes - (optional) The address the transaction is sent from.
  * `to`: `DATA`, 20 Bytes - The address the transaction is directed to.
  * `gas`: `QUANTITY` - (optional) Integer of the gas provided for the transaction execution. `eth_estimateGas` consumes zero gas, but this parameter may be needed by some executions.
  * `gasPrice`: `QUANTITY` - (optional) Integer of the gasPrice used for each paid gas.
  * `value`: `QUANTITY` - (optional) Integer of the value sent with this transaction
  * `data`: `DATA` - (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI

**Returns**

`QUANTITY` - the amount of gas used.

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_estimateGas",
    "params": [
        {
            "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9",
            "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",
            "value": "0x186a0"
        }
    ],
    "id": 1
}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc": "2.0",
    "method": "eth_estimateGas",
    "params": [
        {
            "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9",
            "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",
            "value": "0x186a0"
        }
    ],
    "id": 1
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
  "id":1,
  "jsonrpc": "2.0",
  "result": "0x5208" // 21000
}
```


# eth\_gasPrice (BSC)

Returns the current price per gas in wei.

**Parameters**

none

**Returns**

`QUANTITY` - integer of the current gas price in wei.

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_gasPrice",
    "params":[],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "0x12a05f200"
}
```


# eth\_getBalance (BSC)

Returns the balance of the account of a given address.

**Parameters**

1. `DATA`, 20 Bytes - address to check for balance.
2. `QUANTITY|TAG` - integer block number, or the string `"latest"`, `"earliest"` or `"pending"`, see the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/).

```javascript
params: [
   '0x295e26495CEF6F69dFA69911d9D8e4F3bBadB89B',
   'latest'
]
```

**Returns**

`QUANTITY` - integer of the current balance for the given address in wei.

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0", "method":"eth_getBalance", "params":["0x295e26495CEF6F69dFA69911d9D8e4F3bBadB89B", "latest"], "id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getBalance",
    "params":["0x295e26495CEF6F69dFA69911d9D8e4F3bBadB89B", "latest"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

```javascript
{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "0x1afd41af26009fe"
}
```

<br>


# eth\_getCode (BSC)

Returns code at a given address.

**Parameters**

* `DATA`, 20 Bytes - address.
* `QUANTITY|TAG` - integer block number, or the string "latest", "earliest" or "pending", see the [default block parameter.](https://ethereum.org/en/developers/docs/apis/json-rpc/)

```javascript
params: [
    '0xe9ae3261a475a27bb1028f140bc2a7c843318afd',
    'latest'
]
```

**Returns**

* `DATA` - the code from the given address.

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_getCode","params":["0xe9ae3261a475a27bb1028f140bc2a7c843318afd", "latest"],"id":0}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getCode",
    "params":["0xe9ae3261a475a27bb1028f140bc2a7c843318afd", "latest"],
    "id":0
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# net\_version (BSC)

returns the current network id.

**Parameters**

none

**Returns**

`String` - The current network id.

* `"0x1"`: Ethereum Mainnet
* `"0x3"`: Ropsten Testnet

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
--header 'Content-Type: application/json' \
--data-raw '{"jsonrpc":"2.0", "method":"net_version", "params":[], "id":1}'
```

{% endtab %}

{% tab title="Postman" %}

```http
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"net_version",
    "params":[],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# eth\_getStorageAt (BSC)

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

**Parameters**

* `DATA`, 20 Bytes - address of the storage.
* `QUANTITY` - integer of the position in the storage.
* `QUANTITY|TAG` - integer block number, or the string "latest", "earliest" or "pending", see the [default block parameter.](https://ethereum.org/en/developers/docs/apis/json-rpc/)

**Returns**

* `DATA` - the value at this storage position.

**Example**

Calculating the correct position depends on the storage to retrieve. Consider the following contract deployed at `0x295a70b2de5e3953354a6a8344e616ed314d7251` by address `0x391694e7e0b0cce554cb130d723a9d27458f9298`.

```javascript
contract Storage {
    uint pos0;
    mapping(address => uint) pos1;
    function Storage() {
        pos0 = 1234;
        pos1[msg.sender] = 5678;
    }
}
```

Retrieving the value of `pos0` is straight forward:

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0", "method": "eth_getStorageAt", "params": ["0x0000000000000000000000000000000000001000", "0x0", "latest"], "id": 1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getStorageAt",
    "params":["0x0000000000000000000000000000000000001000", "0x0", "latest"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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

Retrieving an element of the map is harder. The position of an element in the map is calculated with:

```javascript
keccack(LeftPad32(key, 0), LeftPad32(map position, 0))
```

This means to retrieve the storage on `pos1[“0x391694e7e0b0cce554cb130d723a9d27458f9298”]` we need to calculate the position with:

```javascript
keccak(decodeHex("000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298" + "0000000000000000000000000000000000000000000000000000000000000001"))
```

The geth console which comes with the web3 library can be used to make the calculation:

```bash
> var key = "000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298" + "0000000000000000000000000000000000000000000000000000000000000001"
undefined
> web3.sha3(key, {"encoding": "hex"})
"0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9"
```

Now to fetch the storage:

**Request example**

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

```bash
curl https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0", "method": "eth_getStorageAt", "params": ["0x0000000000000000000000000000000000001000", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "latest"], "id": 1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://ethereum.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_getStorageAt",
    "params":["0x0000000000000000000000000000000000001000", "0x0", "latest"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# eth\_sendRawTransaction (BSC)

Creates new message call transaction or a contract creation for signed transactions.

**Parameters**

`DATA`, The signed transaction data.

```javascript
params: ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"]
```

**Returns**

`DATA`, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available.

Use [`eth_getTransactionReceipt`](/blockchain-apis/ethereum-api/eth_gettransactionreceipt) to get the contract address after the transaction was mined when you created a contract.

**Request example**

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

```bash
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-d '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"],"id":1}'
```

{% endtab %}

{% tab title="Postman" %}

```json
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"eth_sendRawTransaction",
    "params":["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"],
    "id":1
}
```

{% endtab %}
{% endtabs %}

**Result**

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


# Tron API

Below you will find the api documentation for the Tron blockchain

## Tron overview

{% hint style="success" %}
For the best experience, when interacting with the API, we recommend that you study the original Tron documentation - <https://tronprotocol.github.io/documentation-en/>
{% endhint %}

### What is Tron?

Tron is an open-source, decentralized blockchain that supports smart contract functionality and is primarily used to build and host entertainment applications. Tron, together with Ethereum and EOS, is the oldest first-gen smart contracts platform. Tron network crypto is dubbed TRX or Tronics.

1. Tron (TRX) blockchain was launched in 2017 and its Network is suitable for various dApps, but it is ‘focused’ on gambling and high-risk applications.&#x20;
2. Tron explorer or chain explorer [Tronscan](https://tronscan.org/#/) is the most popular browser for Tron’s blocks and transactions.&#x20;
3. As a high-speed and low-fee network, TRX is widely used for TRC-20 USDT transactions.

### How to use Tron?

Tron Blockchain enables access to most commonly used Tron methods. It's possible to generate TRON account, send TRX, TRC10 and TRC20 assets. It's also possible to generate custom TRC10 or TRC20 tokens using API.\
WatchData supports Tron Mainnet:

* **Mainnet** - regular live chain

<table><thead><tr><th>Blockchain</th><th width="158.06635071090045">Chain</th><th>URL</th></tr></thead><tbody><tr><td>Tron</td><td>Mainnet</td><td><a href="https://tron.api.watchdata.io/">https://tron.api.watchdata.io/</a></td></tr></tbody></table>


# Full Node API Overview

A short overview, to work with the Tron node

## Full Node API Overview

To use these APIs, you should know that:

* To send a transaction to the TRON network:
  * Create a transaction via system contract APIs
  * Sign the transaction by `GetTransactionSign`
  * Broadcast the transaction by `BroadcastTransaction`
* Or there're shortcut APIs:
  * EasyTransfer
  * EasyTransferByPrivate
  * EasyTransferAsset
  * EasyTransferAssetByPrivate

Any other APIs are used for querying on-chain data.

To distinguish HEX and Base58check addresses, a `visible` parameter is introduced.

To handle multi-sign, a `permission_id` parameter is introduced to select the underlying permission type.


# Address Utilities

Common Utility API

These APIs won't make any changes on-chain and have nothing to do with on-chain data.

{% content-ref url="/pages/x2A0M23i25Bzr7t6hJMl" %}
[ValidateAddress](/blockchain-apis/tron-api/address-utilities/validateaddress)
{% endcontent-ref %}

{% content-ref url="/pages/nRQatdNjGPTdIl0nbDUj" %}
[GenerateAddress](/blockchain-apis/tron-api/address-utilities/generateaddress)
{% endcontent-ref %}

{% content-ref url="/pages/pO0ka24vWnxjYzJpMjKr" %}
[CreateAddress](/blockchain-apis/tron-api/address-utilities/createaddress)
{% endcontent-ref %}


# CreateAddress

Create address from a specified password string (NOT PRIVATE KEY).

**Return value**：The address

{% hint style="danger" %}
Please control risks when using this API. To ensure environmental security, please do not invoke APIs provided by other or invoke this very API on a public network.
{% endhint %}

**Body params:**

* `value` **-** value is the password, converted from ascii to hex. i.e. the pass phrase.&#x20;

**Request**

```
curl --request POST \
     --url https://tron.api.watchdata.io/wallet/createaddress \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --data '
{
     "value": "7465737470617373776f7264"
}
'
```

**Response**

```
{
  "base58checkAddress": "TWwv3YcHJ1NfMemQSmXCPY48RR1tsY3n9N",
  "value": "41e61c1205ee029fb4e41f294afd448cc5d578c8ef"
}
```


# GenerateAddress

Generates a random private key and address pair.

Returns a private key, the corresponding address in hex, and base58.

{% hint style="danger" %}
**Important note**

* This API call returns the randomly generated privateKey value in the JSON output. Please do not call this API provided by the public node. It is recommended to use offline address generation.
  {% endhint %}

{% hint style="info" %}

#### Statement

The result of this example is only for show. You should not use this result as your account because it is a real key pair and is public to everyone.
{% endhint %}

**Request**

```
curl --request GET
--url https://tron.api.watchdata.io/wallet/generateaddress \
--header 'Accept: application/json'Response
```

**Response**

```
{
  "privateKey": "097c8ba8a310f39a41a667d35a20000cd21d58c7322484b584c4ada8ebd3ec06",
  "address": "TLHx2Ta9WwtwDjgGxyeifHs5ipmJrJAbZ3",
  "hexAddress": "41713ca8ee9c3db6bdc947b8e0c7846645307e6e63"
}
```




---

[Next Page](/llms-full.txt/1)

