Airport ID queries return broken/partial data.

  • 2
  • Problem
  • Updated 5 years ago
Querying an airport ID (e.g. KSFO or KSAN or KORD, etc, etc) "succeeds", but has no real data. The "station_id" is blank, and the forecast data is missing/null -- but it returns success, and gives you city information.

Known problem?
Photo of Taner H.

Taner H.

  • 4 Posts
  • 0 Reply Likes

Posted 5 years ago

  • 2
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 122 Reply Likes
It should be fine, what was the URL you were hitting when that happened?
Photo of Taner H.

Taner H.

  • 4 Posts
  • 0 Reply Likes
Hi, thanks for the response.

I'm trying to look up (for example) KSAN (San Diego airport). Both JSON and XML return weird "partial" responses. Meaning, fields like "city" have the correct info -- just no weather info.

URL examples:

http://api.wunderground.com/api/(API_...
or
http://api.wunderground.com/api/(API_...

These URLs used to work fine...

Thanks,

-Taner
Photo of Taner H.

Taner H.

  • 4 Posts
  • 0 Reply Likes
Quick follow-up:

It seems if I query some of the more unique airport codes without the leading "K", they will work. e.g. "SFO" works... but the station ID even comes back as "KSFO". This causes problems with things like "SAN", since it's now non-unique.

Mostly curious what happened, as this used to work, and was a nice way to look up things based on airport code :-) (By using KNNN where NNN is the 3-letter airport code)

compare:

http://api.wunderground.com/api/(API_...

with:

http://api.wunderground.com/api/(API_...
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 122 Reply Likes
I hate to say it, but its a uppercase specific thing. Using KSAN or KSFO works but not ksan or ksfo. Lower and uppercase city names work, but not airport when you are specify the airport in this way. Sorry for the weirdness!
Photo of Taner H.

Taner H.

  • 4 Posts
  • 0 Reply Likes
Hah, well, that's unfortunate... I had been flattening all input to lowercase before constructing the query URL, so I never would have noticed that ;-)

I changed to flattening to upper case, and all is well now!

Thanks for the help!

-Taner