Geoloc API
Mis à jour
Ce contenu vous a-t-il été utile ?
Ce contenu vous a-t-il été utile ?
{
"continentCode": "EU",
"countryCode": "FR",
"region": "Île-de-France",
"longitude": 2.3333,
"latitude": 48.8667,
"city": "Paris",
"postalCode": "75001"
}function httpGet(url) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", url, false); // requête synchrone
xmlHttp.send(null);
return JSON.parse(xmlHttp.responseText);
}
tC.internalvars.geoloc = httpGet("https://api.commander1.com/geoloc/?site={YOUR SITE ID}&token={YOUR TOKEN}");tC.internalvars.geoloc.continentCode // "EU"
tC.internalvars.geoloc.countryCode // "FR"
tC.internalvars.geoloc.region // "Île-de-France"
tC.internalvars.geoloc.longitude // 2.3399
tC.internalvars.geoloc.latitude // 48.8718
tC.internalvars.geoloc.city // "Paris"
tC.internalvars.geoloc.postalCode // "75009"