I am using the ArcGIS python API as I would like to count items in my agol that are marked as authoritative. I have been able to search by owner and type but I cannot get the contentStatus search term to work at all. I have read the documentation over and over and I just can't figure out what is wrong.
Hey @RobGordon1
Could you try to search for this here:
auth_items = gis.content.search(query='contentStatus:authoritative', max_items=100)I think it falls into a general category of authoritative, I've seen this here too:
Cody
Thanks @CodyPatterson but... I have answered my own question....
So this page Search reference | ArcGIS REST APIs | ArcGIS Developers has the term contentStatus which does not work. But this non python page on advanced search has the term contentstatus . This does work! 😂😭
To add to the confusion I have to use contentstatus:public_authoritative (or org_authoritative) as authoritative alone is not a recognised value. This is as written on the API page next to contentStatus.
My status is now: 😑
Hey @RobGordon1
Definitely quite a lot of strangeness! I seem to be left as that status quite often when attempting to read through some of the documentation unfortunately.
Cody
A couple of years too late, but hopefully valuable to others.
Per Copilot:
from arcgis.gis import GIS
import pyodbc
# 1. Reuse your ArcGIS Pro login (no credentials in code)
gis_portal = GIS("pro")
# 2. Types we consider "webapps" for the techfolio
types = [
"Web Mapping Application",
"Dashboard",
"Web Experience"
]
all_webapps = []
for t in types:
# Exclude items owned by esri_apps at the search stage
# You can add more owners later if needed: 'AND -owner:esri'
items = gis_portal.content.search(
query='-owner:esri_apps', # exclude Esri's org apps
item_type=t,
max_items=1000
)
all_webapps.extend(items)
print(f"Total webapps found (owner != esri_apps): {len(all_webapps)}")
# 3. Filter to authoritative only using the Item.content_status property
authoritative_apps = []
for item in all_webapps:
status = (getattr(item, "content_status", "") or "").strip().lower()
# Debug – optional: see status for your items
print(item.title, "| owner:", item.owner, "| status:", repr(status))
if status == "org_authoritative":
authoritative_apps.append(item)
print(f"Authoritative webapps (excluding owner esri_apps): {len(authoritative_apps)}")