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

# eth_estimateGas

> Estimate the gas required for a transaction.

export const chain = '1';

<ResponseExample>
  ```json Response theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x66ac"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi/api-reference/endpoint/ethestimategas.json GET /v2/api
openapi: 3.1.0
info:
  title: eth_estimateGas
  version: 2.0.0
  description: Estimate the gas required for a transaction.
  license:
    name: Etherscan API Terms
    url: https://etherscan.io/terms
servers:
  - url: https://api.etherscan.io
    description: Etherscan API.
security:
  - apiKey: []
paths:
  /v2/api:
    get:
      summary: eth_estimateGas
      description: Estimate the gas required for a transaction.
      operationId: getEthestimategas
      parameters:
        - name: chainid
          in: query
          required: true
          description: >-
            Chain ID to query, eg 1 for Ethereum, 8453 for Base from our
            supported chains.
          schema:
            type: string
          example: '1'
        - name: module
          in: query
          required: true
          description: Set to proxy for this endpoint.
          schema:
            type: string
            default: proxy
          example: proxy
        - name: action
          in: query
          required: true
          description: Set to eth_estimateGas for this endpoint.
          schema:
            type: string
            default: eth_estimateGas
          example: eth_estimateGas
        - name: data
          in: query
          required: false
          description: Hash of the method signature and encoded parameters.
          schema:
            type: string
          example: '0x4e71d92d'
        - name: to
          in: query
          required: false
          description: The address to interact with.
          schema:
            type: string
          example: '0xf0160428a8552ac9bb7e050d90eeade4ddd52843'
        - name: value
          in: query
          required: false
          description: Value sent in this transaction, in hex.
          schema:
            type: string
          example: '0xff22'
        - name: gasPrice
          in: query
          required: false
          description: Gas price in wei.
          schema:
            type: string
          example: '0x51da038cc'
        - name: gas
          in: query
          required: false
          description: Gas limit provided for the transaction, in hex.
          schema:
            type: string
          example: '0x5f5e0ff'
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: query
      name: apikey
      description: Your Etherscan API key.

````