<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>

Built With

Share this project:

Updates