HOW TO

Query ArcGIS Online hosted feature service by field using ArcGIS REST API

Last Published: March 11, 2026

Summary

Querying data by field from an ArcGIS Online hosted feature service via the ArcGIS REST API is particularly useful when working with large datasets because it retrieves only the necessary information. This reduces the response size and improves performance.

The feature service can be queried through the REST API depending on the authorized administrative privileges. Refer to ArcGIS REST APIs: Manage API access for more information.

Procedure

  1. Log in to ArcGIS Online and click Content > My Content.
  2. Browse to the hosted feature layer, click More Options The More Options icon, and select View details.
  3. On the Overview tab, under URL, click View The View icon to open the ArcGIS REST Services Directory window.
Note: 
Alternatively, in the item page, under Source, click Feature Service to open the ArcGIS REST Services Directory window.
  1. In the ArcGIS REST Services Directory window, under Layers, select the feature service.
  2. In the feature service's page, for Supported Operations, click Query.
  3. In the Query page, specify the following parameters:
    1. For Where, specify a clause that filter results. In this example, 1=1 is specified to return all records.
    2. For Out Fields, specify the field. In this example, City is specified.
Note: 
Optionally, for the Out Fields parameter, multiple fields can be queried by separating them with commas (,) or all fields in the layer can be retrieved by specifying an asterisk (*).
The ArcGIS REST Services Directory configurations
  1. Click Query (GET).

The result of querying the feature service by the City field is shown below.

The results from querying in the ArcGIS REST Administrator Directory

Article ID: 000037380

Software:
  • ArcGIS REST API
  • ArcGIS Online

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