Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP][json] Pewne API pogody.
ZaXaZ
post
Post #1





Grupa: Zarejestrowani
Postów: 285
Pomógł: 18
Dołączył: 30.01.2014
Skąd: <?=$_GET['city']?>

Ostrzeżenie: (0%)
-----


Szukałem w internecie jakiegoś dobrego API (darmowego) na pogodę,
znalazłem takie:
api.openweathermap.org/data/2.5/find?units=metric&q=warszawa

jednak mam problem: zna ktoś to API?
Wiecie czy pogoda jest w C° czy innym, oraz czy predkosc jest w KM/G (km/h)?

Drugi problem, nie znam sie na pogodzie ani tez nie jestem super mistrzem angielskiego, czy może ktoś opisać jaki index co konkretnie zwraca? każda informacja jest dla mnie cenna, a ja znam tylko najprostrze jak temp, temp (min,max), count (czy istnieje), country, name, speed, cod(status api), description i reszty nie wiem.

daje tablice php z danymi:

  1. (
  2. [message] => accurate
  3. [cod] => 200
  4. [count] => 1
  5. [list] => Array
  6. (
  7. [0] => Array
  8. (
  9. [id] => 756135
  10. [name] => Warsaw
  11. [coord] => Array
  12. (
  13. [lon] => 21.01178
  14. [lat] => 52.229771
  15. )
  16.  
  17. [main] => Array
  18. (
  19. [temp] => 23
  20. [pressure] => 1009
  21. [humidity] => 60
  22. [temp_min] => 23
  23. [temp_max] => 23
  24. )
  25.  
  26. [dt] => 1407940200
  27. [wind] => Array
  28. (
  29. [speed] => 3.6
  30. [deg] => 140
  31. )
  32.  
  33. [sys] => Array
  34. (
  35. [country] => PL
  36. )
  37.  
  38. [clouds] => Array
  39. (
  40. [all] => 20
  41. )
  42.  
  43. [weather] => Array
  44. (
  45. [0] => Array
  46. (
  47. [id] => 801
  48. [main] => Clouds
  49. [description] => few clouds
  50. [icon] => 02d
  51. )
  52.  
  53. )
  54.  
  55. )
  56.  
  57. )
  58.  
  59. )


--------------------
Go to the top of the page
+Quote Post
trueblue
post
Post #2





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


http://openweathermap.org/weather-data#current
http://openweathermap.org/current#data (niestety za wiele tu nie jest wyjaśnione, ale w Twoim przypadku jeśli units=metric, to temperatura jest w Celsjuszach)



--------------------
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 12:09