Get caller's location from IP
GET
/api/location
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 ” Wink-Version
string
Responses
Section titled “ Responses ”Caller’s location resolved successfully
Media type application/json
object
cityName
City name
string
cityGeoNameId
City GeoNames identifier
integer format: int64
countryName
Country name
string
countryCode
Country ISO 3166-1 alpha-2 code
string
countryGeoNameId
Country GeoNames identifier
integer format: int64
continentName
Continent name
string
continentCode
Continent code
string
continentGeoNameId
Continent GeoNames identifier
integer format: int64
timezone
IANA time zone identifier
string
longitude
Longitude coordinate
number format: double
latitude
Latitude coordinate
number format: double
key
additional properties
Example
Bad Request
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }}object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
Unauthorized
Media type */*
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
Forbidden
Media type */*
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
Internal Server Error
object
Example generated
{}