Searching for content is discovering resources available in your organization. By using the search capability, you can locate maps, layers, data, and other items that are pertinent to your needs. The search results are determined by keywords, tags, and metadata associated with each item making it important to understand how to use these item properties to find content. Tagging and describing your own items is also important to allow users to discover and use your work.
Where to search for items
You can search for items from various data sources including:
Data Source | Description |
---|---|
My Content | Items that users have uploaded or created themselves, such as hosted feature layers, maps, apps, and files. |
Your organization | Items shared within the user's organization, including content shared by other members, groups, or departments. |
Living Atlas of the World | Curated and authoritative geographic information from Esri and its partners, including basemaps, imagery, demographic data, environmental data, and more. |
ArcGIS Marketplace | Access to a wide range of third-party apps, data, and services from Esri partners and developers, allowing users to discover and integrate additional capabilities. |
ArcGIS Hub | Items related to initiatives, projects, or communities within ArcGIS Hub, enabling users to search for and engage with data and content associated with specific initiatives. |
Open Data | Publicly accessible datasets shared by organizations and governments worldwide through the ArcGIS Open Data platform, providing access to a variety of geospatial datasets. |
Community Maps Program | High-quality, authoritative basemaps contributed by organizations and agencies worldwide, providing detailed coverage of specific regions or themes. |
Why search for items
You search for items to:
- Quickly locate relevant spatial datasets, maps, applications, and resources.
- Find specific content without manual browsing through folders or categories.
- Use existing content saving time and effort in creating new maps, layers, and applications.
- Share and access content across teams, departments, and organizations within ArcGIS Online.
- Incorporate search results into workflows, applications, and analyses seamlessly.
How to search for an item
The general steps of searching for an item:
1. Choose a type of authentication
The purpose of an access token in ArcGIS is to provide secure, authorized access to content items, services, and functionality for both applications and users. You need to implement a type of authentication in your app to get an access token and access secure ArcGIS resources. The type of authentication you implement will determine the access privileges and billing method of your app.
The following types of authentication can be used to get an access token:
- API key authentication
- User authentication
- App authentication
2. Get an access token
To get an access token, you need to implement a type of authentication in your application. Different types of authentication result in access tokens with different privileges. Learn how to implement the types of authentication workflows below:
3. Search for the item
Once you have an access token, you can perform the search operation for an item.
Example
Use a query to search for items in the portal. Below are examples of public and private searches for items in ArcGIS Online.
The public example searches for all items that contain the string, type, and owner. The private example searches for your private items that are web maps.
APIs
const portal = new Portal({
url: "https://www.arcgis.com/"
});
portal.load().then(()=>{
const query = {
query: "title: Seven Natural Wonders, type: web map, owner: esri_devlabs"
};
portal.queryItems(query).then((response)=>{
console.log(response);
});
});
REST API
## Public
curl https://www.arcgis.com/sharing/rest/search \
-d 'q=title:"Seven Natural Wonders of the World" AND type:"web map" AND owner:"esri_devlabs"' \
-d 'f=pjson'
## Private
curl https://www.arcgis.com/sharing/rest/search \
-d 'q=title:"Seven Natural Wonders of the World" AND type:"web map" AND owner:"<YOUR_USER_ID>"' \
-d 'f=pjson'
-d 'token=<ACCESS_TOKEN>'
Code examples
Search for items by date
Below is an example that demonstrates how search items that are older than a specified date in your portal.
portal = new Portal(); // Default is "https://www.arcgis.com/sharing/rest"
portal.load().then(()=>{
var queryParams = new PortalQueryParams({
query: "CreationDate < '2022-01-01'"
});
portal.queryItems(query).then((response)=>{
// Log the items older than Jan 1, 2022
console.log("Items older than January 1, 2022:");
result.results.forEach(function (item) {
console.log(item.title);
});
});
});
Search for an items using SQL operators
Below is an example that demonstrates how search for items using the SQL WHERE clause in ArcGIS Online.
// Query parameters
var queryParams = new PortalQueryParams({
query: "title LIKE '%Wetlands%' AND type = 'Feature Service'"
});
// Query portal items
portal.queryItems(queryParams).then(function(queryResult) {
// Display item titles in console
queryResult.results.forEach(function(item) {
console.log(item.title);
});
Tutorials
Import data to create a feature layer
Use data management tools to import files and create a feature layer in a feature service.
Define a new feature layer
Use data management tools to define and create a new empty feature layer in a feature service.
Manage a feature layer
Use a hosted feature layer item to set the properties and settings of a feature layer in a feature service.
Create a vector tile service
Use data management tools to create a new vector tile service from a feature service.
Create a map tile service
Use ArcGIS Online or scripting APIs to publish a map tile service.
Services
Feature service
Add, update, delete, and query feature data.
Vector tile service
Store and access vector tile data.
Map tile service
Store and access map tile data.
Image service
Store and access imagery and raster data.
API support
Use data management tools or Client APIs to create, manage, and access data services. The table below outlines the level of support for each API.
- 1. Use portal class and direct REST API requests
- 2. Access via ArcGIS REST JS
- 3. Requires manually setting styles for renderers