I see. Well, if you're comfortable using some Python, you can probably do this with Pandas and the ArcGIS Python API.
In particular, Pandas has a number of ways to get data in from other formats. Once you bring the JSON into a dataframe, you can do any other reshaping of the data there.
import pandas as pd
j = {
"metadata":{
"source":"DOE/CESER/ISER EAGLE-I™ Project",
"timestamp":"2021.09.10.16.52.01",
"url":"https://eagle-i.doe.gov",
"termsOfUse":"Terms of Use | The EAGLE-I™ real-time or historical electric outage data will not be repackaged, published, or distributed outside of the federal or state government emergency response community. | Allowed publishing or distribution is allowed for data summaries or derived data as long as the attribution noted above is preserved. | Similar data publishing and distribution limitations are required for non-DOE users of EAGLE-I data."
},
"data":[
{"currentOutage":0,"currentOutageRunStartTime":"2021-09-10T16:30:00Z","maxOutage1":0,"maxOutage1RunStartTime":"2021-09-10T16:30:00Z","maxOutage24":1,"maxOutage24RunStartTime":"2021-09-10T15:30:00Z","totalCustomers":16247,"currentOutageHasOverrideData":False,"maxOutage24HasOverrideData":False,"maxOutage1HasOverrideData":False,"countyName":"Adams","stateId":19,"stateName":"OH","countyFIPSCode":"39001"}
],
"resolution":"MINUTES"
}
df = pd.DataFrame(data=j['data'])
And here's the dataframe:
Not sure how many calls you'll be making to the API and how consistently the output is formatted, but if you read through the Pandas docs, there are ways to easily append multiple frames into one. Or else, you can extract the "data" object from each call and merge those into a single list before creating the dataframe.
Then perform whatever reshaping you need to, if any.
After that, you can use the spatial submodule of the dataframe that comes from the ArcGIS API, to publish directly to a feature layer.
reshaped_df.spatial.to_featurelayer('my-layer-name')
EDIT: I should add, if you bring in the requests library, you can make your API calls right in the same script as the rest of this process.
- Josh Carlson
Kendall County GIS