---
title: "eth_call"
description: "Executes a new message call without creating a transaction (Avalanche)"
url: "https://blockreq.com/docs/build/api-reference/avalanche/eth_call/"
---

# eth_call

**Network:** Avalanche · Mainnet · Chain ID `43114` (`0xa86a`)

**Counts as 1 request.** See [Request Counting](https://blockreq.com/docs/pricing/request-counting/index.md).

Executes a new message call immediately without creating a transaction on the blockchain. Commonly used to read data from smart contracts.

## Parameters

1. `Object` — The transaction call object:
   | Field | Type | Required | Description |
   |-------|------|----------|-------------|
   | from | DATA | No | Sender address |
   | to | DATA | **Yes** | Contract address |
   | gas | QUANTITY | No | Gas limit |
   | gasPrice | QUANTITY | No | Gas price |
   | value | QUANTITY | No | Value sent |
   | data | DATA | No | ABI-encoded function call |

2. `QUANTITY|TAG` — Block number, or `"latest"`, `"earliest"`, `"pending"`.

## Returns

`DATA` — The return value of the executed contract function.

## Request

```json
{
  "jsonrpc": "2.0",
  "method": "eth_call",
  "params": [
    {
      "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "data": "0x18160ddd"
    },
    "latest"
  ],
  "id": 1
}
```

The example reads ERC-20 `totalSupply()` (selector `0x18160ddd`). Replace `to` with a token contract on Avalanche.

## Response

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

## Code Examples

**cURL**

```bash
curl -X POST https://avalanche-rpc.blockreq.com/v1/rpc/public \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","data":"0x18160ddd"},"latest"],"id":1}'
```

**TypeScript**

```typescript
const response = await fetch("https://avalanche-rpc.blockreq.com/v1/rpc/public", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_call",
  "params": [
    {
      "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "data": "0x18160ddd"
    },
    "latest"
  ],
  "id": 1
}),
});
const data = await response.json();
console.log(data.result);
```

**Python**

```python
import requests

response = requests.post(
    "https://avalanche-rpc.blockreq.com/v1/rpc/public",
    json={
  "jsonrpc": "2.0",
  "method": "eth_call",
  "params": [
    {
      "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "data": "0x18160ddd"
    },
    "latest"
  ],
  "id": 1
}
)
print(response.json()["result"])
```

**Go**

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
)

func main() {
	payload := []byte(`{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","data":"0x18160ddd"},"latest"],"id":1}`)
	resp, err := http.Post(
		"https://avalanche-rpc.blockreq.com/v1/rpc/public",
		"application/json",
		bytes.NewBuffer(payload),
	)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	var result map[string]interface{}
	json.Unmarshal(body, &result)
	fmt.Println(result["result"])
}
```

**viem**

```typescript
import { createPublicClient, http } from "viem";

const client = createPublicClient({
  transport: http("https://avalanche-rpc.blockreq.com/v1/rpc/public"),
});

const result = await client.request({
  method: "eth_call",
  params: [{"to":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","data":"0x18160ddd"},"latest"],
});
console.log(result);
```

**Foundry**

```bash
cast rpc --rpc-url https://avalanche-rpc.blockreq.com/v1/rpc/public eth_call {"to":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","data":"0x18160ddd"} latest
```

**Hardhat**

```javascript
const { ethers } = require("hardhat");

async function main() {
  const provider = new ethers.JsonRpcProvider("https://avalanche-rpc.blockreq.com/v1/rpc/public");
  const result = await provider.send("eth_call", [{"to":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","data":"0x18160ddd"},"latest"]);
  console.log(result);
}

main();
```
