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

229
Views
how to get input value and use it in async function for search in api?

I am trying to make a simple search bar for a movies website. How can I get a value from an input to use in an async API call?

searchMOvies.addEventListener('keyup', (event) => {
  let moviesName = event.target.value
  console.log(moviesName)
})

async function search() {
  let response = await fetch(`https://api.themoviedb.org/3/search/movie?api_key=[REDCATED]&language=en-US&query=${moviesName}&page=1&include_adult=false`);
  if (response.status === 200) {
    let data = await response.json();

    console.log(data.results);
    showMovise(data.results);
  } else {
    console.log(response.status); // 400
    console.log(response.statusText); // Not Found
  }
}
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!