Timezone API

GET

https://api.apifreaks.com/v1.0/geolocation/timezone

format
Format of the Response
ipString
IPv4/IPv6 address to extract timezone info using IP address
tzString
Extract timezone information using timezone name
locationString
Extract timezone information using location (preferably city and country)
latNumber
Latitude to extract timezone informatin using location coordinates
longNumber
Longitude to extract timezone informatin using location coordinates
langString
Response language of "geo" field in case of lookup through IP address / location address
iata_codeString
Extract timezone info using 3-letter IATA airport code
icao_codeString
Extract timezone info using 4-letter ICAO airport code
lo_codeString
Extract timezone info using 5-letter UN/LO CODE city code

Sample Responses

400
400
400
404
400
400
400
LANGUAGE
Python
PHP
Java
Node
Ruby
$ pip install requests
RESPONSE

Click Test it to start the request and see the response here!


API Response

Below are the response fields when performing a lookup using geographical coordinates or a time-zone name:

FieldTypeRequirementDescription
timezoneStringMandatory
The name of the timezone, e.g., "America/New_York"
timezone_offsetNumberMandatory
The time difference in hours from UTC for the specified timezone without considering DST
timezone_offset_with_dstNumberMandatory
The time difference in hours from UTC for the specified timezone, including DST
dateStringMandatory
The current date in the specified timezone in YYYY-MM-DD format
date_timeStringMandatory
The current date and time in the specified timezone in ISO 8601 format
date_time_txtStringMandatory
The current date and time in a human-readable format, e.g., "Wednesday, July 26, 2024, 15:00:00"
date_time_wtiStringMandatory
The current date and time in the specified timezone in "Weekday, Time" format
date_time_ymdStringMandatory
The current date and time in "YYYY-MM-DD HH:MM:SS" format
date_time_unixFloatMandatory
The current date and time as a Unix timestamp (seconds since Jan 1, 1970)
time_24StringMandatory
The current time in 24-hour format, e.g., "15:00:00"
time_12StringMandatory
The current time in 12-hour format with AM/PM, e.g., "03:00:00 PM"
weekNumberMandatory
The current week number of the year in the specified timezone
monthNumberMandatory
The current month number in the specified timezone
yearNumberMandatory
The current year in the specified timezone
year_abbrStringMandatory
The abbreviated current year in the specified timezone, e.g., "24" for 2024
is_dstBooleanMandatory
Indicates whether Daylight Saving Time (DST) is currently in effect in the specified timezone
dst_savingsNumberMandatory
The amount of time (in hours) by which clocks are adjusted for DST
dst_existsBooleanMandatory
Indicates whether DST is observed in the specified timezone
dst_startStringMandatory
The start date of the DST period in the specified timezone
dst_endStringMandatory
The end date of the DST period in the specified timezone
dst_start.utc_timeStringOptional
The UTC time of the DST start date
dst_start.durationStringOptional
The duration of the DST start transition
dst_start.gapBooleanOptional
Indicates whether there is a time gap at the start of DST
dst_start.datetimeAfterStringOptional
The date and time after the start of DST
dst_start.datetimeBeforeStringOptional
The date and time before the start of DST
dst_start.overlapBooleanOptional
Indicates whether there is an overlap period at the start of DST
dst_end.utc_timeStringOptional
The UTC time of the DST end date
dst_end.durationStringOptional
The duration of the DST end transition
dst_end.gapBooleanOptional
Indicates whether there is a time gap at the end of DST
dst_end.datetimeAfterStringOptional
The date and time after the end of DST
dst_end.datetimeBeforeStringOptional
The date and time before the end of DST
dst_end.overlapBooleanOptional
Indicates whether there is an overlap period at the end of DST

The following fields will be appended to the above response based on the lookup performed using a location address:

FieldTypeRequirementDescription
geo.locationStringMandatory
The complete geographical location, including country, state, city, and locality
geo.countryStringMandatory
The country of the geographical location
geo.stateStringMandatory
The state of the geographical location
geo.cityStringMandatory
The city of the geographical location
geo.localityStringMandatory
The locality or neighborhood of the geographical location
geo.latitudeFloatMandatory
The latitude coordinate of the geographical location
geo.longitudeFloatMandatory
The longitude coordinate of the geographical location

