Closed Sattishh closed 4 years ago
Hi, @Sattishh
Here's how you could implement it using node-fetch
const fetch = require('node-fetch');
fetch('https://covidapi.info/api/v1/country/IND/latest')
.then(response => response.json())
.then(data => {
date = Object.keys(data.result)[0]
result = data.result[date]
console.log(result)
})
.catch(err => {
console.log('error')
})
Let me know if you have any queries
That's awesome. Thanks a lot! Great API!
So I tried to use the latest cases of india and fetched that link, from that text, I wanted only the confirmed, recovered and deaths. I can't figure out how to get it. Can someone help me? Used node-fetch.
.then(result => console.log(result["2020-04-11"].confirmed)))
This is the code I tried, but it just shows TypeError. I used this because there were no,
after result, 2020-04-11 and confirmed. Thank you!