Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

319
Visualizações
How do I fix this error I am reciving in my weather api, 404?

I have this code that uses thezipcodes.net to get latitude and longitude and then it puts it through api.weather.gov to get the weather. The problem is that it is screwing up in the area where it gets the points in the weather.gov API.

In getweatherforecaststuff() it returns a 404 error and is trying to set the ending to 0,0.

let lat = 0;
let long = 0;
let forecaststring = "";

function getLat(zipcode) {
  //add code here to get from api
  $.getJSON("https://thezipcodes.com/api/v1/search?zipCode=" + zipcode + "&countryCode=US&apiKey=01f2f327b789845bddf7d617257d8f76", function(data) {
    lat = data["location"][0]["latitude"];
    long = data["location"][0]["longitude"];
  });
}

function getWeatherForecastStuff() {
  $.getJSON("https://api.weather.gov/points/" + lat + "," + long + "", function(data) {
    forecaststring = data["properties"]["forecast"];
  });
}

function printStuff(forecaststrings) {
  $.getJSON(forecaststrings, function(data) {
    console.log(data);
  });
}

function getInfoNeeded() {
  zipcode = window.prompt("What is your zipcode?");
  getLat(parseInt(zipcode));
  getWeatherForecastStuff()
  printStuff(forecaststring)
}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda