HOW TO

Identify the usage of items in ArcGIS Online using ArcGIS API for Python

Last Published: June 23, 2020

Summary

In ArcGIS Online, it is possible to identify the usage of any item by accessing the items details page and clicking on the Usage tab.

Image of the Usage details window

It is also possible to determine the usage of items programmatically using ArcGIS API for Python for Portal for ArcGIS.

Procedure

The following steps describe how to identify the usage of content items in a portal:

  1. Import the necessary module.
from arcgis.gis import GIS
  1. Connect to ArcGIS Online.
gis = GIS("https://arcgis.com", "user_name")
print("connected")
  1. Search for the content, and sort the items.
content = gis.content.search(query="", sort_field="title", sort_order="asc", max_items=2)

content
  1. Iterate through the items, and print the usage according to the desired timeframe.
for item in content:
	print (item.homepage)
	print (item.usage ('24H'))
	print (item.usage ('7D'))
	print (item.usage ('14D'))
	print (item.usage ('30D'))
	print (item.usage ('60D'))
	print (item.usage ('6M'))
	print (item.usage ('1Y'))

The screenshot below displays the usage of items.

Image of a sample result

Article ID:000021762

Software:
  • ArcGIS Online
  • Portal for ArcGIS
  • ArcGIS Server

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic