Search groups

You can use the portal service to search for groups. This operation allows authenticated users to search for specific groups in the portal. The portal search index is updated whenever groups are created, content updated in a group, or a group is deleted. The results from a group search are limited to searching for groups that are accessible in the portal. This is based on group permissions managed by adjusting the access settings.

You can search for groups based on:

  • Keywords such as name, description, or tags.
  • Groups created or owned by a specific member or organization in the portal.
  • Specific tags that indicate the purpose of the group.
  • Categories or themes to filter results based on topic or industry.

Search parameters

The general steps to search for groups are:

  1. Define the URL to the portal service: https://www.arcgis.com/sharing/rest/community/groups.
  2. Provide the text for your search. For example, username or fullName.
  3. Set the sort order for your return results.
  4. Any additional fields, such as description, tags, created or modified.

URL request

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

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
tagKeywordsowner

Key parameters

NameDescriptionExamples
qThe text or formatted query with text.q="streets"
q="john+smith"
q=(firstName:"john" OR lastName:"smith")
filterApply structured filtering using field name.filter=tags:"transportation"
filter=type:"Feature Service"
sortFieldThe primary sort field.sortField=title
sortField=created
sortField=type
sortField=modified
sortOrderReturn results in ascending or descending order.sortOrder=asc
sortOrder=desc
searchUserAccessGroups a user owns and groups where a user is a member.searchUserAccess=groupMember

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="utilities"
  • To search specific fields, use a colon : after the field name.
  • Use double quotes "text" around all user search text.
  • Capitalize all AND, OR, and NOT operators.
  • Use () to group operators.

For example:

Use dark colors for code blocksCopy
1
https://www.arcgis.com/sharing/rest/community/groups?f=json&q="john"

Code examples

Search for a group by name

You can search for groups by their name in your portal. This feature allows you to quickly find groups that match specific keywords or titles making it easier to connect with relevant content and collaborate with others.

ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Specify the group name you want to search for
group_name = "Your Group Name"

# Search for the group
groups = gis.groups.search(f'title:"{group_name}"')

# Check if any groups were found
if groups:
    for group in groups:
        print(f"Group found: {group.title}")
        print(f"Group ID: {group.id}")
        print(f"Owner: {group.owner}")
        print(f"Description: {group.description}")
        print("---")

Search for a group by username

You can search for groups using a specific member username in your portal. This feature allows you to find groups that are associated with or created by a particular member.

ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Specify the username you want to search groups for
username = "username_to_search"

# Search for groups owned by the specified username
groups = gis.groups.search(query=f'owner:{username}')

# Check if any groups were found
if groups:
    print(f"Groups owned by {username}:")
    for group in groups:
        print(f"- {group.title}")
        print(f"  ID: {group.id}")
        print(f"  Description: {group.description}")
        print("---")

Search for groups by tags

You can search for groups using tags in your portal. Tags are descriptive keywords that are associated with groups to help categorize and identify them. By using tags, you can quickly narrow down your search results to find groups.

ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Define the tags to search for
tags = ",".join(["tag1", "tag2", "tag3"])

# Perform the group search
groups = gis.groups.search(f'tags:"{tags}"')

# Print the results
for group in groups:
    print("Group Name:", group.title)
    print("Group ID:", group.id)
    print("Group Owner:", group.owner)
    print("Group Tags:", group.tags)
    print("\n")

Search for group by summary text

You can search for groups using their summary text. The summary is a descriptive text that provides purpose, content, or focus area for a group. By searching using keywords, you can quickly locate groups.

ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Enter the summary you want to search for
summary_to_search = "Enter summary here"

# Perform a search for groups based on the summary field
results = gis.groups.search(f'snippet:"{summary_to_search}"')

# Print the search results
print("Search Results:")
for group in results:
  print(f"Group Name: {group.title}, Group ID: {group.id}")

Search for groups with a specific access type

You can search for groups based on their specific access type in your portal. The access type set for a group determines who can view and join the group. These access types are:

  • Private: Only group members and administrators can view the group and its content.
  • Organization: Only members of your portal can find and join the group.
  • Public: Anyone including users outside your organization can find and join the group.
ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Specify the access type you want to search for
# Valid options are: 'private', 'org', 'public'
access_type = "private"

# Search for groups with the specified access type
groups = gis.groups.search(f'access:{access_type}')

# Check if any groups were found
if groups:
    print(f"Groups with {access_type} access:")
    for group in groups:
        print(f"- {group.title}")
        print(f"  ID: {group.id}")
        print(f"  Owner: {group.owner}")
        print(f"  Access: {group.access}")
        print(f"  Description: {group.description}")
        print("---")

Tools

Use tools to access the portal and create and manage content for applications.

Services

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