A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.arcgis.com/python/latest/guide/get-started/ below:

Get started | ArcGIS API for Python

There are a number of ways to install and configure ArcGIS API for Python. If you are new, follow the steps below to get started with conda and Jupyter Notebooks. For additional installation configurations, go to ArcGIS Pro, Docker, Google Colaboratory, or Offline.

Note

Before installing, go to System requirements to ensure you have the correct version of Python and dependencies.

1. Sign up for an account

To use the ArcGIS API for Python to access content, services, or an organzation, you need an ArcGIS Developer account, ArcGIS Online account, or ArcGIS Enterprise account. The type of account, user type, and role you need depends on the resource you need to access and the operations you wish to undertake.

If you do not have an account, select one of the options below:

Get started for free with ArcGIS Platform

Get a free trial for ArcGIS Online

Tip

To get an account for an existing ArcGIS organization contact your ArcGIS Online or ArcGIS Enterprise administrator.

2. Install the API

To use the ArcGIS API for Python you need to install conda.

Install conda

  1. To install conda, go to the installation guide.

  2. In the guide, select your operating system and then follow the installation instructions.

Install the ArcGIS API for Python

  1. Open a terminal window.
  2. In the terminal, navigate to your working directory.
  3. Run the following command to activate your environment: conda activate <YOUR_ENVINRONMENT>
  4. Install the ArcGIS API for Python: conda install -c esri arcgis arcgis-mapping
3. Run Jupyter Lab

Start the Jupyter Lab server with the following steps:

  1. Open a terminal window.
  2. In the terminal, run the command: jupyter lab

The command starts Jupyter Notebook and opens it in your default web browser.

Tip

To learn more about creating and running notebooks, go to Using the Jupyter Notebook environment.

4. Create your first script

Create a Notebook to geocode a text string to find an address.

  1. In Jupyter Notebook, click New > Python 3.
  2. In the top cell, import the GIS, geocode and Geocoder modules and set your API key:

To access secure ArcGIS services and resources in ArcGIS Platform, you need to use an access token. The easiest way to get started is to create an API key. Learn more about access tokens and authentication in Security and authentication.

Get an API key

Use dark colors for code blocks Copy

1
2
3
4
5
6
7
8
9
10
11
12
from arcgis.gis import GIS
from arcgis.geocoding import geocode, Geocoder

gis = GIS(api_key="<YOUR_API_KEY>")

# Location services standard endpoint URL
# https://developers.arcgis.com/documentation/mapping-apis-and-services/geocoding/services/geocoding-service/#service-urls
geocode_url = Geocoder("https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/",gis=gis)

geocode_result = geocode(address="380 New York Street, Redlands, CA", geocoder=geocode_url)

geocode_result
  1. In the toolbar, click Run to execute the code. You should see geocoded address results.
  1. In Jupyter Notebook, click New > Python 3.
  2. In the top cell, import the GIS and geocode modules.
  3. Provide the credentials you created from step 1 on this page to log in.
Guide topic:

To learn more about authentication schemes, Go to Authentication schemes

Use dark colors for code blocks Copy

1
2
3
4
5
6
7
8
from arcgis.gis import GIS
from arcgis.geocoding import geocode

gis = GIS(url="https://wwww.arcgis.com", username="<YOUR_USERNAME>", password="<YOUR_PASSWORD>")

geocode_result = geocode(address="380 New York Street, Redlands, CA")

geocode_result
  1. In the toolbar, click Run to execute the code. You should see geocoded address results.
  1. In Jupyter Notebook, click New > Python 3.
  2. In the top cell, import the GIS and geocode modules.
  3. Provide your ArcGIS Enterprise Organization URL and the credentials from Step 1 to log in.
Guide topic:

To learn more about authentication schemes, Go to Authentication schemes

Use dark colors for code blocks Copy

1
2
3
4
5
6
7
8
9
from arcgis.gis import GIS
from arcgis.geocoding import geocode, Geocoder

# an example Organization URL https://pythonapi.playground.esri.com/portal/home/
gis = GIS(url="https://{YOUR_ORGANIZATION.DOMAIN.COM}/{CONTEXT}/home", username="{YOUR_USERNAME}", password="{YOUR_PASSWORD}")

geocode_result = geocode(address="380 New York Street, Redlands, CA")

geocode_result
  1. In the toolbar, click Run to execute the code. You should see geocoded address results.
5. Follow the tutorials

Go to the tutorials to create and run notebooks to perform different operations.

6. Explore the samples

Go to the samples to learn how to perform more tasks with the API.

Next steps

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4