I have a list of GeoCodes that I want to find the state legislators for using the legislator_geo_search.
I am using python and iterating through the data frame passing latitude and longitude variables to the function but I keep getting this errorr:
raceback (most recent call last):
File "/Users/TomCurran/PycharmProjects/Plotly/sunglight_senate.py", line 22, in <module>
ok_rep = sunlight.openstates.legislator_geo_search(lat, lon)
File "/Library/Python/2.7/site-packages/sunlight/services/openstates.py", line 103, in legislator_geo_search
return self.get(["legislators", "geo"], **kwargs)
File "/Library/Python/2.7/site-packages/sunlight/service.py", line 83, in get
raise ex
sunlight.errors.BadRequestException: 'Error (502) -- <html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor="white">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.4.1 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n'
When I pass string through - example sunlight.openstates.legislator_geo_search('XX.XXXX', 'YY.YYYY') I can get a JSON back.