{
  "openapi": "3.1.0",
  "info": {
    "title": "lltcore Market Clock",
    "version": "1.0.0",
    "description": "Exact time and trading context for agents: sessions, market hours and holidays, candle boundaries, perpetual funding times, crypto derivatives expiries, FOMC dates. Free, no key, read-only. Also available as an MCP server at /mcp. Times only, no prices. Not financial advice.",
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    }
  },
  "servers": [
    {
      "url": "https://api.lltcore.com"
    }
  ],
  "externalDocs": {
    "description": "llms.txt",
    "url": "https://api.lltcore.com/llms.txt"
  },
  "paths": {
    "/v1/clock": {
      "get": {
        "operationId": "market_clock",
        "summary": "Market clock (everything at once)",
        "description": "Current UTC time plus the trading context an agent usually lacks: active trading sessions, open/closed status of US equities, London, Xetra, CME crypto, forex and crypto, time left in the 15m/1h/4h/1d/1w candle, next funding on Binance, Bybit, OKX and Hyperliquid, next Deribit/Binance/CME expiry and the next FOMC decision. Call this first when a task depends on 'now' in markets.",
        "parameters": [
          {
            "name": "at",
            "in": "query",
            "required": false,
            "description": "Optional moment to compute for: ISO 8601 (2026-11-17T18:00:00Z) or unix seconds/ms. Default: now. Works for past and future, e.g. for backtests.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad parameter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/time": {
      "get": {
        "operationId": "get_time",
        "summary": "Current time",
        "description": "Exact current time in UTC (ISO 8601, unix seconds and ms, weekday, ISO week, day of year), optionally also in an IANA time zone.",
        "parameters": [
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "description": "IANA time zone, e.g. Europe/Berlin",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "at",
            "in": "query",
            "required": false,
            "description": "Optional moment to compute for: ISO 8601 (2026-11-17T18:00:00Z) or unix seconds/ms. Default: now. Works for past and future, e.g. for backtests.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad parameter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/convert": {
      "get": {
        "operationId": "convert_time",
        "summary": "Convert a wall-clock time between time zones",
        "description": "Convert a local wall-clock time (no offset) from one IANA time zone to another, daylight saving included.",
        "parameters": [
          {
            "name": "time",
            "in": "query",
            "required": true,
            "description": "Local wall time, e.g. 2026-11-17T09:30",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from_timezone",
            "in": "query",
            "required": true,
            "description": "IANA zone of the given time, e.g. America/New_York",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to_timezone",
            "in": "query",
            "required": true,
            "description": "IANA zone to convert to, e.g. Asia/Tokyo",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad parameter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/candle": {
      "get": {
        "operationId": "candle_bounds",
        "summary": "Candle open/close times",
        "description": "Open and close time of the candle that contains a moment, seconds elapsed and left, previous and next candle, using Binance kline conventions (UTC; weeks start Monday; 3d anchored like Binance; calendar months).",
        "parameters": [
          {
            "name": "timeframe",
            "in": "query",
            "required": true,
            "description": "Candle size",
            "schema": {
              "type": "string",
              "enum": [
                "1m",
                "3m",
                "5m",
                "15m",
                "30m",
                "1h",
                "2h",
                "4h",
                "6h",
                "8h",
                "12h",
                "1d",
                "3d",
                "1w",
                "1M"
              ]
            }
          },
          {
            "name": "at",
            "in": "query",
            "required": false,
            "description": "Optional moment to compute for: ISO 8601 (2026-11-17T18:00:00Z) or unix seconds/ms. Default: now. Works for past and future, e.g. for backtests.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad parameter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/sessions": {
      "get": {
        "operationId": "trading_sessions",
        "summary": "Trading sessions",
        "description": "Which of the Sydney, Tokyo, London and New York sessions are active (local business hours with daylight saving), overlaps, when each next starts, and the fixed-UTC session label the AGAINST THE MACHINE bot sent to DeepSeek-R1.",
        "parameters": [
          {
            "name": "at",
            "in": "query",
            "required": false,
            "description": "Optional moment to compute for: ISO 8601 (2026-11-17T18:00:00Z) or unix seconds/ms. Default: now. Works for past and future, e.g. for backtests.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad parameter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/funding": {
      "get": {
        "operationId": "funding_times",
        "summary": "Perpetual funding times",
        "description": "Previous and next funding settlement and countdown for perpetual futures on Binance, Bybit, OKX (8-hourly by default) and Hyperliquid (hourly). Times only, no rates.",
        "parameters": [
          {
            "name": "exchange",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "binance",
                "bybit",
                "okx",
                "hyperliquid"
              ]
            }
          },
          {
            "name": "at",
            "in": "query",
            "required": false,
            "description": "Optional moment to compute for: ISO 8601 (2026-11-17T18:00:00Z) or unix seconds/ms. Default: now. Works for past and future, e.g. for backtests.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad parameter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/markets": {
      "get": {
        "operationId": "market_status",
        "summary": "Is a market open?",
        "description": "Open/closed state, reason (weekend, holiday name, early close), and the next open or close for US equities (NYSE/Nasdaq), London Stock Exchange, Xetra, CME crypto futures (24/7 since 2026-05-29), spot forex and crypto. Omit market to get all.",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "us_equities",
                "london",
                "xetra",
                "cme_crypto",
                "forex",
                "crypto"
              ]
            }
          },
          {
            "name": "at",
            "in": "query",
            "required": false,
            "description": "Optional moment to compute for: ISO 8601 (2026-11-17T18:00:00Z) or unix seconds/ms. Default: now. Works for past and future, e.g. for backtests.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad parameter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/calendar": {
      "get": {
        "operationId": "market_calendar",
        "summary": "Holidays and early closes",
        "description": "Holidays and early-close days of a market for a year (US equities 2026-2028 from NYSE, London 2026-2027 from gov.uk, Xetra by its standing rule).",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "us_equities",
                "london",
                "xetra"
              ]
            }
          },
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 2000,
              "maximum": 2100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad parameter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/expiries": {
      "get": {
        "operationId": "derivatives_expiries",
        "summary": "Crypto derivatives expiries",
        "description": "Next Deribit BTC expiries (daily, weekly, monthly, quarterly at 08:00 UTC), Binance quarterly delivery and CME Bitcoin futures last trading time, with countdowns.",
        "parameters": [
          {
            "name": "count",
            "in": "query",
            "required": false,
            "description": "How many of each (default 3)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 6
            }
          },
          {
            "name": "at",
            "in": "query",
            "required": false,
            "description": "Optional moment to compute for: ISO 8601 (2026-11-17T18:00:00Z) or unix seconds/ms. Default: now. Works for past and future, e.g. for backtests.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad parameter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "macro_events",
        "summary": "Scheduled macro events",
        "description": "Upcoming FOMC rate decisions (statement time in UTC and New York time, projections flag, countdown) from the Federal Reserve calendar, and the previous one.",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Look-ahead window in days (default 120)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 800
            }
          },
          {
            "name": "at",
            "in": "query",
            "required": false,
            "description": "Optional moment to compute for: ISO 8601 (2026-11-17T18:00:00Z) or unix seconds/ms. Default: now. Works for past and future, e.g. for backtests.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad parameter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}