Skip to main content
GET
/
locations
/
api
/
v1
/
public
/
locations
Find nearby locations
curl --request GET \
  --url https://www.closient.com/locations/api/v1/public/locations \
  --header 'X-API-Key: <api-key>'
{
  "locations": [
    {
      "id": "<string>",
      "name": "<string>",
      "address": "<string>",
      "lat": 0,
      "lon": 0,
      "distance_km": 1,
      "phone": "",
      "website": ""
    }
  ],
  "organization": {
    "id": "<string>",
    "name": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.closient.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-API-Key
string
header
required

Query Parameters

lat
number
required

Latitude of the search centre in decimal degrees, WGS 84 / EPSG:4326. Typically obtained from the browser's navigator.geolocation API or a geocoded user query.

Required range: -90 <= x <= 90
lon
number
required

Longitude of the search centre in decimal degrees, WGS 84 / EPSG:4326.

Required range: -180 <= x <= 180
radius
number
default:50

Search radius in kilometres. Locations farther than this from (lat, lon) are excluded. Defaults to 50 (a typical metro area); pass a larger value (e.g. 5000) to span a continent.

limit
integer
default:20

Maximum number of locations to return (1-100). Results are pre-sorted by distance ascending, so this acts as a 'top N nearest' truncation.

Required range: 1 <= x <= 100

Response

200 - application/json

OK

locations
LocationOut · object[]
required

Locations within radius of (lat, lon), sorted ascending by great-circle distance. Empty list when no locations match. PostGIS geography distance is converted to kilometres and rounded to two decimals.

organization
OrganizationOut · object
required

The organization the publishable API key belongs to. Lets the widget render branding without a second request.

Example:
{ "name": "Acme Retail Corp." }