{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/prereason-com/json-schema/prereason-com-metric-latest-reading-schema.json",
  "title": "MetricLatestReading",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/prereason-com-openapi.json#/components/schemas/MetricLatestReading",
  "type": "object",
  "properties": {
    "metric": {
      "type": "string",
      "description": "The series' public name, as MetricData carries it."
    },
    "name": {
      "type": "string",
      "description": "Equal to `metric`, as MetricData carries it."
    },
    "stored_name": {
      "type": "string",
      "description": "The identifier PreReason stores the series under. It names no source; the series' source is in `source`."
    },
    "instrument": {
      "type": "string",
      "enum": [
        "futures",
        "swap",
        "options"
      ],
      "description": "Present on a series that measures a futures, swap or options market (`futures`, `swap` or `options`), including a series PreReason calculates from one, and absent for every other series."
    },
    "display_name": {
      "type": "string"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "reading": {
      "type": "string",
      "description": "The value in its unit, as the full answer's sentence prints it"
    },
    "source": {
      "type": "string"
    },
    "display": {
      "type": "string",
      "enum": [
        "yes",
        "notice",
        "no"
      ],
      "description": "Whether a Business plan's display licence covers showing this figure to your users. yes; notice, when shown with its provider's credit (named on the Data sources page); or no, when the provider's terms do not allow it, were not read, or the value is calculated from inputs whose sources' terms have not been traced."
    },
    "notices": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The notices the row's sources require shown with the figure, each in its terms record's own words (\"Powered by CoinGecko.\"), and Korea Customs' naming its release's title and date. Absent when no source requires one; the New York Fed's reference rates carry theirs as their source."
    },
    "data_quality": {
      "$ref": "#/$defs/DataQuality"
    },
    "access": {
      "type": "object",
      "properties": {
        "served": {
          "type": "string",
          "enum": [
            "latest_reading"
          ]
        },
        "withheld": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The fields of MetricData this answer leaves out"
        },
        "full_answer_tier": {
          "type": "string",
          "enum": [
            "basic",
            "pro"
          ],
          "description": "The lowest tier that reads this metric in full, pro for a metric only pro briefings use"
        },
        "note": {
          "type": "string"
        },
        "upgrade_request": {
          "type": "object",
          "description": "How an agent asks the key's owner for the tier full_answer_tier names, as a tier refusal offers it"
        }
      }
    }
  },
  "$defs": {
    "DataQuality": {
      "type": "object",
      "properties": {
        "age_hours": {
          "type": "number"
        },
        "stale": {
          "type": "boolean"
        },
        "status": {
          "type": "string",
          "enum": [
            "fresh",
            "warning",
            "stale"
          ]
        }
      }
    }
  }
}