Skip to main content

List Geo Locations

Enterprise Only
This API is available exclusively in Countly Enterprise.

Endpoint

/o?method=get_locations

Overview

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

Authentication

  • Authentication methods:
    • API Key (parameter): api_key=YOUR_API_KEY
    • Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
    • Auth Token (header): countly-token: YOUR_AUTH_TOKEN

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

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/Processing

  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.

Database Collections

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

Examples

Example: List Locations for an App

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

Ⓔ Enterprise

This feature is part of Countly Enterprise.

Get Access:

Already a Customer? Use support portal if you have any questions


Last Updated

2026-02-16