Skip to content
Start here

List locations

client.radar.entities.locations.list(LocationListParams { continent, format, limit, 4 more } query?, RequestOptionsoptions?): LocationListResponse { locations }
GET/radar/entities/locations

Retrieves a list of locations.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
User Details WriteUser Details Read
ParametersExpand Collapse
query: LocationListParams { continent, format, limit, 4 more }
continent?: "AF" | "AS" | "EU" | 3 more

Filters results by continent code.

One of the following:
"AF"
"AS"
"EU"
"NA"
"OC"
"SA"
format?: "JSON" | "CSV"

Format in which results will be returned.

One of the following:
"JSON"
"CSV"
limit?: number

Limits the number of objects returned in the response.

exclusiveMinimum
minimum0
location?: string

Filters results by location. Specify a comma-separated list of alpha-2 location codes.

offset?: number

Skips the specified number of objects before fetching the results.

minimum0
region?: string

Filters results by region.

maxLength100
subregion?: string

Filters results by subregion.

maxLength100
ReturnsExpand Collapse
LocationListResponse { locations }
locations: Array<Location>
alpha2: string
continent: string
latitude: string

A numeric string.

longitude: string

A numeric string.

name: string
region: string
subregion: string

List locations

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const locations = await client.radar.entities.locations.list();

console.log(locations.locations);
{
  "result": {
    "locations": [
      {
        "alpha2": "AF",
        "continent": "AS",
        "latitude": "10",
        "longitude": "10",
        "name": "Afghanistan",
        "region": "Middle East",
        "subregion": "Southern Asia"
      }
    ]
  },
  "success": true
}
Returns Examples
{
  "result": {
    "locations": [
      {
        "alpha2": "AF",
        "continent": "AS",
        "latitude": "10",
        "longitude": "10",
        "name": "Afghanistan",
        "region": "Middle East",
        "subregion": "Southern Asia"
      }
    ]
  },
  "success": true
}