Credit usage reports per user using the Python API

07-26-2019 11:02 AM
Esri Contributor

Is it possible to return credit usage reports for each user in an Arcgis Online organization using the Python API? And if so, can it be returned for a specific period of time?

The credit manager class just returns the credit usage for the entire organization.

Tags (1)
0 Kudos
3 Replies
Esri Contributor

Hi Peter Gamberg‌,

you can use the following code to check the credits availability for each user:

#Checking credits assigned and available to a user
api_acc = gis.users.get('USERNAME')
"""When you turn on credit budgeting (using the enable() method), 
the User object gets additional properties to 
indicate the assignedCredits and remaining avialableCredits. 
Thus, you can verify as shown below:"""

"""As the user continues to use the credits, the availableCredits 
property can be used to check how much is available for that account. 
If a user does not have a limit set, then the total available credits 
in the org become their available credits. The account shown below as 
not custom limit, hence, it inherits the org's total limit.‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍"""
Occasional Contributor

I have added an idea for this as I was just trying to do this also. Please upvote it here!

0 Kudos
New Contributor III

Use gis.admin.usage_reports.users().  See the sample @ 

0 Kudos