The following fields will be appended to the above response based on the lookup performed using an IP address:

FieldTypeRequirementDescription
geo.country_code2StringMandatory
The 2-letter country code (ISO 3166-1 alpha-2)
geo.country_code3StringMandatory
The 3-letter country code (ISO 3166-1 alpha-3)
geo.country_nameStringMandatory
The common name of the country
geo.continent_codeStringMandatory
The two-letter code of the continent
geo.continent_nameStringMandatory
The full name of the continent
geo.country_name_officialStringMandatory
The official name of the country
geo.state_provStringMandatory
The state or province of the geographical location
geo.is_euBooleanMandatory
Is the country belong to European Union?
geo.state_codeStringMandatory
The code for the state or province
geo.districtStringMandatory
The district of the geographical location
geo.cityStringMandatory
The city of the geographical location
geo.zip_codeStringMandatory
The postal code of the geographical location
geo.latitudeStringMandatory
The latitude coordinate of the geographical location
geo.longitudeStringMandatory
The longitude coordinate of the geographical location

The following fields will be appended to the above response based on the lookup performed using an IATA code:

FieldTypeRequirementDescription
airportDetails.typeStringMandatory
The type of airport (small, medium, large)
airportDetails.nameStringMandatory
The full name of the airport
airportDetails.longitudeStringMandatory
The longitude coordinate of the airport location
airportDetails.latitudeStringMandatory
The latitude coordinate of the airport location
airportDetails.elevation_ftNumberMandatory
The elevation of the airport in feet
airportDetails.continent_codeStringMandatory
The 2-letter continent code where the airport is located
airportDetails.country_codeStringMandatory
The 2-letter country code where the airport is located
airportDetails.state_codeStringMandatory
The state or province code where the airport is located
airportDetails.municipalityStringMandatory
The city or municipality where the airport is located
airportDetails.cityStringMandatory
The city or administrative region that the airport serves to.
airportDetails.iata_codeStringMandatory
The IATA (International Air Transport Association) code for the airport
airportDetails.icao_codeStringMandatory
The ICAO (International Civil Aviation Organization) code for the airport
airportDetails.faa_codeStringMandatory
The FAA (Federal Aviation Administration) code for the airport

The following fields will be appended to the above response based on the lookup performed using an ICAO code:

FieldTypeRequirementDescription
airportDetails.typeStringMandatory
The type of airport (small, medium, large)
airportDetails.nameStringMandatory
The full name of the airport
airportDetails.longitudeStringMandatory
The longitude coordinate of the airport location
airportDetails.latitudeStringMandatory
The latitude coordinate of the airport location
airportDetails.elevation_ftNumberMandatory
The elevation of the airport in feet
airportDetails.continent_codeStringMandatory
The 2-letter continent code where the airport is located
airportDetails.country_codeStringMandatory
The 2-letter country code where the airport is located
airportDetails.state_codeStringMandatory
The state or province code where the airport is located
airportDetails.municipalityStringMandatory
The city or municipality where the airport is located
airportDetails.iata_codeStringMandatory
The IATA (International Air Transport Association) code for the airport
airportDetails.icao_codeStringMandatory
The ICAO (International Civil Aviation Organization) code for the airport
airportDetails.faa_codeStringMandatory
The FAA (Federal Aviation Administration) code for the airport

The following fields will be appended to the above response based on the lookup performed using a UN/LO CODE code:

FieldTypeRequirementDescription
loCodeDetails.lo_codeStringMandatory
The UN/LO CODE code for the location
loCodeDetails.city_nameStringMandatory
The name of the city or location
loCodeDetails.longitudeStringMandatory
The longitude coordinate of the location
loCodeDetails.latitudeStringMandatory
The latitude coordinate of the location
loCodeDetails.state_codeStringMandatory
The state or province code of the location
loCodeDetails.country_codeStringMandatory
The 2-letter country code of the location
loCodeDetails.administrative_countryStringMandatory
The administrative country name of the location
loCodeDetails.location_typeStringMandatory
The type of the location (e.g., port, airport, rail terminal)