Reputation: 53
This is my first time i am using a api call for implementing on project for predicting the avalanche price feed for machine learning to get the historical data for 2 years.
I want api call from chainlink websites where there is alvalanche price feed below is the url whre i want to fetch the data for predicting a machine learning model for historical 2 years data
https://docs.chain.link/docs/avalanche-price-feeds/
web3 = Web3(Web3.HTTPProvider('https://kovan.infura.io/v3/<infura_project_id>'))
addr = '0x9326BFA02ADD2366b30bacB125260Af641031331'
contract = web3.eth.contract(address=addr, abi=abi)
validRoundId = 18446744073709562301
historicalData = contract.functions.getRoundData(validRoundId).call()
print(historicalData)
The above is mentioned in the document in the chainlink documentation but i'm not sure how to extract day-wise historical prices of the cryptocurrency
Upvotes: 0
Views: 715
Reputation: 856
The existing getHistoricalPriceData function requires a roundID to be known as you specified above. If you want to find what the price feed had as the particular price at a specific point in time (to the second), check out this chainlink external adapter and consumer contract that achieves this https://github.com/pappas999/historical-price-feed-data
Upvotes: 1