Connecting to ArcGIS online with arcpy in pycharm

02-10-2021 06:47 AM
Labels (2)
New Contributor II

Dear all,

I am interested in making a python script that reads data from Arcgis Online using ArcPy, but I haven't been able to find much information on the net.

I belong to an organisation that has a ArcGIS Online server.

I am following the udemy course "ArcPy for Python Developers using ArcGIS Pro", but as far as I can tell there is no point where the course covers accessing ArcGIS Online through arcpy.

Is there anyone that might be able to push me in the right direction?

Thank you very much in advance,





0 Kudos
4 Replies
MVP Esteemed Contributor

Take a look at the ArcGIS Python API

That should just about do it....
0 Kudos
MVP Esteemed Contributor
0 Kudos
Occasional Contributor III

you can also use the RestAPI on your feature service to query it, have a look at this:

i have some python scripts i run using the endpoints and you dont need to have ArcPy installed either just python and i use http requests


0 Kudos
Esri Contributor

Hi Nikolaj,

As mentioned you can connect to ArcGIS Online through the ArcGIS API for Python.

The below is how to establish a connection to ArcGIS online.

from arcgis.gis import GIS
gis = GIS("", "UserName", "P@ssword123"")