Skip to content
Start here

List locations

radar.entities.locations.list(LocationListParams**kwargs) -> LocationListResponse
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
continent: Optional[Literal["AF", "AS", "EU", 3 more]]

Filters results by continent code.

One of the following:
"AF"
"AS"
"EU"
"NA"
"OC"
"SA"
format: Optional[Literal["JSON", "CSV"]]

Format in which results will be returned.

One of the following:
"JSON"
"CSV"
limit: Optional[int]

Limits the number of objects returned in the response.

exclusiveMinimum
minimum0
location: Optional[str]

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

offset: Optional[int]

Skips the specified number of objects before fetching the results.

minimum0
region: Optional[str]

Filters results by region.

maxLength100
subregion: Optional[str]

Filters results by subregion.

maxLength100
ReturnsExpand Collapse
class LocationListResponse:
locations: List[Location]
alpha2: str
continent: str
latitude: str

A numeric string.

longitude: str

A numeric string.

name: str
region: str
subregion: str

List locations

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
locations = client.radar.entities.locations.list()
print(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
}