---
title: "Chart Search Commentary"
method: GET
path: "/api/chart-search/{symbol}/commentary"
tags: ["Chart Analysis"]
---

# Chart Search Commentary

`GET /api/chart-search/{symbol}/commentary`

## 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/chart-search/{symbol}/commentary`
- Auth: none declared

Optional, user-triggered plain-text AI summary of the real numeric
data above. Deliberately a separate, lazy endpoint rather than being
bundled into /chart-search -- the default search-and-chart flow costs
zero LLM calls; this only runs when the user explicitly clicks
"Generate AI commentary". Text-only completion (get_ai_response), not
vision -- there's no screenshot in this flow, so there's nothing for a
vision model to look at; it's purely writing up numbers that were
already computed from real market data.

2026-07-31 fix: this used to hard-force "用繁體中文" (Traditional
Chinese) into the prompt regardless of the site's selected UI
language -- same backend-hardcoded-language bug already fixed once
for the screener prompt (task #317/#327) and once for
historical_analog_service.py (task #530). Now accepts the same
`lang` param the sibling /chart-search and /multi-timeframe endpoints
on this router already take, and swaps in the shared
ai_language_instruction(lang) helper (services/i18n.py) instead of a
literal Chinese sentence -- same helper api/chat.py and
api/ai_analysis.py's screener prompt already use, so this doesn't
invent a second translation mechanism for the same concept.

## Path parameters

- `symbol` string, required

## Query parameters

- `period` string
- `interval` string
- `token` 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)
