What the Data Looks Like
Data sources include daily industry statistics from domestic non-ferrous metal industry associations, public margin trading and short selling position data from futures exchanges, and daily transaction and financing data from spot trading platforms. Full data updates for the previous trading day run between 1:00 and 3:00 AM daily. Single data documents are wrapped in JSON format, with seven core fields: metal_code (variety code), metal_name (variety name), report_date (report date), financing_buy_amount (daily financing purchase amount, unit: ten thousand RMB), financing_balance (end-of-period financing balance, unit: ten thousand RMB), short_sell_volume (daily short selling volume, unit: trading lots), short_sell_balance (end-of-period short selling balance, unit: ten thousand RMB). Some varieties include an optional daily spot benchmark price field.
Constraints Imposed on HTTP Interfaces and External Systems
Scattered data sources and concentrated update windows create specific requirements for HTTP interfaces and external systems. HTTP interfaces must support configuration of multiple data source addresses and parallel pulling. Scheduled pulling tasks must avoid the 1:00 to 3:00 AM update window to prevent incomplete, unsynchronized data. Core fields have clear unit requirements. External systems must strictly match field names and unit conversion rules to avoid statistical deviations. A large number of minor metal varieties require interfaces to support pagination parameters page_size and page_num. The volume of data returned in a single request must be limited. Interfaces must support returning specified fields on demand to reduce data processing load on external systems, as some varieties include optional fields.
Configuration Settings
| Configuration Item | Recommended Value | Rationale |
|---|---|---|
DATA_SOURCE_URLS | Separate multiple data source addresses with commas, for example https://api.metal1.com/report,https://api.metal2.com/report | Adapt to multi-source collection needs for minor metal data, parallel pulling improves data acquisition efficiency |
FETCH_SCHEDULE | 0 4 * * * | Avoid the daily 1:00 to 3:00 AM data source update window to ensure complete previous trading day data is retrieved |
REQUIRED_FIELDS | metal_code,metal_name,report_date,financing_buy_amount,financing_balance | Return only core business required fields, reducing unnecessary data transmission and processing overhead |
PAGE_SIZE | 20 | Match the conventional quantity range of minor metal varieties, control single-request data volume to avoid interface timeouts |
API_TIMEOUT | 600 seconds | Accommodate network latency during parallel multi-source pulling, prevent task interruptions from timeouts |
UNIT_CONVERSION_ENABLE | true | Automatically convert non-standard units from different sources to the internal system’s required ten thousand RMB and standard lot units |
The parameter values provided on this page are common starting points for configuration. Actual values are affected by material form, data volume and business rules. Specific issues require individual analysis. It is recommended to test on your own samples before finalizing settings.
Three Common Mistakes
- Issue: After configuring multiple API keys, the interface cannot switch keys as expected for calls. Cause: Multiple keys were not formatted as comma-separated values in the configuration item, or key polling logic was not implemented.
- Issue: Calling the financing daily report interface returns
400 InternalError.Algo.InvalidParameter. Cause: The incomingmetal_codeparameter does not match standard minor metal coding rules, or thereport_dateparameter exceeds the queryable historical data range. - Issue: MySQL connection or field errors occur when writing to an external database. Cause: Interface return fields and database table structure were not aligned, or the database connection retry mechanism was not configured, leading to write failures.
How to Verify Successful Configuration
- Manually call the configured HTTP interface, confirm returned fields match the
REQUIRED_FIELDSconfiguration, and units meet internal system requirements. - Review scheduled pulling task execution logs, confirm the task ran successfully during the preset time period with no authentication failures or timeout errors.
- Trigger a single data writing process, confirm the external system can receive and store the financing daily report data returned by the interface normally.
- Switch between different data source addresses, confirm the interface can pull and merge multi-source data without data loss or format abnormalities.
Question material comes from public community discussions. Configuration values are common starting points and should be measured against your own samples. Verified on 2026-09-14.