In short. Perplexity requires country alongside latitude and longitude in Agent API web search user_location.
Definition: No. In Perplexity's Agent API web search tool,
latitudeandlongitudemust be supplied together withcountryinsideuser_location. Coordinates alone are not a documented valid location input.
Key facts
- Perplexity's Web Search documentation describes
user_locationas an object that personalizes search by country, region, city, latitude, and longitude. - The same documentation says that
user_locationaccepts any combination of its listed fields, but requirescountrywhen coordinates are supplied. - The country value is a two-letter ISO 3166-1 alpha-2 code, with
USandFRas examples. - The API reference identifies
web_searchas a tool configuration for the Responses API and placesuser_locationbeside the search filters. - The reference describes
latitudeandlongitudeas numeric coordinates andcountryas an ISO 3166-1 alpha-2 country code.
What does the location input contain?
Perplexity documents user_location as the location context for the Agent API's web_search tool. Its fields are country, region, city, latitude, and longitude. The country field takes a two-letter ISO 3166-1 alpha-2 code. Region and city are text fields, while latitude and longitude are the coordinate fields for precise targeting. The API reference describes the same object as the user's geographic location for search personalization.
The documentation distinguishes the fields from the requirement that connects them: latitude and longitude must be provided together with country. It also says that the two coordinate fields cannot be supplied on their own. A request that supplies only coordinates therefore omits a required part of the documented location context.
How should a request be structured?
Put user_location in the web_search tool object. The documentation's example supplies the country, region, city, latitude, and longitude together:
"user_location": {
"country": "US",
"region": "California",
"city": "San Francisco",
"latitude": 37.7749,
"longitude": -122.4194
}
The same page places user_location alongside filters, while domain, recency, and date controls sit inside filters. The API reference lists type: "web_search" as the tool identifier and marks that type field as required. Location context is therefore part of the web search tool configuration, rather than a separate top-level request field.
What does this change for a website search?
Perplexity says location filters tailor search results to geographic context. It names local businesses and regional news as uses for this context, and describes coordinates as a way to target a precise location. The documentation also says that city and region significantly improve location accuracy and recommends including them alongside coordinates and country.
This setting describes the searcher's context. It does not describe a website requirement, a crawler instruction, or a ranking condition. A site owner can therefore treat a coordinate-based Agent API request as a location-context input whose documented country value is required for the request to match Perplexity's stated coordinate rules.
Related terms
FAQ
Can I send latitude and longitude without country?
No. Perplexity's Web Search documentation says that latitude and longitude must be provided together with country, and cannot be supplied on their own.
What format does country use?
Use a two-letter ISO 3166-1 alpha-2 country code. Perplexity gives US and FR as examples.
Are city and region required with coordinates?
The documentation lists city and region as available fields and recommends including them alongside coordinates and country. It states the country requirement for coordinates, but does not state the same requirement for city or region.
Sources
Check how a page reads to answer engines. Open the GEO score analyzer