Created
April 17, 2020 10:28
-
-
Save katopz/7d892411ca92b804a0e4c79cdf1d7932 to your computer and use it in GitHub Desktop.
nl-kbtg-json2csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch('https://covid19.th-stat.com/api/open/timeline') | |
.then(response => response.json()) | |
.then(json => { | |
const header = Object.keys(json.Data.shift()).join(',') | |
const data = json.Data.map(e=>Object.values(e).join(',')).join('\n') | |
console.log(header + '\n' + data) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment