HOW TO

Validate map areas and associated replica IDs for a web map using the ArcGIS API for Python

First Published: June 18, 2026
Last Published: June 18, 2026

Summary

This article explains how to validate the map areas associated with a web map and list the replica IDs generated for each map area. The solution uses the ArcGIS API for Python to retrieve related map areas and inspect the offline packages created from them.

Environment

  • ArcGIS Online or ArcGIS Enterprise
  • ArcGIS API for Python
  • Python 3.x
  • Access to the web map item in the portal

When working with offline-enabled web maps, it may be necessary to verify which map areas are associated with a specific web map and confirm the replica IDs created for offline usage. This validation helps troubleshoot synchronization issues, replica management problems, or unexpected offline behavior.

Portal for ArcGIS/ArcGIS Online do not directly expose this information in the user interface, so it must be retrieved programmatically.

Procedure

We can validate map areas and their associated replica IDs by querying the web map item and inspecting its related items. Each map area can have one or more offline packages, stored as SQLite geodatabases, that contain a replica ID.

The following script retrieves:

  • All map areas related to a web map
  • All offline packages related to each map area
  • The replica ID for each SQLite geodatabase package

Procedure

  1. Sign in to your GIS using the ArcGIS API for Python.
  2. Retrieve the web map item using its item ID.
  3. Get all map areas related to the web map.
  4. For each map area, retrieve the associated offline packages.
  5. Identify SQLite geodatabases and print their replica IDs.
from arcgis.gis import GIS
gis = GIS("home")

webmap = gis.content.get("REPLACE WITH WEB MAP ID")
mapAreas = webmap.related_items("Map2Area")

for mapArea in mapAreas:
    print ("----------Map Area----------")
    mapAreaId = mapArea.itemid
    print ("Map Area with ID: "+ mapAreaId)
    print ("Has the following replicas: ")
    itemsmapArea = mapArea.related_items("Area2Package")
    for itemmapArea in itemsmapArea:
        if (itemmapArea.type == "SQLite Geodatabase"):
            print("Replica ID: " + str(itemmapArea.properties['replicaID']))

Article ID: 000040973

Software:
  • ArcGIS Online
  • ArcGIS API for Python
  • ArcGIS Enterprise

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options