Skip to main content

List Geo Locations

Enterprise

This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.

Endpoint

/o?method=get_locations

Overview

Returns geo locations for an app, ordered by title, followed by global locations.

Authentication

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions

  • Required permission: Read on the geo feature

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key authentication
auth_tokenStringYes (or api_key)Auth token authentication
app_idStringYesApplication ID used for scope and ordering

Examples

Example: List Locations for an App

https://your-server.com/o?method=get_locations&api_key=YOUR_API_KEY&app_id=609bd78d90d7a416d4dfb984

Response

Success Response

[
{
"_id": "62616692a9ddc55457bad406",
"title": "Location test",
"radius": 172,
"unit": "ml",
"geo": {
"type": "Point",
"coordinates": [21.16, 42.6534]
},
"app": "609bd78d90d7a416d4dfb984",
"address": "Berlin, Germany"
}
]

Response Fields

FieldTypeDescription
_idStringGeolocation ID
titleStringLocation title
radiusNumberRadius value
unitStringUnit label
geoObjectLocation point (type, coordinates)
appStringApp ID (present for app-specific locations)
addressStringReverse-geocoded address (if available)

Error Responses

HTTP StatusResponse
400{"result":"Missing parameter \"app_id\""}
400Generic read error returned by validation/database path
200{"result":"No location found"} (fallback path when no locations object is available)

Behavior

  1. Loads non-deleted locations for the requested app and global scope.
  2. Adds app-specific locations first and sorts them by title.
  3. Appends global locations afterward.
  4. Returns a root JSON array of location objects.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.geosEndpoint data source** - Source of app-specific and global geolocations