---
title: call
slug: api/call
createdAt: 2022-12-06T18:10:45.000Z
---

{
  "id": "l9GzKLyK5KZeKP-9aBSxI",
  "data": {
    "url": "{{ENVIRONMENT}}",
    "method": "POST",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "name": "Content-Type",
          "type": "string",
          "example": "application/json",
          "description": ""
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "type": "string",
          "example": "{\n\t\"jsonrpc\":\"2.0\",\n\t\"method\":\"eth_call\",\n\t\"params\":[{\n\t\t\"from\": \"\",\n\t\t\"to\": \"\",\n\t\t\"gas\": \"\",\n\t\t\"gasPrice\": \"\",\n\t\t\"value\": \"\",\n\t\t\"data\": \"\"\n\t}, \"latest\"],\n\t\"id\":1\n}",
          "description": ""
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "<p>Executes a new message call immediately without creating a transaction on the block chain.</p>\n<p><strong>Parameters</strong></p>\n<p><code>Object</code> - The transaction call object</p>\n<p><code>from</code>: <code>DATA</code>, 20 Bytes - (optional) The address the transaction is sent from.</p>\n<p><code>to</code>: <code>DATA</code>, 20 Bytes - The address the transaction is directed to.</p>\n<p><code>gas</code>: <code>QUANTITY</code> - (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.</p>\n<p><code>gasPrice</code>: <code>QUANTITY</code> - (optional) Integer of the gasPrice used for each paid gas</p>\n<p><code>value</code>: <code>QUANTITY</code> - (optional) Integer of the value sent with this transaction</p>\n<p><code>data</code>: <code>DATA</code> - (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI</p>\n<p><code>QUANTITY|TAG</code> - integer block number, or the string <code>\"latest\"</code>, <code>\"earliest\"</code> or <code>\"pending\"</code>, see the default block parameter</p>\n<p><strong>Returns</strong></p>\n<p><code>DATA</code> - the return value of executed contract.</p>",
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{ENVIRONMENT}} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{ENVIRONMENT}}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"net/http\"\n\nurl = URI(\"{{ENVIRONMENT}}\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\n\nurl = \"{{ENVIRONMENT}}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": ""
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}