{
  "openapi": "3.0.3",
  "info": {
    "title": "LastLook Data API",
    "version": "2.10.0",
    "description": "Financial market data for AI agents — Treasury yields, mortgage rates, FX rates, energy prices, macro indicators, yield curve spreads, recession signals, and economic calendar data. Pay per query via x402 protocol. No API keys or accounts required.",
    "contact": {
      "name": "LastLook Data",
      "url": "https://www.lastlookdata.com",
      "email": "hello@lastlookdata.com"
    },
    "termsOfService": "https://www.lastlookdata.com/terms",
    "x-x402": {
      "protocol": "x402-v2",
      "network": "eip155:8453",
      "asset": "USDC",
      "payTo": "0xB4848d1b4b7E31B75b9b30d717F89777dC65D68e",
      "docs": "https://www.lastlookdata.com/docs"
    }
  },
  "servers": [
    {
      "url": "https://api.lastlookdata.com",
      "description": "Production"
    }
  ],
  "tags": [
    { "name": "FRED", "description": "Federal Reserve Economic Data — raw series" },
    { "name": "FX", "description": "G10 FX rates via European Central Bank" },
    { "name": "Derived", "description": "Computed and interpreted market signals" },
    { "name": "Calendar", "description": "Economic data release schedule" },
    { "name": "Bundles", "description": "Pre-built multi-series bundles — one payment, parallel data fetch" },
    { "name": "Free", "description": "No payment required" }
  ],
  "paths": {
    "/api/current": {
      "get": {
        "tags": ["FRED"],
        "summary": "Current value for any FRED series",
        "description": "Returns the most recent observation for any supported FRED series. Common use cases: mortgage rates (?id=MORTGAGE30US), Fed funds rate (?id=FEDFUNDS), 10yr Treasury (?id=DGS10), CPI (?id=CPIAUCSL), unemployment (?id=UNRATE), WTI crude (?id=DCOILWTICO).",
        "operationId": "getFredCurrent",
        "x-x402": { "price": "0.01", "currency": "USDC" },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "FRED series ID",
            "schema": {
              "type": "string",
              "enum": ["DGS30","DGS10","DGS5","DGS2","DGS1MO","MORTGAGE30US","MORTGAGE15US","MSPUS","HOUST","FEDFUNDS","SOFR","DPRIME","DTB3","IORB","EFFR","CPIAUCSL","CPILFESL","UNRATE","GDP","DCOILWTICO","DCOILBRENTEU","GASREGCOVW","DHHNGSP","SAHMREALTIME"],
              "example": "MORTGAGE30US"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current value",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/FredCurrentResponse" },
                "example": {
                  "service": "LastLook Data",
                  "series_id": "MORTGAGE30US",
                  "label": "30-Year Fixed Rate Mortgage Average",
                  "date": "2026-05-15",
                  "value": 6.86,
                  "note": "Source: Federal Reserve Bank of St. Louis (FRED)"
                }
              }
            }
          },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "400": { "$ref": "#/components/responses/BadRequest" }
        }
      }
    },
    "/api/date": {
      "get": {
        "tags": ["FRED"],
        "summary": "FRED series value on a specific date",
        "description": "Returns the value for any supported FRED series on a specific business day.",
        "operationId": "getFredByDate",
        "x-x402": { "price": "0.01", "currency": "USDC" },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "FRED series ID",
            "schema": {
              "type": "string",
              "enum": ["DGS30","DGS10","DGS5","DGS2","DGS1MO","MORTGAGE30US","MORTGAGE15US","MSPUS","HOUST","FEDFUNDS","SOFR","DPRIME","DTB3","IORB","EFFR","CPIAUCSL","CPILFESL","UNRATE","GDP","DCOILWTICO","DCOILBRENTEU","GASREGCOVW","DHHNGSP","SAHMREALTIME"]
            }
          },
          {
            "name": "d",
            "in": "query",
            "required": true,
            "description": "Date in YYYY-MM-DD format (business days only)",
            "schema": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "example": "2026-05-09" }
          }
        ],
        "responses": {
          "200": {
            "description": "Value on the requested date",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/FredCurrentResponse" }
              }
            }
          },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/api/series/30": {
      "get": {
        "tags": ["FRED"],
        "summary": "Last 30 days of observations",
        "description": "Returns up to 30 days of observations for any supported FRED series.",
        "operationId": "getFredSeries30",
        "x-x402": { "price": "0.05", "currency": "USDC" },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "FRED series ID",
            "schema": {
              "type": "string",
              "enum": ["DGS30","DGS10","DGS5","DGS2","DGS1MO","MORTGAGE30US","MORTGAGE15US","MSPUS","HOUST","FEDFUNDS","SOFR","DPRIME","DTB3","IORB","EFFR","CPIAUCSL","CPILFESL","UNRATE","GDP","DCOILWTICO","DCOILBRENTEU","GASREGCOVW","DHHNGSP","SAHMREALTIME"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "30-day observation array",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/FredSeriesResponse" }
              }
            }
          },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "400": { "$ref": "#/components/responses/BadRequest" }
        }
      }
    },
    "/api/series/90": {
      "get": {
        "tags": ["FRED"],
        "summary": "Last 90 days of observations",
        "description": "Returns up to 90 days of observations for any supported FRED series.",
        "operationId": "getFredSeries90",
        "x-x402": { "price": "0.10", "currency": "USDC" },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": ["DGS30","DGS10","DGS5","DGS2","DGS1MO","MORTGAGE30US","MORTGAGE15US","MSPUS","HOUST","FEDFUNDS","SOFR","DPRIME","DTB3","IORB","EFFR","CPIAUCSL","CPILFESL","UNRATE","GDP","DCOILWTICO","DCOILBRENTEU","GASREGCOVW","DHHNGSP","SAHMREALTIME"]
            }
          }
        ],
        "responses": {
          "200": { "description": "90-day observation array", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FredSeriesResponse" } } } },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "400": { "$ref": "#/components/responses/BadRequest" }
        }
      }
    },
    "/api/series/365": {
      "get": {
        "tags": ["FRED"],
        "summary": "Last 365 days of observations",
        "description": "Returns up to 365 days of observations for any supported FRED series.",
        "operationId": "getFredSeries365",
        "x-x402": { "price": "0.25", "currency": "USDC" },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": ["DGS30","DGS10","DGS5","DGS2","DGS1MO","MORTGAGE30US","MORTGAGE15US","MSPUS","HOUST","FEDFUNDS","SOFR","DPRIME","DTB3","IORB","EFFR","CPIAUCSL","CPILFESL","UNRATE","GDP","DCOILWTICO","DCOILBRENTEU","GASREGCOVW","DHHNGSP","SAHMREALTIME"]
            }
          }
        ],
        "responses": {
          "200": { "description": "365-day observation array", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FredSeriesResponse" } } } },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "400": { "$ref": "#/components/responses/BadRequest" }
        }
      }
    },
    "/api/fx/current": {
      "get": {
        "tags": ["FX"],
        "summary": "Current G10 FX rate",
        "description": "Returns the current exchange rate for any G10 currency pair. Source: European Central Bank via Frankfurter.",
        "operationId": "getFxCurrent",
        "x-x402": { "price": "0.01", "currency": "USDC" },
        "parameters": [
          {
            "name": "pair",
            "in": "query",
            "required": true,
            "description": "G10 currency pair",
            "schema": {
              "type": "string",
              "enum": ["EURUSD","GBPUSD","USDJPY","USDCHF","USDCAD","AUDUSD","NZDUSD","USDSEK","USDNOK"],
              "example": "EURUSD"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current FX rate",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/FxCurrentResponse" },
                "example": {
                  "service": "LastLook Data",
                  "pair": "EURUSD",
                  "label": "Euro / US Dollar",
                  "date": "2026-05-15",
                  "rate": 1.1245,
                  "base": "EUR",
                  "quote": "USD",
                  "note": "Source: Frankfurter (European Central Bank)"
                }
              }
            }
          },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "400": { "$ref": "#/components/responses/BadRequest" }
        }
      }
    },
    "/api/fx/date": {
      "get": {
        "tags": ["FX"],
        "summary": "G10 FX rate on a specific date",
        "description": "Returns the exchange rate for a G10 currency pair on a specific business day. Source: ECB.",
        "operationId": "getFxByDate",
        "x-x402": { "price": "0.01", "currency": "USDC" },
        "parameters": [
          {
            "name": "pair",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "enum": ["EURUSD","GBPUSD","USDJPY","USDCHF","USDCAD","AUDUSD","NZDUSD","USDSEK","USDNOK"] }
          },
          {
            "name": "d",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "example": "2026-05-09" }
          }
        ],
        "responses": {
          "200": { "description": "FX rate on date", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FxCurrentResponse" } } } },
          "402": { "$ref": "#/components/responses/PaymentRequired" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/api/fx/series": {
      "get": {
        "tags": ["FX"],
        "summary": "Historical G10 FX rate series",
        "description": "Returns historical daily exchange rates for a G10 currency pair. Source: ECB.",
        "operationId": "getFxSeries",
        "x-x402": { "price": "0.05 / 0.10 / 0.25", "currency": "USDC", "note": "Price depends on ?days parameter" },
        "parameters": [
          {
            "name": "pair",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "enum": ["EURUSD","GBPUSD","USDJPY","USDCHF","USDCAD","AUDUSD","NZDUSD","USDSEK","USDNOK"] }
          },
          {
            "name": "days",
            "in": "query",
            "required": true,
            "desc