Amazon Bedrock AgentCore

2026/11/24 - Amazon Bedrock AgentCore - 1 updated api methods

Changes  Adds the optional userLocation parameter to InvokeWebSearch. Specify a two-letter ISO 3166-1 alpha-2 country code to refine web search results for that country. InvokeWebSearch also accepts search queries in languages other than English.

InvokeWebSearch (updated) Link ΒΆ
Changes (request)
{'userLocation': {'country': 'string'}}

Searches the web and returns a ranked list of results. Each result includes a text extract from the page.

You can filter the results by domain and by publication date.

To use this operation, you must have the bedrock-agentcore:InvokeWebSearch permission on the resource arn:${Partition}:bedrock-agentcore:${Region}:aws:tool/web-search.v1.

See also: AWS API Documentation

Request Syntax

client.invoke_web_search(
    webSearchId='string',
    searchQuery='string',
    maxResults=123,
    filters={
        'domainFilter': {
            'include': [
                'string',
            ],
            'exclude': [
                'string',
            ]
        },
        'publishedDateFilter': {
            'publishedAfter': datetime(2015, 1, 1),
            'publishedBefore': datetime(2015, 1, 1)
        }
    },
    userLocation={
        'country': 'string'
    }
)
type webSearchId:

string

param webSearchId:

[REQUIRED]

The identifier of the web search tool to invoke. The Amazon Web Services-managed web search tool is web-search.v1.

type searchQuery:

string

param searchQuery:

[REQUIRED]

The text to search for.

type maxResults:

integer

param maxResults:

The maximum number of results to return. Defaults to 25.

type filters:

dict

param filters:

The filters to apply to the search results.

  • domainFilter (dict) --

    The domains to include in or exclude from the results.

    • include (list) --

      The domains to return results from. Results from other domains are not returned.

      • (string) --

        A domain name, for example example.com.

    • exclude (list) --

      The domains to never return results from.

      • (string) --

        A domain name, for example example.com.

  • publishedDateFilter (dict) --

    The publication time range of the results.

    • publishedAfter (datetime) --

      The earliest publication time of the results, inclusive.

    • publishedBefore (datetime) --

      The latest publication time of the results, inclusive. A date without a time, such as one passed to the AWS CLI, means midnight UTC. To include a whole day, use the last second of that day, for example 2026-01-31T23:59:59Z.

type userLocation:

dict

param userLocation:

userLocation may allow for Web Search results to be refined for that location. This is done by supplying a country. The field is optional.

The value is checked against assigned ISO 3166-1 alpha-2 codes, so unassigned and user-assigned codes such as UK and XK, empty or whitespace-only values are rejected. An omitted value is treated as absent. Without location, as a fallback Web Search may use your query to localize results or default to en_US.

  • country (string) --

    The two-letter ISO 3166-1 alpha-2 country code. The code is case-insensitive.

rtype:

dict

returns:

Response Syntax

{
    'results': [
        {
            'title': 'string',
            'url': 'string',
            'text': 'string',
            'publishedAt': datetime(2015, 1, 1)
        },
    ]
}

Response Structure

  • (dict) --

    Response for the InvokeWebSearch operation.

    • results (list) --

      The search results, in ranked order.

      • (dict) --

        A web search result.

        • title (string) --

          The title of the page.

        • url (string) --

          The URL of the page.

        • text (string) --

          A text extract from the page.

        • publishedAt (datetime) --

          The time the page was published. This field is absent when the publication time is not known.