curl --request GET \
--url https://www.closient.com/locations/api/v1/public/locations \
--header 'X-API-Key: <api-key>'import requests
url = "https://www.closient.com/locations/api/v1/public/locations"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://www.closient.com/locations/api/v1/public/locations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.closient.com/locations/api/v1/public/locations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.closient.com/locations/api/v1/public/locations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.closient.com/locations/api/v1/public/locations")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/locations/api/v1/public/locations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"locations": [
{
"address": "123 Main St, Springfield, IL 62701, United States of America",
"distance_km": 0.42,
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"lat": 39.7817,
"lon": -89.6501,
"name": "Downtown Store",
"phone": "+15550123",
"website": "https://example.com"
},
{
"address": "456 Oak Ave, Springfield, IL 62704, United States of America",
"distance_km": 3.18,
"id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"lat": 39.7901,
"lon": -89.684,
"name": "West Side Pickup",
"phone": "+15550456",
"website": "https://example.com/west"
}
],
"organization": {
"name": "Acme Retail Corp.",
"short_id": "keATfB8VP2gSjcnTbsMNQL"
}
}{
"type": "https://closient.com/docs/errors/not_found",
"title": "Not Found",
"status": 404,
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"timestamp": "2026-03-31T12:00:00+00:00"
}{
"type": "https://closient.com/docs/errors/not_found",
"title": "Not Found",
"status": 404,
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"timestamp": "2026-03-31T12:00:00+00:00"
}{
"type": "https://closient.com/docs/errors/not_found",
"title": "Not Found",
"status": 404,
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"timestamp": "2026-03-31T12:00:00+00:00"
}{
"type": "https://closient.com/docs/errors/not_found",
"title": "Not Found",
"status": 404,
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"timestamp": "2026-03-31T12:00:00+00:00"
}{
"type": "https://closient.com/docs/errors/not_found",
"title": "Not Found",
"status": 404,
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"timestamp": "2026-03-31T12:00:00+00:00"
}{
"type": "https://closient.com/docs/errors/not_found",
"title": "Not Found",
"status": 404,
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"timestamp": "2026-03-31T12:00:00+00:00"
}{
"type": "https://closient.com/docs/errors/not_found",
"title": "Not Found",
"status": 404,
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"timestamp": "2026-03-31T12:00:00+00:00"
}Find nearby locations
Returns the organization’s locations within radius km of (lat, lon), sorted by ascending great-circle distance. Authenticated via a publishable API key (cpk_*) in the X-API-Key header — the same key embedded in the public store-locator widget. Coordinates are WGS 84 / EPSG:4326 (the standard used by browsers’ navigator.geolocation and Google Maps); PostGIS computes distance on the geography type (ST_Distance over a spheroid), so values are correct globally and not just for short distances. Use radius to bound the spatial window and limit to cap the result count after distance sort.
curl --request GET \
--url https://www.closient.com/locations/api/v1/public/locations \
--header 'X-API-Key: <api-key>'import requests
url = "https://www.closient.com/locations/api/v1/public/locations"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://www.closient.com/locations/api/v1/public/locations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.closient.com/locations/api/v1/public/locations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.closient.com/locations/api/v1/public/locations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.closient.com/locations/api/v1/public/locations")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/locations/api/v1/public/locations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"locations": [
{
"address": "123 Main St, Springfield, IL 62701, United States of America",
"distance_km": 0.42,
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"lat": 39.7817,
"lon": -89.6501,
"name": "Downtown Store",
"phone": "+15550123",
"website": "https://example.com"
},
{
"address": "456 Oak Ave, Springfield, IL 62704, United States of America",
"distance_km": 3.18,
"id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"lat": 39.7901,
"lon": -89.684,
"name": "West Side Pickup",
"phone": "+15550456",
"website": "https://example.com/west"
}
],
"organization": {
"name": "Acme Retail Corp.",
"short_id": "keATfB8VP2gSjcnTbsMNQL"
}
}{
"type": "https://closient.com/docs/errors/not_found",
"title": "Not Found",
"status": 404,
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"timestamp": "2026-03-31T12:00:00+00:00"
}{
"type": "https://closient.com/docs/errors/not_found",
"title": "Not Found",
"status": 404,
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"timestamp": "2026-03-31T12:00:00+00:00"
}{
"type": "https://closient.com/docs/errors/not_found",
"title": "Not Found",
"status": 404,
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"timestamp": "2026-03-31T12:00:00+00:00"
}{
"type": "https://closient.com/docs/errors/not_found",
"title": "Not Found",
"status": 404,
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"timestamp": "2026-03-31T12:00:00+00:00"
}{
"type": "https://closient.com/docs/errors/not_found",
"title": "Not Found",
"status": 404,
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"timestamp": "2026-03-31T12:00:00+00:00"
}{
"type": "https://closient.com/docs/errors/not_found",
"title": "Not Found",
"status": 404,
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"timestamp": "2026-03-31T12:00:00+00:00"
}{
"type": "https://closient.com/docs/errors/not_found",
"title": "Not Found",
"status": 404,
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"timestamp": "2026-03-31T12:00:00+00:00"
}Authorizations
Query Parameters
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.
-90 <= x <= 90Longitude of the search centre in decimal degrees, WGS 84 / EPSG:4326.
-180 <= x <= 180Search 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.
Maximum number of locations to return (1-100). Results are pre-sorted by distance ascending, so this acts as a 'top N nearest' truncation.
1 <= x <= 100Response
OK
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.
Show child attributes
Show child attributes
The organization the publishable API key belongs to. Lets the widget render branding without a second request.
Show child attributes
Show child attributes
{ "name": "Acme Retail Corp." }