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

# Geotargeting

> Search, chat, and browse from anywhere.

## Local content

Every HTTP request can be routed through one of more than 190 countries, by subdivision and city:

```shell theme={null}
curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
'https://api.agentfirst.dev/search'\
'?terms=musical+instruments'\
'&country=US'
```

> [accordion] View subdivision example
>
> ```shell theme={null}
> curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
> 'https://api.agentfirst.dev/ai'\
> '?prompt=Where+can+I+buy+a+vintage+guitar%3F'\
> '&country=US'\
> '&subdivision=TN'
> ```

> [accordion] View city example
>
> ```shell theme={null}
> curl -H "Authorization: Bearer $AGENT_FIRST_TOKEN" \
> 'https://api.agentfirst.dev/browser'\
> '?url=https://guitars.com/'\
> '&country=US'\
> '&city=Nashville'
> ```

These are the geotargeting request parameters:

| Key | Required | Value |
| :- | :- | :- |
| `country` | ⬜ | The [two-letter ISO code](https://www.iso.org/obp/ui/#search/code) of the country to browse from (these codes are case insensitive); a random country is used by default |
| `subdivision` | ⬜ | The alphanumeric second part (proceeding the separator) of a [first-level subdivision code](https://www.iso.org/obp/ui/#search/code) in the (prerequisite) country to browse from (these codes are case insensitive); a random subdivision is used by default |
| `city` | ⬜ | The [commonly spelled name](https://www.geonames.org/) of the city in the (prerequisite) country to browse from (these names are temporarily case sensitive and required to include form- or URL-encoded spaces and punctuation marks); a random city is used by default |

> [!WARNING]
>
> City targeting takes precedence over subdivision targeting if both are specified.

These are the response parameters:

| Key | Value |
| :- | :- |
| `country` | The ISO code of the country that was browsed from |
| `subdivision` | The partial ISO code of the subdivision in the country that was browsed from |
| `city` | The common name of the city in the country that was browsed from |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.