geolocations
Creates, updates, deletes, gets or lists a geolocations resource.
Overview
| Name | geolocations |
| Type | Resource |
| Id | cloudflare.radar.geolocations |
Fields
The following fields are returned by SELECT queries:
- get
- list
Successful response.
| Name | Datatype | Description |
|---|---|---|
geolocation | object |
Successful response.
| Name | Datatype | Description |
|---|---|---|
name | string | |
code | string | |
geoId | string | |
latitude | string | A numeric string. |
locale | string | BCP 47 locale code used for the geolocation name translation |
longitude | string | A numeric string. |
parent | object | |
type | string | The type of the geolocation. (CONTINENT, COUNTRY, ADM1) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | geo_id | format | Retrieves the requested Geolocation information. Geolocation names can be localized by sending an Accept-Language HTTP header with a BCP 47 language tag (e.g., Accept-Language: pt-PT). The full quality-value chain is supported (e.g., pt-PT,pt;q=0.9,en;q=0.8). |
list | select | limit, offset, geoId, location, format | Retrieves a list of geolocations. Geolocation names can be localized by sending an Accept-Language HTTP header with a BCP 47 language tag (e.g., Accept-Language: pt-PT). The full quality-value chain is supported (e.g., pt-PT,pt;q=0.9,en;q=0.8). |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
geo_id | string | Geolocation ID. Refer to GeoNames |
format | string | Format in which results will be returned. |
geoId | string | Filters results by geolocation. Specify a comma-separated list of GeoNames IDs. |
limit | integer | Limits the number of objects returned in the response. |
location | string | Filters results by location. Specify a comma-separated list of alpha-2 location codes. |
offset | integer | Skips the specified number of objects before fetching the results. |
SELECT examples
- get
- list
Retrieves the requested Geolocation information. Geolocation names can be localized by sending an Accept-Language HTTP header with a BCP 47 language tag (e.g., Accept-Language: pt-PT). The full quality-value chain is supported (e.g., pt-PT,pt;q=0.9,en;q=0.8).
SELECT
geolocation
FROM cloudflare.radar.geolocations
WHERE geo_id = '{{ geo_id }}' -- required
AND format = '{{ format }}'
;
Retrieves a list of geolocations. Geolocation names can be localized by sending an Accept-Language HTTP header with a BCP 47 language tag (e.g., Accept-Language: pt-PT). The full quality-value chain is supported (e.g., pt-PT,pt;q=0.9,en;q=0.8).
SELECT
name,
code,
geoId,
latitude,
locale,
longitude,
parent,
type
FROM cloudflare.radar.geolocations
WHERE limit = '{{ limit }}'
AND offset = '{{ offset }}'
AND geoId = '{{ geoId }}'
AND location = '{{ location }}'
AND format = '{{ format }}'
;