I am trying to list the contents of all my Web maps for a user. I have a list of all the Web Maps but cannot find how to list the Web Maps content. Each web map has a number of layers, these shown in portal but want to know how to get this list in python.
It looks like you can access the layers of a web map using the ArcGIS API for Python. The section "Fix errors in web map" on this link, show an example of doing that.
Using and updating GIS content | ArcGIS for Developers
Leon
Here's a snippet that should get you started. This will return the JSON for a given webmap or list of webmaps in your portal.
from arcgis.gis import GIS
from IPython.display import display
import pandas as pd
import json
gis = GIS('url', 'username', 'password')
webmaps = gis.content.search('', 'Web Map', max_items = 500)
for webmap in webmaps:
print('Title ' + webmap.title, '\nWebmapId ' +webmap.id, '\nOwner ' +webmap.owner)
webmapJSON = webmap.get_data()
for layer in webmapJSON['operationalLayers']:
display(layer)
Thanks Seth! very helpful!
Finding this gem made my morning.