Get caller's location from IP
const url = 'https://api.wink.travel/api/location';const options = { method: 'GET', headers: {'Wink-Version': '2.0', Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.wink.travel/api/location \ --header 'Authorization: Bearer <token>' \ --header 'Wink-Version: 2.0'Resolve the approximate geographic location and timezone of the API caller based on their IP address.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Responses
Section titled “ Responses ”Caller’s location resolved successfully
Geo-location details resolved from an IP address
object
City name
City GeoNames identifier
Country name
Country ISO 3166-1 alpha-2 code
Country GeoNames identifier
Continent name
Continent code
Continent GeoNames identifier
IANA time zone identifier
Longitude coordinate
Latitude coordinate
Example
{ "cityName": "Bangkok", "cityGeoNameId": 1609350, "countryName": "Thailand", "countryCode": "TH", "countryGeoNameId": 1605651, "continentName": "Asia", "continentCode": "AS", "continentGeoNameId": 6255147, "timezone": "Asia/Bangkok", "longitude": 100.5581533, "latitude": 13.7370197}Bad Request — missing or invalid request parameter or body
object
object
Example
Unauthorized — authentication is required or the session has expired
object
object
Example
Forbidden — authenticated but lacking the required permission or scope
object
object
Example
Not Found — the requested resource does not exist
object
object
Example
Method Not Allowed — the HTTP verb is not supported on this endpoint
object
object
Example
Unsupported Media Type — use application/json
object
object
Example
Internal Server Error — an unexpected failure occurred on the server
object
object
Example
Service Unavailable — a downstream dependency is unreachable