> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upsonic.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# WebSearchUserLocation

> User location information for localizing web search results

## Overview

User location information for localizing web search results.

## Usage

```python theme={null}
from upsonic.tools.builtin_tools import WebSearchTool, WebSearchUserLocation
from upsonic.models.openai import OpenAIResponsesModel
from upsonic import Agent, Task


model = OpenAIResponsesModel(
    model_name="gpt-4o",
    provider="openai"
)

# Create location configuration
user_location = WebSearchUserLocation(
    city="New York",
    country="US",
    region="NY",
    timezone="America/New_York"
)

# Apply to web search
web_search = WebSearchTool(user_location=user_location)

task = Task(
    description="Search for local news and events",
    tools=[web_search]
)

agent = Agent(model=model, name="Local Search Agent")
result = agent.print_do(task)
print("Result:", result)
```

## Parameters

* `city` (str): The city where the user is located
* `country` (str): Country code (e.g., 'US', 'GB', 'DE')
  * For OpenAI: Must be 2-letter country code
* `region` (str): Region or state code (e.g., 'CA', 'NY', 'TX')
* `timezone` (str): Timezone identifier (e.g., 'America/New\_York')

## Provider Support

* Anthropic: ✅ Full support
* OpenAI Responses: ✅ Full support
