Skip to content

Instantly share code, notes, and snippets.

@TrevorJTClarke
Created March 20, 2019 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TrevorJTClarke/1ed59fd2cfd5481cf5a2eebee4e9f152 to your computer and use it in GitHub Desktop.
Save TrevorJTClarke/1ed59fd2cfd5481cf5a2eebee4e9f152 to your computer and use it in GitHub Desktop.
axios({
method:'get',
url: 'https://web3api.io/api/v1/transactions/gas/predictions',
headers: { 'x-api-key': 'YOUR_API_KEY_HERE' }
}).then(res => {
// res data example:
// {
// "average": {
// "gasPrice": 2000000000,
// "numBlocks": 4,
// "wait": 0.8
// },
// "fast": {
// "gasPrice": 3000000000,
// "numBlocks": 3,
// "wait": 0.5
// },
// "fastest": {
// "gasPrice": 20000000000,
// "numBlocks": 2,
// "wait": 0.4
// },
// "safeLow": {
// "gasPrice": 1000000000,
// "numBlocks": 26,
// "wait": 5.7
// }
// }
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment