Search

Content search is the process of querying the portal service to find users, groups, or different types of items such as maps, scenes, layers, files, services, or apps from templates and builders.

You can use content search to:

  • Search for public or private items.
  • Find different types of items.
  • Sort search results.
  • Return pages of search results.

How to search the portal

To search for items, you make an HTTPS request to the portal service and use the search operation. The search operation supports a query string with fields, and operators, such as AND, OR, and NOT. You can perform an open search for text using the default fields or you can search for text in specific fields such as the title, description, or tags. You can also specify a location to search near, or a bounding box to search in by defining the bbox parameter.

The general steps to search for items are:

  1. Define the URL to the portal service: https://www.arcgis.com/sharing/rest/search.
  2. Provide the text for your search. For example, "Streets", or "Elevation level".
  3. Define the item type for your search. For example, Web Map or Feature Service.
  4. Set the sort order for your return results.
  5. Any additional fields, such as tags, date created, or last modified.

Search for different types of content items in the ArcGIS portal.

URL request

Use dark colors for code blocksCopy
 
1
https://www.arcgis.com/sharing/rest/search?<parameters>

Key parameters

NameDescriptionExamples
qThe text or formatted query with text.q="streets", q="streets AND highways", q=(title:"streets" OR description:"streets")
sortFieldThe primary sort field.sortField=numviews, sortField=created, sortField=modified
sortOrderReturn results in ascending or descending order.sortOrder=asc, sortOrder=desc

Additional parameters: To refine the search further, you can use parameters such as bbox, num, start, and categories.

Query structure

Here are a some of the general rules for formatting queries:

  • For an open search, specify the text at the beginning. e.g. q="streets"
  • To search specific fields, use a colon : after the field name.
  • Use double quotes "text" around all search text.
  • Capitalize all AND, OR, and NOT operators.
  • Use () to group operators.
  • Use the type: field to define the type of items to return. e.g. type: Web Map

For example:

Use dark colors for code blocksCopy
 
1
https://www.arcgis.com/sharing/rest/search?f=json&q=title:"London Tube" AND type:"Web Map" AND tags:Transportation

Default fields

When searching for text in items or groups, if you do not provide fields, the following default fields are searched.

ItemsGroups
titletitle
tagstags
descriptiondescription
snippetsnippet
tagKeywordsowner

For example:

Use dark colors for code blocksCopy
 
1
https://www.arcgis.com/sharing/rest/search?f=json&q="Seven Natural Wonders of the World"

Examples

The following examples illustrate how to format queries to search for different types of content in the ArcGIS portal. Most APIs set the default portal URL to https://www.arcigs.com/sharing/rest.

Search for text

Find any type of item with the keywords title or description.

APIs

ArcGIS REST JSArcGIS REST JSArcGIS API for JavaScriptArcGIS API for PythonArcGIS Runtime API for iOS
Use dark colors for code blocksCopy
             
1
2
3
4
5
6
7
8
9
10
11
12
13
import { searchItems } from "@esri/arcgis-rest-portal"
// Define a query
const query = new SearchQueryBuilder()
  .match("Seven Natural Wonders of the World")
  .in("title")
  .or()
  .match("Seven Natural Wonders of the World")
  .in("description")

searchItems(query, { portal: "https://www.arcgis.com/sharing/rest" })
  .then((response) => {
    console.log(response);
});

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
   
1
2
3
curl https://www.arcgis.com/sharing/rest/search \
-d 'q=title:"Seven Natural Wonders of the World" OR description:"Seven Natural Wonders of the World"' \
-d 'f=pjson'

Search for tags and an owner

Find items by searching for tags and an owner name.

APIs

ArcGIS REST JSArcGIS REST JSArcGIS API for JavaScriptArcGIS API for PythonArcGIS Runtime API for iOS
Use dark colors for code blocksCopy
              
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { searchItems } from "@esri/arcgis-rest-portal"
// Define a query
const query = new SearchQueryBuilder()
  .match("USA Demographics")
  .in("tags")
  .and()
  .match("esri")
  .in("owner");

searchItems(query, { portal: "https://www.arcgis.com/sharing/rest" }).then(
  (response) => {
    console.log(response);
  }
);

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
   
1
2
3
curl https://www.arcgis.com/sharing/rest/search \
-d 'q=tags:"USA Demographics" AND owner:"esri"' \
-d 'f=pjson'

Search for a type of item

Find items by searching for a type of item. Learn more about the types of items in items.

APIs

ArcGIS REST JSArcGIS REST JSArcGIS API for JavaScriptArcGIS API for PythonArcGIS Runtime API for iOS
Use dark colors for code blocksCopy
             
1
2
3
4
5
6
7
8
9
10
11
12
13
import { searchItems } from "@esri/arcgis-rest-portal"
// Define a query
const query = new SearchQueryBuilder()
  .match("London Map")
  .in("title")
  .and()
  .match("Web Map")
  .in("type");

searchItems(query, { portal: "https://www.arcgis.com/sharing/rest" })
  .then((response) => {
    console.log(response);
});

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
   
1
2
3
curl https://www.arcgis.com/sharing/rest/search \
-d 'q=title:"London Map" AND type:"Web Map"' \
-d 'f=pjson'

Search for a group

Find groups by searching for a text in the title.

APIs

ArcGIS REST JSArcGIS REST JSArcGIS API for JavaScriptArcGIS API for PythonArcGIS Runtime API for iOS
Use dark colors for code blocksCopy
          
1
2
3
4
5
6
7
8
9
10
import { searchGroups } from "@esri/arcgis-rest-portal"
// Define a query
const query = new SearchQueryBuilder()
    .match("Hikers")
    .in("title")

searchGroups(query, { portal: "https://www.arcgis.com/sharing/rest" })
.then((response) => {
  console.log(response);
});

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
   
1
2
3
curl https://www.arcgis.com/sharing/rest/community/groups \
-d 'q=title:"hikers"' \
-d 'f=pjson'

Search near a location

Find items near point or a bounding box (extent).

APIs

ArcGIS REST JSArcGIS REST JSArcGIS API for JavaScriptArcGIS API for PythonArcGIS Runtime API for iOS
Use dark colors for code blocksCopy
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { searchItems } from "@esri/arcgis-rest-portal"
// Define a query
const query = new SearchQueryBuilder()
  .match("Food carts")
  .and()
  .match("Web Map")
  .in("type")

  const params = {
    bbox: "-122.6750,45.5051 ,-122.6750,45.5051" // Portland, Oregon
  }

  searchItems(query, params, { portal: "https://www.arcgis.com/sharing/rest" })
  .then((response) => {
      console.log(response);
});

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
    
1
2
3
4
curl  https://www.arcgis.com/sharing/rest/search \
-d 'bbox=-122.6750,45.5051, -122.6750,45.5051' \
-d 'q="food cart" AND type:"web map"' \
-d 'f=pjson'

Tutorials

Use tools to create different types of content and build content-driven applications.

Web maps

Web scenes

Feature layers

Vector tile layers

Basemap layers

Services

Portal service

Store, manage, and access private and public content.

API support

Full supportPartial supportNo support
  • 1. Limited operations, use HTTP requests.
  • 2. Access via ArcGIS REST JS.

Tools

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.