# /v1/estimate\_gas\_price - Aptos

This endpoint gets the estimated gas price for executing a transaction in the Aptos blockchain network.

## Supported Network

* Mainnet

## Parameter

None

## Request

**Base URL**

```bash
https://go.getblock.io/<ACCESS_TOKEN>
```

**Example(cURL)**\*

```curl
curl --location 'https://go.getblock.io/<ACCESS_TOKEN>/v1/estimate_gas_price'
```

## Response Example

```json
{
    "deprioritized_gas_estimate": 100,
    "gas_estimate": 100,
    "prioritized_gas_estimate": 150
}

```

## Response parameter definition

| **Field**                    | **Type** | **Description**                                                            |
| ---------------------------- | -------- | -------------------------------------------------------------------------- |
| deprioritized\_gas\_estimate | String   | Lower gas price estimate — slower inclusion, suitable for non-urgent txns. |
| gas\_estimate                | String   | Standard recommended gas price (balanced option).                          |
| prioritized\_gas\_estimate   | String   | Higher gas price estimate — ensures faster transaction processing.         |

## Use Cases

This method can be used for:

* Wallets can auto-suggest gas fees based on the user's urgency.
* dApps can provide a “fast/normal/slow” fee slider to users.
* Developers can programmatically ensure transactions won’t fail due to low gas.
* Cost optimisation for batch transactions.

## Code example

**Node(axios)**

```js
const axios = require('axios');

let config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: 'https://go.getblock.io/<ACCESS_TOKEN>/v1/estimate_gas_price',
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});


```

**Python(Request)**

```python
import requests

url = "https://go.getblock.io/<ACCESS_TOKEN>/v1/estimate_gas_price"
response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
```

## Error handling

| **Status Code** | **Error Message**     | **Cause**                                    |
| --------------- | --------------------- | -------------------------------------------- |
| **403**         | Forbidden             | Missing or invalid \<ACCESS\_TOKEN>.         |
| **500**         | Internal server error | Node or network failure when estimating gas. |

## Integration with Web3

By integrating `/v1/estimate_gas_price` into dApp, developers can:

* Provide real-time fee estimation inside wallets and dApps.
* Improve transaction confirmation rates by suggesting optimal gas.
* Enhance user experience with clear trade-offs (fast vs cheap).
* Avoid failed transactions due to underpriced gas.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.getblock.io/api-reference/aptos-apt/apt_v1_estimate_gas_price.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
