0

So I know it's unofficial, and thus undocumented, but I think this should work. I'm using the Google Weather API to pull weather based on lat long. THese addresses work:

http://www.google.com/ig/api?weather=,,,32472408,-98796951&hl=es&unused=419334593

English, Spanish, Romanian, etc. etc. etc. However, the language code for portugese (PT), doesn't seem to return anything.

http://www.google.com/ig/api?weather=,,,32472408,-98796951&hl=pt&unused=419334593

Has anyone seen this? Any ideas on how to handle it (short of translating the entire response from English to Portugese)?

DavyMac23
  • 43
  • 7
  • **The Google weather API was shut down in 2012** -> http://stackoverflow.com/questions/12145820/google-weather-api-gone/35943521 – John Slegers Mar 11 '16 at 15:55

1 Answers1

0

Can you use city locations instead? If so something like this will work for you

http://www.google.com/ig/api?weather=Lisboa,Portugal&hl=pt

http://www.google.com/ig/api?weather=New%20York,NY&hl=pt

I'm not sure why this wouldn't work as a language code for the latitude and longitude approach but it certainly doesn't seem to.

Carth
  • 2,303
  • 1
  • 17
  • 26
  • I actually don't have the City name, just lat-long pairs, so I can't do this. Strange though, that it works with City but not Lat.Long – DavyMac23 Oct 30 '11 at 18:51
  • I was surprised by that as well. Do you think it would work to first translate your coordinates to a nearby city and then use the alternative weather api format so you can use the language code? http://developer.android.com/reference/android/location/Geocoder.html#getFromLocation%28double,%20double,%20int%29 – Carth Oct 30 '11 at 20:40