> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# eth_call | Robinhood

> Robinhood Chain API method that executes a new message call immediately without creating a transaction on the blockchain. Robinhood Chain via Chainstack.

Robinhood Chain API method that executes a new message call immediately without creating a transaction on the blockchain.

## Parameters

* `object` — the transaction call object with fields like `from`, `to`, `gas`, `gasPrice`, `value`, `data`
* `quantity or tag` — the block number in hex format or block tag (`latest`, `earliest`, `pending`, `safe`, `finalized`)

### State override (optional)

`eth_call` accepts an optional third parameter: a state override set that changes account state for this call only. Nothing is written to the chain. The set is an object keyed by account address, and each address can override:

* `balance` — the account balance in wei, hex-encoded
* `nonce` — the account nonce, hex-encoded
* `code` — the bytecode to run at the address
* `state` — storage slot values that replace the account's entire storage
* `stateDiff` — storage slot values to change, keeping the rest of the storage

This example puts bytecode that returns `42` at an unused address, then calls that address:

```bash theme={"system"}
curl --request POST \
  --url CHAINSTACK_NODE_URL \
  --header 'Content-Type: application/json' \
  --data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_call",
    "params": [
      { "to": "0x00000000000000000000000000000000c0ffee42", "data": "0x" },
      "latest",
      { "0x00000000000000000000000000000000c0ffee42": { "code": "0x602a60005260206000f3" } }
    ]
  }'
```

```json theme={"system"}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x000000000000000000000000000000000000000000000000000000000000002a"
}
```

## Response

* `data` — the return value of the executed contract

## `eth_call` code examples

<CodeGroup>
  ```javascript ethers.js theme={"system"}
  const { JsonRpcProvider } = require("ethers");

  const provider = new JsonRpcProvider("CHAINSTACK_NODE_URL");

  async function call() {
    const result = await provider.send("eth_call", [{"to": "0x00000000000000000000000000000000000a4b05", "data": "0x"}, "latest"]);
    console.log(result);
  }

  call();
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3

  node_url = "CHAINSTACK_NODE_URL"
  web3 = Web3(Web3.HTTPProvider(node_url))

  result = web3.provider.make_request("eth_call", [{"to": "0x00000000000000000000000000000000000a4b05", "data": "0x"}, "latest"])
  print(result)
  ```

  ```shell cURL theme={"system"}
  curl -X POST "CHAINSTACK_NODE_URL" \
    -H "Content-Type: application/json" \
    --data '{
      "jsonrpc": "2.0",
      "method": "eth_call",
      "params": [{"to": "0x00000000000000000000000000000000000a4b05", "data": "0x"}, "latest"],
      "id": 1
    }'
  ```
</CodeGroup>


## OpenAPI

````yaml openapi/robinhood_node_api/execute_transactions/eth_call.json POST /
openapi: 3.0.0
info:
  title: Chainstack Node API
  version: 1.0.0
  description: This is an API for interacting with a Chainstack node.
servers:
  - url: >-
      https://robinhood-mainnet.core.chainstack.com/23cf4479b299ab4835d76c05c468ca6e
security: []
paths:
  /:
    post:
      tags:
        - upload
      summary: eth_call
      operationId: eth_call
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_call
                params:
                  type: array
                  items:
                    anyOf:
                      - type: object
                        title: Transaction
                        description: The transaction call object.
                      - type: string
                        title: Block
                        description: Block number or tag (latest, earliest, pending).
                  default:
                    - to: '0x00000000000000000000000000000000000a4b05'
                      data: 0x
                    - latest
      responses:
        '200':
          description: >-
            Executes a new message call immediately without creating a
            transaction on the blockchain.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object
                    nullable: true

````