Invalid JSON being returned on historical requests

  • 1
  • Question
  • Updated 5 years ago
I've noticed that on a non-trivial amount of historical requests, Weather Underground returns invalid JSON on responses. It's getting better on more recent records.

Unparseable responses by month:

Jan 2012 - 75/8031 = 0.94%

...

Jan 2013 - 103/8031 = 1.28 %
Feb 2013 - 122/8031 = 1.52 %
Mar 2013 - 111/8031 = 1.38 %
Apr 2013 - 35/8031 = 0.44 %
May 2013 - 33/8031 = 0.41 %
Jun 2013 - 31/8031 = 0.39 %
Jul 2013 - 32/8031 = 0.40 %
Aug 2013 - 29/8031 = 0.36 %
Sep 2013 - 40/8031 = 0.50 %
Oct 2013 - 34/8031 = 0.42 %
Nov 2013 - 0/8031 = 0.00 %
Dec 2013 - 0/8031 = 0.00 %

The problem is that some results add a trailing comma to the results in the "dailysummary" section, which is not valid so all parsers reject the response.

e.g. EPPL Jan 01 - 31 2013:

http://api.wunderground.com/api/API_K...

Look at the last 5 lines of the JSON it returns:

.... "since1jancoolingdegreedays":"","since1jancoolingdegreedaysnormal":"" },
]
}
}

The comma after the last record before the closing ']' is not legal.

Here is a list of the ICAO codes for Jan 2013 that return invalid results:

AYGN
AYKA
BIST
CYBQ
CYHB
DNBE
EDFC
EDFE
EDGP
EPMO
EPPL
EPWK
FAGC
FAKR
FATH
FBTL
GMMW
GVMA
GVMT
GVSF
K33V
K4MR
K7L2
KASY
KBDU
KBYS
KD60
KFEW
KFSU
KHAE
KLMO
KLUA
KNFE
KNKT
KNOG
KRCR
LKKT
LKPL
LKPM
LKPS
LKSA
LKSR
LKST
MMJA
MMTN
NZDV
NZFI
NZPM
OIAD
OIKQ
OMAM
PACK
PADM
PADY
PAFK
PAFL
PAFS
PAFW
PAGH
PAGN
PAHC
PAJZ
PAKH
PAKI
PAKY
PALG
PAMB
PANW
PAOO
PAOU
PARS
PARY
PATE
PATQ
PFKT
PFSH
SAOD
SBAS
SBLN
SBML
SVSP
TUPA
VIJU
VTUO
VVNT
WIKB
WIKN
YAPH
YBHI
YBTH
YCBB
YCCY
YEVD
YGFN
YKML
YMCO
YMCT
YNBR
YNRC
YNWN
YPBO
YPOD
YTNG
Photo of Robert

Robert

  • 3 Posts
  • 0 Reply Likes

Posted 5 years ago

  • 1

Be the first to post a reply!