<script>
async function postData(url = '') {
const response = await fetch(url, {method: 'GET'});
return response.json();
}
postData('https://newsapi.org/v2/everything?q=tesla&from=2021-12-10&sortBy=publishedAt&apiKey=API_KEY')
.then(data => {
console.log(data);
});
</script>
Log in or sign up for Devpost to join the conversation.