query_spot
Retrieve spot price data for precious metals or commodities and export to CSV. Select SGE for daily gold/silver quotes, or SY for main contract prices and basis.
Instructions
Query spot prices. Output is written to file_path as CSV. kind=sge: 上金所贵金属现货日线 date,open,high,low,close(2016-12 起约 10 年深度,symbol 必填如 Au99.99/Ag99.99/Au(T+D)). kind=sy: 生意社大宗现货含主力合约价与基差(symbols 如 ['CU','RB'];起止日期必填,逐日抓取较慢,单次区间最长 1 年).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | Query type | |
| symbol | No | SGE variety, e.g. Au99.99, Ag99.99, Au(T+D) (sge only, required) | |
| symbols | No | 100ppi variety codes, e.g. ["CU", "RB"] (sy only, required) | |
| end_date | No | End date YYYY-MM-DD (required for sy; optional filter for sge) | |
| file_path | Yes | Output CSV file path | |
| start_date | No | Start date YYYY-MM-DD (required for sy; optional filter for sge) |