Python Forum
FCC API: addressing unexpected error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FCC API: addressing unexpected error
#6
Quote:from fcc.census_block_conversions import census_block_fips
Show your import code.

You are using python 2.7 and Python 3.6(anaconda).
With 3.6(anaconda):
Quote:JSONDecodeError: ('Expecting value: line 1 column 1 (char 0)'
This usually mean.
  • non-JSON conforming quoting
  • XML/HTML output (that is, a string starting with <), or
  • incompatible character encoding
Tells you that at the very first position the string already doesn't conform to JSON.

A test with Requests and Python 2.7.
Requests read it without Unicode error.
import requests
r = requests.get('http://data.fcc.gov/api/block/find?format=json&latitude=32.35204448&longitude= -106.77485461&showall=true')
Test:
>>> r.json()['County']
{u'FIPS': u'35013', u'name': u'Do\xf1a Ana'}
>>> print r.json()['County']['name']
Doña Ana
Reply


Messages In This Thread
FCC API: addressing unexpected error - by kiton - Jun-26-2017, 05:53 PM
RE: FCC API: addressing unexpected error - by kiton - Jun-26-2017, 07:09 PM
RE: FCC API: addressing unexpected error - by kiton - Jun-27-2017, 11:41 PM
RE: FCC API: addressing unexpected error - by snippsat - Jun-28-2017, 04:54 AM
RE: FCC API: addressing unexpected error - by kiton - Jun-28-2017, 06:21 PM
RE: FCC API: addressing unexpected error - by kiton - Jun-29-2017, 07:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Addressing with np.where pberrett 0 1,604 May-19-2019, 12:45 PM
Last Post: pberrett

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020