---
title: "Historical Analog"
method: GET
path: "/api/historical-analog/{symbol}"
tags: ["Historical Analog"]
---

# Historical Analog

`GET /api/historical-analog/{symbol}`

## Request

- Base URL: `https://api.xfinlab.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.xfinlab.com/api/historical-analog/{symbol}`
- Auth: none declared

Honest 'what actually happened last time this ticker was in a
similar trend+volatility regime' read -- see services/
historical_analog_service.py's docstring for why this replaces a
fabricated macro-shock-slider design.

2026-07-30 fix ("做咩又有不同語言 全網跟進"): this endpoint used to have
no lang param at all, so every string it returned (error messages,
regime_label, methodology sentence) was hardcoded Cantonese regardless
of the site's selected UI language. ai-analysis.html now passes
?lang=<I18N.currentLang>; find_analogs() uses it to translate via
services/i18n.py (falls back to the old Cantonese behavior when no
lang is supplied, so any other caller is unaffected).

## Path parameters

- `symbol` string, required

## Query parameters

- `forward_days` integer
- `period` string
- `lang` string

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/xfinlab/apis/xfinlab-api.md) · [All operations](https://skmtc.dev/xfinlab/apis/xfinlab-api/llms.txt) · [OpenAPI document](https://skmtc.dev/xfinlab/apis/xfinlab-api/revisions/205f85614bc6?raw)
