Skip to content
    Endpoint guide

    Embeddable clock

    GET /v1/time/clockOpenAPI YAML

    Returns a self-bootstrapping HTML fragment (host div + JSON config + CSS/JS includes) that renders a live clock.

    What do I need to send?

    Required / choose this first

    style is required. Choose one of the named analog or digital styles.

    Optional

    Choose one target selector and an optional timestamp to pin the clock.

    Rule: This endpoint returns text/html and does not support sign or bulk selectors.

    NameNeeded?Use it for
    styleRequiredOne of 30 named styles. See list below.
    tzChoose one targetTarget IANA timezone.
    ipChoose one targetTarget via IP address.
    latPair parameterTarget latitude. Pair with lon.
    lonPair parameterTarget longitude.
    offsetChoose one targetTarget fixed UTC offset (URL-encode + as %2B).
    unixChoose one inputPin the clock to a specific Unix-second instant.
    unix_msChoose one inputPin the clock to a specific Unix-millisecond instant.
    isoChoose one inputPin the clock to a specific ISO 8601 instant.
    source_tzConditional hintInterpret a local iso= against this IANA zone.
    formatOptionalstrftime pattern for digital styles, e.g. %H:%M:%S.

    Code samples

    Copy a request in your preferred language and replace YOUR_TIMELOGIC_API_KEY with your direct API key.

    curl "https://api.timelogicapi.com/v1/time/clock?tz=Europe/Paris&style=analog-station" \
      -H "Authorization: Bearer $TIMELOGIC_API_KEY"

    Example response

    <div id="clock-...-1" class="timelogic-clock-host" data-timelogic-clock data-clock-config-id="clock-...-1-config"></div>
    <script type="application/json" id="clock-...-1-config">
    {
      "version": "v1",
      "style": "analog-station",
      "styleDefinition": { "family": "analog", "renderer": "svg", "...": "..." },
      "unix_ms": 1778093028429,
      "offset_minutes": 120,
      "timezone": "Europe/Paris",
      "timezone_label": "Europe/Paris",
      "format": null,
      "refresh": { "path": "/v1/time/current", "selector": { "kind": "tz", "tz": "Europe/Paris" } }
    }
    </script>
    <link rel="stylesheet" href="/v1/time/clock/assets/v1/clock.css">
    <script src="/v1/time/clock/assets/v1/clock.js"></script>
    
    Additional endpoint notes

    style is required and must be one of these 30 names:

    Analoganalog-station, analog-aviation, analog-bauhaus, analog-graphite, analog-arctic, analog-brass, analog-marine, analog-grid, analog-slate, analog-executive.

    Digitaldigital-segment-red, digital-segment-amber, digital-segment-ice, digital-terminal-green, digital-terminal-white, digital-broadcast, digital-dashboard, digital-control-room, digital-slate, digital-onyx, digital-frost, digital-card, digital-glass, digital-matrix, digital-timetable, digital-split-flap, digital-cyan, digital-emerald, digital-monolith, digital-minimal.

    curl "https://api.timelogicapi.com/v1/time/clock?tz=Europe/Paris&style=analog-station" \
      -H "Authorization: Bearer $TIMELOGIC_API_KEY" 
    

    The response is text/html (uncached, Cache-Control: no-store). Drop the entire snippet into a page — the included JS upgrades the host <div> and refreshes against /v1/time/current.

    This route is single-target only — no comma-separated selectors. sign is not supported.

    Common errors

    • 400 INVALID_PARAMETER — missing or unknown style. The error body lists all valid_styles.

    When to use this endpoint

    Use Embeddable clock when you want TimeLogic to return a ready-to-render live clock fragment for websites, internal dashboards, landing pages, or customer portals without building the display logic yourself.

    Request model

    Select a required style, then choose the time target with a timezone, IP, coordinates, fixed offset, or timestamp. Optional presentation parameters control labeling and display behavior while the endpoint returns the HTML bootstrap fragment.

    Embedding guidance

    Treat the returned fragment as presentation output. For application logic, use JSON endpoints such as current time or convert time; for visual widgets, the clock endpoint keeps markup and behavior together.