ERC20 tokens are one of the most popular types of cryptocurrencies in the market. These tokens are built on the Ethereum blockchain and are used for a variety of purposes, ranging from utility tokens for decentralized applications to security tokens for fractional ownership of assets.
Getting the price of ERC20 tokens is important for anyone interested in investing, trading or using these tokens. By using Chainbase Web3 API Get token price history, you can easily get the historical price of any ERC20 token and make informed decisions about your investments.
To better leverage the ability that Chainbase provides, you can register here for a free account and access to different APIs and data cloud.
After logging into Chainbase, visit the dashboard to get an overview. Create a new project in the console and get an API key.
fetch
in JavaScript.axios
in JavaScript. You need to install axios
using npm install axios --save
in the terminal first.Chainbase API Get token price history takes the chain id, the contract address of a certain ERC20 token, start time and end time as parameters, and returns the historical price of that token during that time period.
To get data printed, run command node <filename>.js
in the terminal. In this case, the return data looks as follows:
If you want to know more details on the endpoint and optional parameters, check out:
If you meet any trouble following the tutorial, feel free to reach out to us in our Discord to get 24/7 community support.
ERC20 tokens are one of the most popular types of cryptocurrencies in the market. These tokens are built on the Ethereum blockchain and are used for a variety of purposes, ranging from utility tokens for decentralized applications to security tokens for fractional ownership of assets.
Getting the price of ERC20 tokens is important for anyone interested in investing, trading or using these tokens. By using Chainbase Web3 API Get token price history, you can easily get the historical price of any ERC20 token and make informed decisions about your investments.
To better leverage the ability that Chainbase provides, you can register here for a free account and access to different APIs and data cloud.
After logging into Chainbase, visit the dashboard to get an overview. Create a new project in the console and get an API key.
fetch
in JavaScript.axios
in JavaScript. You need to install axios
using npm install axios --save
in the terminal first.Chainbase API Get token price history takes the chain id, the contract address of a certain ERC20 token, start time and end time as parameters, and returns the historical price of that token during that time period.
To get data printed, run command node <filename>.js
in the terminal. In this case, the return data looks as follows:
If you want to know more details on the endpoint and optional parameters, check out:
If you meet any trouble following the tutorial, feel free to reach out to us in our Discord to get 24/7 community support.