Hi - I'm looking to utilize the Python-API for downloading a per-user daily credit usage report from ArcGIS Online.
I'm on the latest version of the python-api. I've tried to utilize the AGOLUsageReports module but it appears it gives a high level snapshot, not per user usage metrics.
I'm trying to replicate the same type of report that ArcGIS Online can generate but more granular per user, and then automatically add the data to local databases for analysis. I've also tried to run similar tools that were shown here: Dev Summit 2024: Manage your organization using ArcGIS API for Python but it doesn't look like gis.users.me.report(...) exists in the current release.
Any help would be appreciated!
Hi @AJohnson_HFHI,
It is here.
Dates are returned as epochs so you will need to convert to a date string. You can access each dictionary per username and get the credit consumption for each day.
from arcgis.gis import GIS
import json
agol = GIS("home")
report = agol.admin.usage_reports.users(time_frame="7days")
print(json.dumps(report, indent= 4))
Please let us know if this is what you were looking for.
All the best,
Glen