PolygonScan
HomeTwitterKnowledge Base API PRO
PolygonScan
PolygonScan
  • Introduction
  • ✨Getting Started
    • Creating an Account
    • Getting an API Key
    • Endpoint URLs
  • 🎯API Endpoints
    • Accounts
    • Contracts
    • Transactions
    • Blocks
    • Logs
    • Geth Proxy
    • Tokens
    • Gas Tracker
    • Stats
  • 🏆API PRO
    • PolygonScan API PRO
    • API PRO Endpoints
  • 📖Tutorials
    • Read/Write Smart Contracts
    • Verifying Contracts Programmatically
  • 🔧Misc Tools & Utilities
    • Libraries
    • Plugins
  • 🤝Support
    • FAQ
    • Rate Limits
    • Common Error Messages
    • Getting Help
  • Visit PolygonScan.com
Powered by GitBook
On this page
  • Get Gas Oracle
  • Get Daily Average Gas Limit
  • Get Polygon Daily Total Gas Used
  • Get Daily Average Gas Price
  1. API Endpoints

Gas Tracker

PreviousTokensNextStats

Last updated 4 months ago

Endpoints with are under the API Pro subscription. To upgrade your API plan, browse through the page.

Get Gas Oracle

Returns the current Safe, Proposed and Fast gas prices.

Post EIP-1559 changes :

  • Safe/Proposed/Fast gas price recommendations are now modeled as Priority Fees.

  • New field suggestBaseFee , the baseFee of the next pending block

  • New field gasUsedRatio, to estimate how busy the network is

Learn more about the

https://api.polygonscan.com/api
   ?module=gastracker
   &action=gasoracle
   &apikey=YourApiKeyToken 

Try this endpoint in your

No parameters required.

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":{
      "LastBlock":"24191386",
      "SafeGasPrice":"29",
      "ProposeGasPrice":"30",
      "FastGasPrice":"31",
      "BaseFee":"0.00003435",
      "GasUsedRatio":"0.99987631540541,0.999384889749861,0.999359431260431,0.999623212039585,0",
      "UsdPrice":"1.68"
   }
}

Note: The gas prices are returned in Gwei.

Get Daily Average Gas Limit

Returns the historical daily average gas limit of the Polygon network.

 https://api.polygonscan.com/api
    ?module=stats
    &action=dailyavggaslimit
    &startdate=2021-02-01
    &enddate=2021-02-28
    &sort=asc
    &apikey=YourApiKeyToken 

Query Parameters

Parameter
Description

startdate

the starting date in yyyy-MM-dd format, eg. 2019-01-31

enddate

the ending date in yyyy-MM-dd format, eg. 2019-02-28

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2021-02-01",
         "unixTimeStamp":"1612137600",
         "gasLimit":"19995225"
      },
      {
         "UTCDate":"2021-02-02",
         "unixTimeStamp":"1612224000",
         "gasLimit":"19992137"
      },
      {
         "UTCDate":"2021-02-03",
         "unixTimeStamp":"1612310400",
         "gasLimit":"19994117"
      }
   ]
}

Returns the total amount of gas used daily for transactions on the Polygon network.

 https://api.polygonscan.com/api
    ?module=stats
    &action=dailygasused
    &startdate=2021-02-01
    &enddate=2021-02-28
    &sort=asc
    &apikey=YourApiKeyToken 

Query Parameters

Parameter
Description

startdate

the starting date in yyyy-MM-dd format, eg. 2019-01-31

enddate

the ending date in yyyy-MM-dd format, eg. 2019-02-28

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2021-02-01",
         "unixTimeStamp":"1612137600",
         "gasUsed":"15209687825"
      },
      {
         "UTCDate":"2021-02-02",
         "unixTimeStamp":"1612224000",
         "gasUsed":"15486974769"
      },
      {
         "UTCDate":"2021-02-03",
         "unixTimeStamp":"1612310400",
         "gasUsed":"14214840593"
      }
   ]
}

Returns the daily average gas price used on the Polygon network.

 https://api.polygonscan.com/api
    ?module=stats
    &action=dailyavggasprice
    &startdate=2021-02-01
    &enddate=2021-02-28
    &sort=asc
    &apikey=YourApiKeyToken 

Query Parameters

Parameter
Description

startdate

the starting date in yyyy-MM-dd format, eg. 2019-01-31

enddate

the ending date in yyyy-MM-dd format, eg. 2019-02-28

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "UTCDate":"2021-02-01",
         "unixTimeStamp":"1612137600",
         "maxGasPrice_Wei":"243000000000",
         "minGasPrice_Wei":"1000000000",
         "avgGasPrice_Wei":"2565412962"
      },
      {
         "UTCDate":"2021-02-02",
         "unixTimeStamp":"1612224000",
         "maxGasPrice_Wei":"338000000000",
         "minGasPrice_Wei":"1000000000",
         "avgGasPrice_Wei":"2815449842"
      },
      {
         "UTCDate":"2021-02-03",
         "unixTimeStamp":"1612310400",
         "maxGasPrice_Wei":"328000000000",
         "minGasPrice_Wei":"1000000000",
         "avgGasPrice_Wei":"3135220373"
      }
   ]
}

Try this endpoint in your

Get Polygon Daily Total Gas Used

Try this endpoint in your

Get Daily Average Gas Price

Try this endpoint in your

🎯
🔗
browser
🔗
browser
🔗
browser
🔥
🔗
⛽
PolygonScan APIs
gas changes in EIP-1559.
browser