Skip to content

    RapidAPI documentation

    Preserved marketplace examples, headers, signing notes, and endpoint guides for existing RapidAPI customers.

    Legacy RapidAPI documentation

    These are the original marketplace-oriented guides, retained for existing RapidAPI integrations. They cover the RapidAPI key and host headers, endpoint selectors, bulk requests, signed responses, calendar calculations, clocks, and error handling.

    Endpoint guides

    Read request details and examples for a specific endpoint, or browse them all.

    View all endpoints

    Getting started

    1. Open the RapidAPI compatibility guide and subscribe to the TimeLogic API listing.
    2. Copy your RapidAPI key and keep it server-side as RAPIDAPI_KEY.
    3. Make your first request:
    curl "https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/v1/time/current?tz=Europe/Paris" -H "X-RapidAPI-Key: $RAPIDAPI_KEY" -H "X-RapidAPI-Host: timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com"
    

    RapidAPI supplies the marketplace subscription, authentication headers, and usage dashboard for this transport.

    Authentication

    RapidAPI requests use the marketplace key and host headers. Keep both values server-side; never embed them in browser code or commit them to source control.

    X-RapidAPI-Key: YOUR_RAPIDAPI_KEY
    X-RapidAPI-Host: timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com
    

    Use the RapidAPI compatibility guide for marketplace billing and subscription details.

    Selectors

    Most endpoints accept exactly one selector family per request to identify the location or moment you care about:

    • tz — IANA timezone name, e.g. Europe/Paris
    • ip — IPv4 or IPv6 address (resolved via MaxMind GeoLite2)
    • lat + lon — coordinates in decimal degrees
    • offset — fixed UTC offset, URL-encode + as %2B (e.g. offset=%2B02:00)

    Mixing families in the same request returns 400 AMBIGUOUS_TARGET. An invalid IANA name returns 400 INVALID_PARAMETER.

    On /v1/time/convert, /v1/time/calendar, /v1/time/clock and /v1/time/add, the input timestamp uses a separate set of forms: unix=…, unix_ms=…, or iso=… (optionally paired with a source_tz / source_ip / source_lat+source_lon / source_offset hint when iso is local). The target is then chosen with the standard selector family above.

    Bulk mode

    /v1/time/current and /v1/time/convert support bulk mode by passing a comma-separated list to one selector (tz, ip, or offset). The response is an array in input order.

    curl "https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/v1/time/current?tz=Europe/Paris,Asia/Tokyo,America/New_York" \
      -H "X-RapidAPI-Key: YOUR_KEY" \
      -H "X-RapidAPI-Host: timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com"
    
    # convert one instant into three target offsets
    curl "https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/v1/time/convert?unix=1711300000&offset=-04:00,%2B00:00,%2B09:00" \
      -H "X-RapidAPI-Key: YOUR_KEY" \
      -H "X-RapidAPI-Host: timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com"
    

    /v1/time/clock is single-target only and rejects comma-separated selectors.

    Signed responses

    Set sign=true exactly on a supported JSON route to receive a cryptographically signed response. Supported routes are current, convert, diff, add, calendar, DST, elapsed, and timezone. /v1/time/clock does not support signing.

    sign=false, a bare ?sign, or repeated sign values do not request a signature.

    The JSON body is unchanged. The gateway adds these response headers:

    HeaderMeaning
    X-TimeLogic-Key-IdJWKS kid for the public key that verifies this response.
    X-TimeLogic-Signature-AlgSignature algorithm: Ed25519.
    X-TimeLogic-Signature-TimestampUnix seconds used in the envelope.
    X-TimeLogic-Content-SHA256Standard-base64 SHA-256 of the exact response body bytes.
    X-TimeLogic-Signature-InputBase64URL encoding of the exact UTF-8 v1 envelope that was signed.
    X-TimeLogic-SignatureStandard-base64 Ed25519 signature over the decoded Signature-Input bytes.

    What is signed

    Decode X-TimeLogic-Signature-Input as Base64URL UTF-8. For v1 it contains exactly these newline-separated fields:

    v1
    kid:<key id>
    status:<HTTP status>
    method:<HTTP method>
    path:<origin-form path and query>
    timestamp:<Unix seconds>
    content-sha256:<standard-base64 SHA-256>
    

    The path includes the query string, including sign=true. For example, it can be /v1/time/current?tz=Europe%2FLondon&sign=true.

    Host and proxy behavior

    The envelope does not include the scheme, host, or Content-Type. It signs only the origin-form path and query, status, method, timestamp, and body hash.

    This is intentional: a request can pass through the RapidAPI hostname and the gateway hostname without making verification depend on either host. Proxies may also normalize Content-Type. Do not rebuild a signing input from the URL host or a response content type; decode and verify the X-TimeLogic-Signature-Input header exactly as received.

    Verify a response

    1. Keep the response body exactly as received and compute its SHA-256.
    2. Decode X-TimeLogic-Signature-Input, confirm its content-sha256 matches the body hash, and use its kid to select the matching public JWK.
    3. Verify X-TimeLogic-Signature over the decoded envelope bytes. Do not reconstruct the envelope yourself.
    4. Optionally compare the mirrored kid, timestamp, and content-hash headers to the values inside the envelope.

    Fetch the public keys from:

    GET https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/.well-known/time-api-public-key
    

    Cache keys by kid; retained historical keys may remain available after rotation. The browser verifier performs these checks locally - paste a complete curl -i response and no response data is uploaded.

    Diff & business days

    Use /v1/time/diff for duration math between two specifier-encoded instants and /v1/time/elapsed for "since now" calculations.

    from and to on /v1/time/diff are embedded specifiers — the value itself is a key=value pair: from=unix=1711300000, from=iso=2026-04-16T09:00:00, from=now, etc.

    curl "https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/v1/time/diff?from=iso=2026-01-02T00:00:00Z&to=iso=2026-04-30T00:00:00Z&business_days=true&holiday_country=FR" \
      -H "X-RapidAPI-Key: YOUR_KEY" \
      -H "X-RapidAPI-Host: timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com"
    

    Add business_days=true to include a business_days count in the response. Pair it with holiday_country (ISO 3166-1 alpha-2) to subtract public holidays, and optionally holiday_subdivision (e.g. ENG, CA) for regional calendars. Not every country code is supported by the upstream calendar — unsupported codes return 400 INVALID_PARAMETER ("Unsupported holiday calendar").

    Embeddable clocks

    /v1/time/clock returns a self-bootstrapping HTML fragment: a host <div>, a JSON config <script>, and <link>/<script> tags pointing at the hosted CSS and JS bundle. Drop the entire snippet anywhere on your page.

    curl "https://timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com/v1/time/clock?tz=Europe/Paris&style=analog-station" \
      -H "X-RapidAPI-Key: YOUR_KEY" \
      -H "X-RapidAPI-Host: timelogic-api-world-time-timezones-time-calculations.p.rapidapi.com"
    

    style is required and must be one of 30 named styles (10 analog + 20 digital). See the endpoint reference for the full list. Responses are uncached so each fetch reflects the current request.

    Errors & rate limits

    Errors are JSON with a stable shape:

    {
      "error": {
        "code": "INVALID_PARAMETER",
        "message": "Invalid timezone.",
        "details": { "tz": "Not/AZone" }
      },
      "request_id": "3534e3fe-f916-4d44-a50b-8f92a74074c4"
    }
    

    Common codes:

    • INVALID_PARAMETER — bad value (timezone, offset format, strftime directive, unsupported holiday calendar, missing clock style).
    • INVALID_TIMESTAMP — required input timestamp missing on /v1/time/elapsed (and similar reference-time inputs).
    • MISSING_TARGET — no target selector supplied where one is required (e.g. /v1/time/convert with no tz/ip/lat+lon/offset/utc).
    • AMBIGUOUS_TARGET — more than one selector family or input form supplied, or a comma-separated bulk selector combined with another target selector (including utc=true).
    • 429 — plan quota exceeded; retry after the Retry-After header.
    • 5xx — upstream issue; retry with backoff.

    Every response includes an X-Request-Id header — quote it in support tickets.

    Rate limits depend on your plan — see Pricing.

    Best practices

    • Cache responses where the resolution allows (per-second responses cache for at least one second).
    • Use bulk mode to fold many city lookups into a single request.
    • Verify signed responses on the server, not the client.
    • Implement exponential backoff on 429 and 5xx.
    • Pin your client to API version v1 in the URL.