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

112
Visualizações
way to fetch data and time from openweathermap api?

I was trying to fetch datas from openweathermap api in JS for my website but in the json file some parameters are missing like sunrise sunset date timezone etc (btw using free api) below is the json format of the api call

{
"message": "accurate",
"cod": "200",
"count": 1,
"list": [
{
"id": 1275004,
"name": "Kolkata",
"coord": {
"lat": 22.5697,
"lon": 88.3697
},
"main": {
"temp": 28.97,
"feels_like": 28.49,
"temp_min": 28.35,
"temp_max": 28.97,
"pressure": 1009,
"humidity": 39
},
"dt": 1646658548,
"wind": {
"speed": 2.06,
"deg": 320
},
"sys": {
"country": "IN"
},
"rain": null,
"snow": null,
"clouds": {
"all": 0
},
"weather": [
{
"id": 721,
"main": "Haze",
"description": "haze",
"icon": "50n"
}
]
}
]
}

how to get date and time?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Try this API with your APP ID https://api.openweathermap.org/data/2.5/weather?q=%20Oakland&appid= //

you will get this JSON from API-

  {
       "coord":{
          "lon":-122.2708,
          "lat":37.8044
       },
       "weather":[
          {
             "id":801,
             "main":"Clouds",
             "description":"few clouds",
             "icon":"02n"
          }
       ],
       "base":"stations",
       "main":{
          "temp":279.3,
          "feels_like":277.8,
          "temp_min":274.84,
          "temp_max":282.85,
          "pressure":1026,
          "humidity":86
       },
       "visibility":10000,
       "wind":{
          "speed":2.06,
          "deg":60
       },
       "clouds":{
          "all":20
       },
       "dt":1646659485,
       "sys":{
          "type":2,
          "id":2042798,
          "country":"US",
          "sunrise":1646663524,
          "sunset":1646705301
       },
       "timezone":-28800,
       "id":5378538,
       "name":"Oakland",
       "cod":200
    }

or https://api.openweathermap.org/data/2.5/forecast?q=%20Oakland&mode=json&units=imperial&appid= //

you will get multiple data using this API.

about 4 years ago · Juan Pablo Isaza Relatório
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