Accessing hosted feature layers in Portal using ArcGIS API python

388
1
12-01-2021 07:19 AM
Aravinthkumar
New Contributor III

I am trying to retrieve only the hosted feature layers in the ArcGIS portal, is there any way like accessing the feature layer using ArcGIS API python ?? 

from arcgis.gis import GIS
gis = GIS(url='https://pythonapi.playground.esri.com/portal', username='arcgis_python', password='amazing_arcgis_123')
type(gis.content)
search_result = gis.content.search(query="", item_type="Feature Layer")
search_result
 

 

1 Reply
JosueGreghi
New Contributor

from arcgis.gis import GIS

gis = GIS(url='https://pythonapi.playground.esri.com/portal', username='arcgis_python', password='amazing_arcgis_123')

search_result = gis.content.search(query="", item_type="Feature Layer")

for item in search_result:
print(f"Nome: {item.name}")
print(f"ID: {item.id}")
print(f"URL: {item.url}")
print("-------")

0 Kudos