Get started with AgentCore Web Search
To search the web with AgentCore Web Search, grant a principal permission to call the InvokeWebSearch API, and then call it with the Amazon SDKs or the Amazon Command Line Interface (Amazon CLI).
Prerequisites
Before you call the API, make sure that you have the following:
-
An Amazon account and credentials that the Amazon SDKs or the Amazon CLI can use.
-
An Amazon Region where the API is available. For the list, see Regions.
-
A current version of the Amazon SDK for Python (Boto3) or the Amazon CLI. Earlier versions don’t include the
InvokeWebSearchoperation. -
Permission to call the API, as described in the following section.
Grant permission to call the API
To call the API, an Amazon Identity and Access Management (IAM) principal needs the bedrock-agentcore:InvokeWebSearch permission on the Amazon managed web search tool. The tool’s Amazon Resource Name (ARN) has the following form:
arn:aws:bedrock-agentcore:<Region>:aws:tool/web-search.v1
The account field of the ARN is the literal value aws, because Amazon owns the tool. It is not your account ID.
The following identity-based policy allows a principal to call the API in one Region. Replace <Region> with the code of a Region from Regions. To allow calls in every Region, use * in place of the Region code.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowInvokeWebSearch", "Effect": "Allow", "Action": "bedrock-agentcore:InvokeWebSearch", "Resource": "arn:aws:bedrock-agentcore:<Region>:aws:tool/web-search.v1" } ] }
Search the web
Only webSearchId and searchQuery are required. The identifier of the Amazon managed web search tool is web-search.v1. For an example of the response, see Response.
The following Amazon SDK for Python (Boto3) and Amazon CLI examples search for recent pages about a topic. They return up to five results, limit the results to two domains, and keep only pages published in January 2026:
Example
For the request fields and their limits, see Request and response. For the full request and response syntax, see InvokeWebSearch in the Amazon Bedrock AgentCore API Reference.