Skip To Content ArcGIS for Developers Sign In Dashboard


You will learn: how to build an app to load and display a 3D web scene from ArcGIS Online.

A web scene is a JSON structure that contains the settings required to display a 3D map. ArcGIS and custom applications can load web scenes and automatically configure the map extent, camera, basemap, layers and styles, labels and more. Web scenes can be created interactively with the Scene Viewer and ArcGIS Pro. Web scenes are stored in ArcGIS Online or ArcGIS Enterprise as an item with a unique ID.

In this tutorial you will search ArcGIS Online for an existing web scene and display it.

Before you begin

The ArcGIS API for Python tutorials use Jupyter Notebooks to execute Python code. If you are new to this environment, please see the guide to install the API and use notebooks locally.


Create a new notebook

  1. Go to Esri Juptyter Notebooks and click New > Python 3 to create a new notebook.

    In each step below, type (or copy and paste) the commands into a new notebook cell and run the code by clicking run cell or pressing shift + Enter.

  1. Import the GIS module.

    from arcgis.gis import GIS
  2. Make an anonymous connection to ArcGIS Online.

    gis = GIS()

Display a web scene with the ArcGIS API for Python

  1. Search for a publicly available web scene owned by esri_devlabs containing datasets about Los Angeles, CA trails.

    webscene_search = = "LA Trails *", item_type = "Web Scene")
  2. Retrieve the web scene item from the resulting list.

    webscene_item = webscene_search[0]
  3. Import the WebScene class from the arcgis.mapping module and visualize the web scene.

    from arcgis.mapping import WebScene
    la_trails = WebScene(webscene_item)

Congratulations, you're done!

Your scene and layers (feature services) should look something like this.


Explore Web Scenes with the REST API

All hosted feature layers have a REST endpoint that you can use to access the data directly. This can be accomplished with a URL request from a web browser, a custom application, or the ArcGIS APIs.

Let's retrieve the layers from the web scene. You can query the web scene as a dictionary.

  1. operational_layers = la_trails['operationalLayers']
    n = len(operational_layers)
    print("The web scene has {} layers.".format(n))
  2. Query the list for the title and URL values of each layer.

    for layer in operational_layers:
        print("{}\n\t{}".format(layer['title'], layer['url']))
  3. In your browser, add the URL for the Trails layer to the browser (or just copy/paste from below) to explore the REST endpoint:
  4. Explore the other layers through the same steps.

To learn more about querying data with the REST API, see the Query a feature layer tutorial.