{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://socialcrawl.dev/schemas/quote.json",
  "title": "SocialCrawl Quote",
  "description": "Canonical unified financial quote object returned by every SocialCrawl endpoint with the Quote/QuoteList archetype. Nullability is expressed via JSON Schema 2020-12 type arrays. Generated from the Zod schema in packages/social-api/src/schemas/canonical.ts.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Instrument identifier — re-feed into /v1/google_finance/quote (\"GOOGL:NASDAQ\" | \".INX:INDEXSP\" | \"EUR-USD\")"
    },
    "ticker": {
      "type": [
        "string",
        "null"
      ],
      "description": "Ticker symbol (null for forex/crypto asset pairs)"
    },
    "exchange": {
      "type": [
        "string",
        "null"
      ],
      "description": "Primary exchange / market identifier"
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Display name (e.g. 'Alphabet Inc Class A')"
    },
    "type": {
      "type": "string",
      "description": "Instrument class: stock | etf | index | crypto | forex | futures | fund | unknown"
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "description": "String at quote.url"
    },
    "currency": {
      "type": [
        "string",
        "null"
      ],
      "description": "Price currency (null for asset pairs)"
    },
    "pair": {
      "type": [
        "object",
        "null"
      ],
      "description": "Forex/crypto base+quote symbols (null for stocks/indices)",
      "properties": {
        "base_symbol": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at quote.pair.base_symbol"
        },
        "quote_symbol": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at quote.pair.quote_symbol"
        },
        "base_display_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at quote.pair.base_display_name"
        },
        "quote_display_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at quote.pair.quote_display_name"
        }
      }
    },
    "price": {
      "type": "object",
      "description": "Price block (current, previous_close, delta, ranges, trend)",
      "properties": {
        "current": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.price.current"
        },
        "previous_close": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.price.previous_close"
        },
        "delta": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.price.delta"
        },
        "percentage_delta": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.price.percentage_delta"
        },
        "trend": {
          "type": [
            "string",
            "null"
          ],
          "description": "Leaf at quote.price.trend"
        },
        "day_low": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.price.day_low"
        },
        "day_high": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.price.day_high"
        },
        "year_low": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.price.year_low"
        },
        "year_high": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.price.year_high"
        },
        "timestamp": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at quote.price.timestamp"
        }
      }
    },
    "metrics": {
      "type": [
        "object",
        "null"
      ],
      "description": "Fundamentals (market_cap, pe_ratio, dividend_yield, expense_ratio, …); null on thin rows",
      "properties": {
        "market_cap": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.metrics.market_cap"
        },
        "volume": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.metrics.volume"
        },
        "avg_volume": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.metrics.avg_volume"
        },
        "pe_ratio": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.metrics.pe_ratio"
        },
        "dividend_yield": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.metrics.dividend_yield"
        },
        "ytd_return": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.metrics.ytd_return"
        },
        "expense_ratio": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.metrics.expense_ratio"
        },
        "net_assets": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.metrics.net_assets"
        },
        "yield": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.metrics.yield"
        },
        "open_interest": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.metrics.open_interest"
        },
        "category": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at quote.metrics.category"
        },
        "metrics_currency": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at quote.metrics.metrics_currency"
        }
      }
    },
    "about": {
      "type": [
        "object",
        "null"
      ],
      "description": "Company profile (description, CEO, HQ, employees); equities",
      "properties": {
        "description": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at quote.about.description"
        },
        "description_source_url": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at quote.about.description_source_url"
        },
        "ceo": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at quote.about.ceo"
        },
        "founded": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at quote.about.founded"
        },
        "headquarters": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at quote.about.headquarters"
        },
        "website": {
          "type": [
            "string",
            "null"
          ],
          "description": "String at quote.about.website"
        },
        "employees": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Numeric at quote.about.employees"
        }
      }
    },
    "graph": {
      "type": [
        "array",
        "null"
      ],
      "description": "Intraday price series ({ timestamp, value, volume })",
      "items": {
        "type": "object",
        "description": "Intraday price series ({ timestamp, value, volume })",
        "properties": {
          "timestamp": {
            "type": "string",
            "description": "String at quote.graph.timestamp"
          },
          "value": {
            "type": "integer",
            "description": "Numeric at quote.graph.value"
          },
          "volume": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Numeric at quote.graph.volume"
          }
        }
      }
    },
    "financials": {
      "type": [
        "object",
        "null"
      ],
      "description": "Quarterly + annual fundamentals (equities only; null otherwise)",
      "properties": {
        "quarterly": {
          "type": [
            "array",
            "null"
          ],
          "description": "Array at quote.financials.quarterly",
          "items": {
            "type": "string",
            "description": "Leaf at quote.financials.quarterly"
          }
        },
        "annual": {
          "type": [
            "array",
            "null"
          ],
          "description": "Array at quote.financials.annual",
          "items": {
            "type": "string",
            "description": "Leaf at quote.financials.annual"
          }
        }
      }
    },
    "peers": {
      "type": [
        "array",
        "null"
      ],
      "description": "Related instruments (compare_to)",
      "items": {
        "type": "object",
        "description": "Related instruments (compare_to)",
        "properties": {
          "id": {
            "type": "string",
            "description": "String at quote.peers.id"
          },
          "ticker": {
            "type": [
              "string",
              "null"
            ],
            "description": "String at quote.peers.ticker"
          },
          "exchange": {
            "type": [
              "string",
              "null"
            ],
            "description": "String at quote.peers.exchange"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "String at quote.peers.name"
          },
          "type": {
            "type": "string",
            "description": "Leaf at quote.peers.type"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "String at quote.peers.url"
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "String at quote.peers.currency"
          },
          "pair": {
            "type": [
              "object",
              "null"
            ],
            "description": "Nested object: quote.peers.pair",
            "properties": {
              "base_symbol": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at quote.peers.pair.base_symbol"
              },
              "quote_symbol": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at quote.peers.pair.quote_symbol"
              },
              "base_display_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at quote.peers.pair.base_display_name"
              },
              "quote_display_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at quote.peers.pair.quote_display_name"
              }
            }
          },
          "price": {
            "type": "object",
            "description": "Nested object: quote.peers.price",
            "properties": {
              "current": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.price.current"
              },
              "previous_close": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.price.previous_close"
              },
              "delta": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.price.delta"
              },
              "percentage_delta": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.price.percentage_delta"
              },
              "trend": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Leaf at quote.peers.price.trend"
              },
              "day_low": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.price.day_low"
              },
              "day_high": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.price.day_high"
              },
              "year_low": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.price.year_low"
              },
              "year_high": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.price.year_high"
              },
              "timestamp": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at quote.peers.price.timestamp"
              }
            }
          },
          "metrics": {
            "type": [
              "object",
              "null"
            ],
            "description": "Nested object: quote.peers.metrics",
            "properties": {
              "market_cap": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.metrics.market_cap"
              },
              "volume": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.metrics.volume"
              },
              "avg_volume": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.metrics.avg_volume"
              },
              "pe_ratio": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.metrics.pe_ratio"
              },
              "dividend_yield": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.metrics.dividend_yield"
              },
              "ytd_return": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.metrics.ytd_return"
              },
              "expense_ratio": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.metrics.expense_ratio"
              },
              "net_assets": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.metrics.net_assets"
              },
              "yield": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.metrics.yield"
              },
              "open_interest": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Numeric at quote.peers.metrics.open_interest"
              },
              "category": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at quote.peers.metrics.category"
              },
              "metrics_currency": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "String at quote.peers.metrics.metrics_currency"
              }
            }
          }
        }
      }
    },
    "ext": {
      "type": [
        "string",
        "null"
      ],
      "description": "Leaf at quote.ext"
    }
  },
  "additionalProperties": true
}
