I am trying to load some data from ArcGis. I am used to working in Pandas Dataframes, not entirely sure how I can read from API's and get it in a nice table. I tried data['results'] and get feature dataset. But not sure how to organize the data by unique Object ID. Anyone have an idea how to read this into a pandas dataframe?
import urllib.request as urlopen
import urllib.parse as urlencode
import urllib.request as request
import json
import pandas as pd
inPts = {"geometryType" : "esriGeometryPoint",
"spatialReference" : {"wkid" : 54003},
'features':[{'geometry': {'x': -13308192.1956127, 'y': 4221903.58555983}}]}
dist = {'distance':8.5,'units':'esriMiles'}
data = {'Input_Observation_Point': inPts,
'Viewshed_Distance': dist,
'f': 'pjson'}
URL = 'http://sampleserver6.arcgisonline.com/ArcGIS/rest/services/Elevation/ESRI_Elevation_World/GPServer/Viewshed/execute'
req = request.Request(URL, urlencode.urlencode(data).encode('UTF-8'))
response = urlopen.urlopen(req)
response_bytes = response.read()
data = json.loads(response_bytes.decode('UTF-8'))
