Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

103
Vistas
How can i catch the error when the api reaches its daily limit in JS?

I am trying to catch the specific error when a certain API key expires or it reaches its daily response limit(assuming 1000 per day).

const moviesearchEngine=()=>{
    let searchBox = document.querySelector('.searchBox');
    let movieTitle = document.querySelector('.movieTitle');
    let yearofRelease = document.querySelector('.yearofRelease');
    let genre = document.querySelector('.genre');
    let director = document.querySelector('.director');
    let plot = document.querySelector('.plot');

    const apiCall = ()=>{
        let params = new URLSearchParams({
            t:searchBox.value,
            apikey:`key`
        })
        let api = `http://www.omdbapi.com/?${params}`;

        //fetching the api orelse showing the error
        fetch(api).then((response)=>{
                return response.json();
        }).then((data)=>{
            //assigning the data to variable
            console.log(data)
        })
    }
    apiCall();
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You should try to read json response as it has different key and from one of them you can find the one who is responsible for setting limit. It is your api id key.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda