API Examples

Common examples to help you get started. You can find the full documentation on RapidAPI Hub.

Get time by timezone
Get current timezone information for a specific timezone
Request
GET
https://gateway.timeapi.world/timezone/America/New_York
Response
{
  "abbreviation": "EDT",
  "datetime": "2025-08-03T08:31:40.837-04:00",
  "day_of_week": 0,
  "day_of_year": 215,
  "dst": true,
  "dst_from": "2025-03-09T07:00:00+00:00",
  "dst_offset": 3600,
  "dst_until": "2025-11-02T06:00:00+00:00",
  "raw_offset": -18000,
  "timezone": "America/New_York",
  "unixtime": 1754224300,
  "utc_datetime": "2025-08-03T12:31:40.837+00:00",
  "utc_offset": "-04:00",
  "week_number": 31,
  "client_ip": "127.0.0.1"
}
Code Examples
curl -X GET 'https://gateway.timeapi.world/timezone/America/New_York'
Get time by IP address
Get current timezone information for a specific IP address
Request
GET
https://gateway.timeapi.world/ip/8.8.8.8
Response
{
  "abbreviation": "CDT",
  "datetime": "2025-08-03T07:32:19.842-05:00",
  "day_of_week": 0,
  "day_of_year": 215,
  "dst": true,
  "dst_from": "2025-03-09T08:00:00+00:00",
  "dst_offset": 3600,
  "dst_until": "2025-11-02T07:00:00+00:00",
  "raw_offset": -21600,
  "timezone": "America/Chicago",
  "unixtime": 1754224339,
  "utc_datetime": "2025-08-03T12:32:19.842+00:00",
  "utc_offset": "-05:00",
  "week_number": 31,
  "client_ip": "127.0.0.1"
}
Code Examples
curl -X GET 'https://gateway.timeapi.world/ip/8.8.8.8'
Get your current time
Get your current timezone information based on your IP address
Request
GET
https://gateway.timeapi.world/ip
Response
{
  "abbreviation": "CDT",
  "datetime": "2025-08-03T07:32:19.842-05:00",
  "day_of_week": 0,
  "day_of_year": 215,
  "dst": true,
  "dst_from": "2025-03-09T08:00:00+00:00",
  "dst_offset": 3600,
  "dst_until": "2025-11-02T07:00:00+00:00",
  "raw_offset": -21600,
  "timezone": "America/Chicago",
  "unixtime": 1754224339,
  "utc_datetime": "2025-08-03T12:32:19.842+00:00",
  "utc_offset": "-05:00",
  "week_number": 31,
  "client_ip": "8.8.8.8"
}
Code Examples
curl -X GET 'https://gateway.timeapi.world/ip'
List All Timezones
Get a list of all available timezones
Request
GET
https://gateway.timeapi.world/timezone
Response
[
  "Africa/Abidjan",
  "Africa/Accra",
  "Africa/Addis_Ababa",
  "Africa/Algiers",
  "Africa/Asmara",
  "Africa/Asmera",
  "Africa/Bamako",
  "Africa/Bangui",
  "Africa/Banjul",
  "Africa/Bissau",
  "Africa/Blantyre",
  "Africa/Brazzaville",
  "Africa/Bujumbura",
  "Africa/Cairo",
  "Africa/Casablanca",
  ...
]
Code Examples
curl -X GET 'https://gateway.timeapi.world/timezone'
Documentation