Get Geolocation details
client.radar.geolocations.get(stringgeoId, GeolocationGetParams { format } query?, RequestOptionsoptions?): GeolocationGetResponse { geolocation }
GET/radar/geolocations/{geo_id}
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).
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Get Geolocation details
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
const geolocation = await client.radar.geolocations.get('3190509');
console.log(geolocation.geolocation);{
"result": {
"geolocation": {
"geoId": "2267056",
"latitude": "10",
"longitude": "10",
"name": "Lisbon",
"parent": {
"geoId": "2267056",
"latitude": "10",
"longitude": "10",
"name": "Lisbon",
"parent": {
"geoId": "2267056",
"latitude": "10",
"longitude": "10",
"name": "Lisbon",
"type": "CONTINENT",
"code": "PT-11",
"locale": "pt-PT"
},
"type": "CONTINENT",
"code": "PT-11",
"locale": "pt-PT"
},
"type": "CONTINENT",
"code": "PT-11",
"locale": "pt-PT"
}
},
"success": true
}Returns Examples
{
"result": {
"geolocation": {
"geoId": "2267056",
"latitude": "10",
"longitude": "10",
"name": "Lisbon",
"parent": {
"geoId": "2267056",
"latitude": "10",
"longitude": "10",
"name": "Lisbon",
"parent": {
"geoId": "2267056",
"latitude": "10",
"longitude": "10",
"name": "Lisbon",
"type": "CONTINENT",
"code": "PT-11",
"locale": "pt-PT"
},
"type": "CONTINENT",
"code": "PT-11",
"locale": "pt-PT"
},
"type": "CONTINENT",
"code": "PT-11",
"locale": "pt-PT"
}
},
"success": true
}