Find an API

Search public APIs with auth details & Postman guides

← All APIs

World Time API

worldtimeapi · Location

Location No Auth Free & Open location

A simple API to get the current time based on a request with a timezone.

Authentication

No authentication requiredFree to use with no key needed.

Sample Requests

GET request the current time based on the ip of the request. note: this is a "best guess" obtained from open-source data.

request the current time based on the ip of the request. note: this is a "best guess" obtained from open-source data.

https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/ip

Hover any highlighted part to learn what it does

curl -X GET "https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/ip"
import requests
response = requests.get(
    "https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/ip",
)
print(response.json())
const url = 'https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/ip';

const response = await fetch(url); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	targetURL := "https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/ip"
	req, _ := http.NewRequest("GET", targetURL, nil)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/ip")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Get.new(uri)

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/ip";
$opts = ["http" => [
    "method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET request the current time based on the ip of the request. note: this is a "best guess" obtained from open-source data.

request the current time based on the ip of the request. note: this is a "best guess" obtained from open-source data.

https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/ip.txt

Hover any highlighted part to learn what it does

curl -X GET "https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/ip.txt"
import requests
response = requests.get(
    "https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/ip.txt",
)
print(response.json())
const url = 'https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/ip.txt';

const response = await fetch(url); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	targetURL := "https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/ip.txt"
	req, _ := http.NewRequest("GET", targetURL, nil)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/ip.txt")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Get.new(uri)

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/ip.txt";
$opts = ["http" => [
    "method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET a listing of all timezones.

a listing of all timezones.

https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/timezone

Hover any highlighted part to learn what it does

curl -X GET "https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/timezone"
import requests
response = requests.get(
    "https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/timezone",
)
print(response.json())
const url = 'https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/timezone';

const response = await fetch(url); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	targetURL := "https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/timezone"
	req, _ := http.NewRequest("GET", targetURL, nil)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/timezone")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Get.new(uri)

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://api.apis.guru/v2/specs/worldtimeapi.org/20210108/timezone";
$opts = ["http" => [
    "method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));

Postman Setup Guide

Get Postman ↗
  1. See official documentation for authentication and setup.

What can you build with World Time API?

World Time API is a Location API. Developers commonly use location APIs for:

  • tracking assets and vehicles in real time
  • building delivery and logistics apps
  • finding nearby businesses or services
  • geo-fencing and location-based notifications
  • address validation and autocomplete

No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. World Time API is free to use, making it a low-risk choice to experiment with.

New to APIs? Read our beginner's guide

Open documentation ↗