Quickstart

Quickstart

Send a single authenticated GET request, inspect the response shape, and use the same request template across all supported code snippets.

Step 1

Subscribe on RapidAPI and capture the two required headers.

The public API is distributed through RapidAPI, so every request needs `X-RapidAPI-Key` and `X-RapidAPI-Host`. The docs keep those headers visible in every code example instead of hiding them behind SDK wrappers.

  • Use the exact marketplace host shown in the docs and snippets.
  • Treat the API key as a secret and inject it through your own environment management.
Step 2

Start with `/v1/time/current` to confirm target resolution.

The fastest validation request is usually current time by `tz`, `ip`, coordinates, or fixed offset. It proves auth, shows the canonical time payload, and establishes which selector family your integration should standardize on.

  • Use only one selector family per request.
  • Bulk mode is limited to routes that explicitly support it.
Step 3

Move to convert, diff, add, calendar, and elapsed once the target is stable.

Those routes build on the same target model, but they introduce timestamp input rules, optional timezone context for wall-clock ISO values, and duration formatting behavior that should be documented in your own integration layer.

  • If an ISO timestamp has no explicit offset, pass the matching source timezone field.
  • Human-readable fields are display-oriented and should not be parsed structurally.
Step 4

Use signed JSON only where downstream verification matters.

Supported JSON routes can ask the gateway to sign the final response. That makes sense for audit-heavy or cached workflows where you want detached verification, but it is not supported for the HTML clock route.

  • Fetch the public key set from `/.well-known/time-api-public-key`.
  • Clock HTML is an embed response, not a JSON envelope.
Code Examples
curl --request GET \
  --url "https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/v1/time/current?tz=America%2FNew_York&format=%25Y-%25m-%25d+%25H%3A%25M&sign=true" \
  --header "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
  --header "X-RapidAPI-Host: timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com"
const url = new URL("https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/v1/time/current");
const query = [
  ["tz", "America/New_York"],
  ["format", "%Y-%m-%d %H:%M"],
  ["sign", "true"]
];

for (const [key, value] of query) {
  url.searchParams.set(key, value);
}

const response = await fetch(url, {
  method: "GET",
  headers: {
    "X-RapidAPI-Key": process.env.TIMELOGIC_API_KEY,
    "X-RapidAPI-Host": "timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com",
  },
});

const body = await response.text();
console.log(body);
const url = new URL("https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/v1/time/current");
const query: Array<[string, string]> = [
  ["tz", "America/New_York"],
  ["format", "%Y-%m-%d %H:%M"],
  ["sign", "true"]
];

for (const [key, value] of query) {
  url.searchParams.set(key, value);
}

const response = await fetch(url, {
  method: "GET",
  headers: {
    "X-RapidAPI-Key": process.env.TIMELOGIC_API_KEY ?? "",
    "X-RapidAPI-Host": "timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com",
  },
});

const body = await response.text();
console.log(body);
import os
import requests

url = "https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/v1/time/current"
params = {
    "tz": "America/New_York",
    "format": "%Y-%m-%d %H:%M",
    "sign": "true"
}
headers = {
    "X-RapidAPI-Key": os.environ["TIMELOGIC_API_KEY"],
    "X-RapidAPI-Host": "timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com",
}

response = requests.get(url, params=params, headers=headers, timeout=30)
print(response.text)
package main

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

func main() {
	req, _ := http.NewRequest("GET", "https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/v1/time/current", nil)
	query := req.URL.Query()
	query.Set("tz", "America/New_York")
	query.Set("format", "%Y-%m-%d %H:%M")
	query.Set("sign", "true")
	req.URL.RawQuery = query.Encode()
	req.Header.Set("X-RapidAPI-Key", os.Getenv("TIMELOGIC_API_KEY"))
	req.Header.Set("X-RapidAPI-Host", "timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class TimeLogicExample {
  public static void main(String[] args) throws IOException, InterruptedException {
    HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/v1/time/current?tz=America%2FNew_York&format=%25Y-%25m-%25d+%25H%3A%25M&sign=true"))
      .header("X-RapidAPI-Key", System.getenv("TIMELOGIC_API_KEY"))
      .header("X-RapidAPI-Host", "timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com")
      .GET()
      .build();

    HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
    System.out.println(response.body());
  }
}
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program {
  static async Task Main() {
    using var client = new HttpClient();
    using var request = new HttpRequestMessage(HttpMethod.Get, "https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/v1/time/current?tz=America%2FNew_York&format=%25Y-%25m-%25d+%25H%3A%25M&sign=true");
    request.Headers.Add("X-RapidAPI-Key", Environment.GetEnvironmentVariable("TIMELOGIC_API_KEY"));
    request.Headers.Add("X-RapidAPI-Host", "timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com");

    using var response = await client.SendAsync(request);
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
  }
}
<?php
$url = "https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/v1/time/current?tz=America%2FNew_York&format=%25Y-%25m-%25d+%25H%3A%25M&sign=true";

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "X-RapidAPI-Key: " . getenv("TIMELOGIC_API_KEY"),
        "X-RapidAPI-Host: timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com",
    ],
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;
require "net/http"
require "uri"

uri = URI("https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/v1/time/current")
params = {
  "tz" => "America/New_York",
  "format" => "%Y-%m-%d %H:%M",
  "sign" => "true"
}
uri.query = URI.encode_www_form(params)

request = Net::HTTP::Get.new(uri)
request["X-RapidAPI-Key"] = ENV.fetch("TIMELOGIC_API_KEY")
request["X-RapidAPI-Host"] = "timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com"

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts response.body
import okhttp3.OkHttpClient
import okhttp3.Request

fun main() {
    val client = OkHttpClient()
    val request = Request.Builder()
        .url("https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/v1/time/current?tz=America%2FNew_York&format=%25Y-%25m-%25d+%25H%3A%25M&sign=true")
        .get()
        .addHeader("X-RapidAPI-Key", System.getenv("TIMELOGIC_API_KEY"))
        .addHeader("X-RapidAPI-Host", "timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com")
        .build()

    client.newCall(request).execute().use { response ->
        println(response.body?.string())
    }
}