{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sentiscale-app/json-schema/sentiscale-app-fear-greed-response-schema.json",
  "title": "FearGreedResponse",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sentiscale-app-openapi.json#/components/schemas/FearGreedResponse",
  "type": "object",
  "required": [
    "markets",
    "attribution",
    "terms"
  ],
  "properties": {
    "markets": {
      "type": "object",
      "description": "One entry per live market. A market that is warming up is left out.",
      "properties": {
        "us": {
          "$ref": "#/$defs/Reading"
        },
        "eu": {
          "$ref": "#/$defs/Reading"
        },
        "asia": {
          "$ref": "#/$defs/Reading"
        }
      }
    },
    "attribution": {
      "$ref": "#/$defs/Attribution"
    },
    "terms": {
      "type": "string",
      "format": "uri",
      "description": "Where the terms of use are published."
    }
  },
  "$defs": {
    "Attribution": {
      "type": "object",
      "required": [
        "required",
        "text",
        "url"
      ],
      "properties": {
        "required": {
          "type": "boolean",
          "description": "Always true: show a visible link wherever the number is shown."
        },
        "text": {
          "type": "string",
          "description": "Suggested link text."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Where the link must point."
        }
      }
    },
    "Reading": {
      "type": "object",
      "required": [
        "score",
        "band",
        "as_of",
        "url"
      ],
      "properties": {
        "score": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "description": "0 is extreme fear, 100 is extreme greed."
        },
        "band": {
          "type": "string",
          "enum": [
            "EXTREME FEAR",
            "FEAR",
            "NEUTRAL",
            "GREED",
            "EXTREME GREED"
          ],
          "description": "EXTREME FEAR 0 to 24, FEAR 25 to 44, NEUTRAL 45 to 55, GREED 56 to 75, EXTREME GREED 76 to 100."
        },
        "as_of": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "The market day the reading belongs to."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The market's page on sentiscale.app, with its chart and history."
        }
      }
    }
  }
}