Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

214
Views
How do I fetch the data from an API key and keep my webpage updated even when new data is added?

I am building a webpage that fetches data from NASA Picture of the day API and displays it on my webpage. I am able to fetch data for the current date or any specific date. But I want to display the image and description for today and then the following dates as the NASA site updates. I am not sure how to display multiple images for different dates on my webpage using Javascript. Following is the script code that I implemented:

async function getData(){
  const response = await fetch(api_url);
  const data = await response.json();

  document.getElementById("imageTitle").innerHTML= data.title;
  document.getElementById("description").innerHTML= data.explanation;
  document.getElementById("potd").src= data.hdurl;
  document.getElementById("datePosted").innerHTML= data.date;
  document.getElementById("credits").innerHTML=data.copyright;
}

getData();
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!