BLACK FRIDAY

All plans up to 50% off, only Nov 23 – Dec 6. Don’t miss out!

Get It Now

Eastmoney API Option Kline Secid Market Code: Complete Guide to Options Daily K-Line Data

  1. iTick
  2. Futures API
Eastmoney API Option Kline Secid Market Code: Complete Guide to Options Daily K-Line Data - iTick
Eastmoney API Option Kline Secid Market Code: Complete Guide to Options Daily K-Line Data

Accessing historical Chinese options market data can be challenging, especially when you need accurate security identifiers, market codes, and daily K-line information. The Eastmoney API provides a useful way to retrieve historical market data through HTTP requests, making it relevant for developers, quantitative analysts, financial researchers, and traders.

If you are searching for eastmoney api option kline secid market code, you probably want to understand how to construct the correct API request, identify the appropriate secid, select the right market code, and retrieve 期权日K线数据 (options daily K-line data).

In this guide, we will explain the Eastmoney K-line API structure, important request parameters, market identification, Python examples, response fields, and common troubleshooting techniques.

One important distinction: Eastmoney's commonly documented historical K-line endpoint is designed for securities market data, but its stock market secid conventions should not automatically be assumed to work for every option contract. Option-specific identifiers and endpoint compatibility should be verified before using the data in production.

What Is the Eastmoney API for Option K-Line Data?

The Eastmoney API is a collection of HTTP-based interfaces used to retrieve financial market information from Eastmoney (东方财富). Developers commonly use its historical K-line endpoint to obtain daily, weekly, monthly, and intraday market data.

The commonly referenced historical K-line endpoint is:

      https://push2his.eastmoney.com/api/qt/stock/kline/get

    

This endpoint accepts parameters such as secid, klt, fqt, beg, end, and fields2.

For standard supported securities, the response can contain:

  • Trading date
  • Opening price
  • Closing price
  • Highest price
  • Lowest price
  • Trading volume
  • Trading amount
  • Price amplitude
  • Percentage change
  • Absolute price change
  • Turnover rate

For an options-data workflow, these fields can help developers study historical price movements, build charts, and perform market analysis, provided the selected option instrument is supported by the endpoint.

Why Is 期权日K线数据 Important?

期权日K线数据 refers to historical daily candlestick data for options contracts.

A daily K-line summarizes the trading activity of a contract during one trading session. It typically includes four major price points:

  • Open: The first recorded trading price.
  • High: The highest trading price during the session.
  • Low: The lowest trading price during the session.
  • Close: The last recorded trading price.

These values are useful for historical analysis, volatility research, technical indicators, and quantitative trading strategies.

However, option contracts have additional characteristics that differ from ordinary stocks, including expiration dates, strike prices, call and put types, and contract-specific liquidity.

That is why selecting the correct option contract identifier is just as important as choosing the right K-line endpoint.

Understanding Eastmoney API Option Kline Secid Market Code

The most important part of an Eastmoney historical K-line request is the secid parameter.

For commonly documented stock instruments, the standard structure is:

      secid = market_code.security_code

    

Here:

  • market_code identifies the relevant exchange or market.
  • security_code identifies the individual instrument.

For example:

      1.600519
0.000001

    

These are commonly used Shanghai and Shenzhen stock examples, respectively. They should not be treated as verified option-contract identifiers.

What Does Secid Mean in the Eastmoney API?

secid stands for security identifier. It combines a market identifier with a security code so that the API can identify the requested instrument.

A correctly formatted secid is essential because an incorrect identifier can result in empty data, an invalid response, or information for a different instrument.

For option contracts, do not simply take a stock's market code and attach an option contract number. First confirm the contract's exchange-specific identifier and whether the historical K-line endpoint recognizes it.

Eastmoney Market Code Explained

The following table shows commonly documented stock market prefixes:

MarketMarket codeExample
Shanghai Stock Exchange11.600519
Shenzhen Stock Exchange00.000001
Shanghai STAR Market1Depends on security code
Shenzhen ChiNext0Depends on security code

Important: These are stock-security conventions, not a complete mapping of Chinese options exchanges or option-contract identifiers.

Chinese options markets include contracts listed on different exchanges. An option contract's exchange, product type, and contract code must be checked individually.

For this reason, the phrase eastmoney api option kline secid market code involves two separate questions:

  1. What market identifier does Eastmoney expect?
  2. Does the selected K-line API support the particular option contract?

Both questions must be answered before relying on returned data.

Eastmoney API Parameters for Daily K-Line Data

To retrieve historical K-line information, developers need to understand the API request parameters.

Here is a breakdown of the most important parameters.

ParameterDescriptionExample
secidMarket code and security identifier1.600519
kltK-line interval101
fqtPrice adjustment method0
begStarting date20260101
endEnding date20261128
lmtMaximum number of records120
fields1Basic information fieldsf1,f2,f3,f4,f5,f6
fields2Historical K-line fieldsf51,f52,...,f61
utPublic web-client token used by some requestsVaries
_Cache-busting timestampOptional

Understanding the K-Line Interval (klt)

The klt parameter determines the time interval of the returned market data.

klt valueK-line type
11-minute K-line
55-minute K-line
1515-minute K-line
3030-minute K-line
6060-minute K-line
101Daily K-line (日K)
102Weekly K-line (周K)
103Monthly K-line (月K)

If your goal is to retrieve 期权日K线数据, the daily interval is 101, assuming the selected instrument is supported by the endpoint.

Understanding the fqt Parameter

The fqt parameter controls price adjustment:

  • 0 – No adjustment (不复权).
  • 1 – Forward adjustment (前复权).
  • 2 – Backward adjustment (后复权).

For ordinary stock historical analysis, adjusted prices can help maintain continuity around corporate actions. For options, however, do not assume stock-style adjustment is appropriate. Use the contract's actual traded prices unless the provider explicitly documents an adjustment methodology.

How to Build an Eastmoney Daily K-Line API Request

Once you have verified the security identifier and endpoint compatibility, you can construct a request using the following format.

API URL Structure

      https://push2his.eastmoney.com/api/qt/stock/kline/get

    

A standard daily K-line request for a supported Shanghai-listed stock looks like this:

      https://push2his.eastmoney.com/api/qt/stock/kline/get?secid=1.600519&klt=101&fqt=0&beg=20260101&end=20261128&lmt=120&fields1=f1,f2,f3,f4,f5,f6&fields2=f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61

    

This is an illustrative stock request, not a verified option-contract request.

Python Example: Fetching Daily K-Line Data

Python is a convenient choice for retrieving and processing historical financial data.

The following example demonstrates how to call the documented endpoint for a supported security.

      import requests
import pandas as pd

API_URL = "https://push2his.eastmoney.com/api/qt/stock/kline/get"

params = {
    "secid": "1.600519",
    "klt": "101",
    "fqt": "0",
    "beg": "20260101",
    "end": "20261128",
    "lmt": "120",
    "fields1": "f1,f2,f3,f4,f5,f6",
    "fields2": "f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61"
}

headers = {
    "User-Agent": "Mozilla/5.0"
}

response = requests.get(
    API_URL,
    params=params,
    headers=headers,
    timeout=15
)

response.raise_for_status()
result = response.json()
data = result.get("data")

if not data or not data.get("klines"):
    print("No K-line data returned.")
else:
    columns = [
        "date", "open", "close", "high", "low",
        "volume", "amount", "amplitude",
        "change_pct", "change_amount", "turnover"
    ]
    df = pd.DataFrame(
        [line.split(",") for line in data["klines"]],
        columns=columns
    )
    numeric_columns = columns[1:]
    df[numeric_columns] = df[numeric_columns].apply(
        pd.to_numeric, errors="coerce"
    )
    print(df.tail())

    

This example demonstrates the request and parsing workflow. Replace the sample security identifier only after verifying the correct identifier for your target instrument.

Can the Same Python Code Retrieve Options Data?

The request structure can serve as a starting point, but the example does not establish that the endpoint supports every Chinese option contract.

Before using it for options, verify:

  1. The actual option contract code.
  2. The corresponding Eastmoney market identifier.
  3. Whether the historical K-line endpoint accepts that option secid.
  4. Whether the response identifies the expected option contract.
  5. Whether the returned volume and amount fields match the exchange's contract units.

This validation prevents a common problem: receiving valid-looking market data for the wrong instrument.

Understanding Eastmoney K-Line API Response Fields

The historical K-line API commonly returns data through the data.klines array.

Each K-line record is represented as a comma-separated string.

A typical record structure is:

      date,open,close,high,low,volume,amount,
amplitude,change_pct,change_amount,turnover

    

The field mapping is as follows:

FieldMeaning
f51Trading date
f52Opening price
f53Closing price
f54Highest price
f55Lowest price
f56Trading volume
f57Trading amount
f58Price amplitude
f59Percentage change
f60Absolute price change
f61Turnover rate

These field definitions describe the commonly documented K-line response. Always check the actual response schema and units for your selected instrument.

Why Are These Fields Useful for Options Analysis?

For option-market research, historical daily prices can help with:

  • Identifying price trends.
  • Comparing historical closing prices.
  • Measuring daily trading activity.
  • Calculating historical volatility from suitable price series.
  • Developing technical indicators.
  • Building historical option-price charts.
  • Supporting quantitative research and backtesting.

Remember that historical option prices are affected by more than the underlying asset's movement. Implied volatility, time decay, strike price, expiration, and liquidity can all influence an option's market value.

How to Verify an Option Secid and Market Code

Finding the correct secid is one of the most important steps when working with Eastmoney API option Kline data.

Do not rely entirely on stock-market prefix rules. An option contract is a separate tradable instrument, and its identifier may follow an exchange-specific naming convention.

Use this verification workflow:

Step 1: Identify the option exchange.

Determine whether the contract belongs to the Shanghai Stock Exchange, Shenzhen Stock Exchange, or a futures exchange.

Step 2: Find the complete option contract code.

Use the exchange's contract list or a reliable market-data instrument directory.

Step 3: Resolve the Eastmoney identifier.

Check the instrument's Eastmoney quote page or an available security-search interface to determine the correct identifier.

Step 4: Test the historical K-line request.

Send a request with klt=101 and a short date range.

Step 5: Validate the returned instrument.

Check its code, name, trading dates, and price values. Never assume that a non-empty response automatically means the correct option contract was returned.

Step 6: Compare the data.

Where possible, compare the results with exchange-published historical trading information.

This process helps ensure that your 期权日K线数据 is associated with the correct contract.

Common Problems When Retrieving Eastmoney Option K-Line Data

Even when the API request is correctly formatted, developers may encounter problems when retrieving historical market information.

Here are some common issues and their possible solutions.

1. Invalid Secid or Market Code

An incorrect secid is one of the most common reasons for missing K-line records.

Solution: Verify the complete security identifier and market mapping before sending the request. Do not automatically apply Shanghai or Shenzhen stock prefixes to option contracts.

2. Empty K-Line Response

An empty klines array may indicate:

  • An unsupported security identifier.
  • An incorrect market code.
  • An invalid date range.
  • No historical trading records.
  • An unsupported instrument or API endpoint.

Solution: Test the instrument against a known quote source and verify its historical trading availability.

3. Incorrect K-Line Interval

If you need daily historical data but accidentally use klt=5, the API will request five-minute data instead.

Solution: Use klt=101 for daily K-line data.

4. Incorrect Price Adjustment

Using an unsuitable adjustment setting can produce misleading historical price comparisons.

Solution: For option contracts, start with fqt=0 unless the provider documents another appropriate adjustment method.

5. API Request Restrictions

Eastmoney's publicly accessible web interfaces are not the same as a formally documented, guaranteed API service. Request restrictions, response formats, and availability can change.

Solution: Implement reasonable request intervals, timeouts, error handling, and caching. Avoid sending excessive requests.

Eastmoney API vs. Other Financial Market Data Sources

Eastmoney is one option for retrieving Chinese financial market information. However, developers building applications around historical options data should evaluate multiple sources.

FeatureEastmoney APIExchange dataOther market-data APIs
Historical K-lineEndpoint-dependentDepends on exchange serviceProvider-dependent
Daily OHLCSupported for compatible instrumentsDepends on available datasetsOften supported
Option contract identificationMust be verifiedExchange-specificProvider-specific
Historical option pricesMust be verifiedDepends on data accessProvider-dependent
API documentationPublic interface documentation is limitedVariesVaries
Data access conditionsSubject to service restrictionsExchange-specificProvider-specific

For developers exploring alternative market-data resources, iTick is another platform worth evaluating. Check its current API documentation for supported markets, options coverage, historical K-line intervals, and access requirements before integrating it into a project.

The best data source depends on your application, required historical coverage, data accuracy, update frequency, and licensing requirements.

Best Practices for Working with 期权日K线数据

If you are building a financial application, trading dashboard, or quantitative analysis system, consider the following practices.

Validate security identifiers: Maintain a mapping between exchange, option contract code, and provider-specific secid.

Store raw API responses: Keeping original responses helps with debugging and historical verification.

Use consistent date formats: Eastmoney historical K-line requests commonly use YYYYMMDD for beg and end.

Handle missing records: Options contracts may have low trading activity or no transactions on particular dates.

Understand contract specifications: Track strike price (行权价), expiration date (到期日), call options (看涨期权), and put options (看跌期权).

Check trading volume and liquidity: A historical closing price alone may not accurately represent an option's tradable market value.

Respect API access limitations: Use caching and sensible request intervals rather than repeatedly requesting the same historical dataset.

These practices can make your historical options data pipeline more reliable and easier to maintain.

Frequently Asked Questions (FAQs)

What is the Eastmoney API endpoint for historical K-line data?

The commonly documented historical K-line endpoint is:

      https://push2his.eastmoney.com/api/qt/stock/kline/get

    

It supports historical K-line requests for compatible securities using parameters such as secid, klt, fqt, beg, and end.

What is the secid format in the Eastmoney API?

For commonly documented stock instruments, secid follows this format:

      market_code.security_code

    

For example, 1.600519 represents a Shanghai-listed stock identifier. Option contract identifiers must be independently verified.

Which market code is used for Shanghai and Shenzhen stocks?

The commonly used stock market prefixes are:

  • 1 for Shanghai.
  • 0 for Shenzhen.

These conventions should not be treated as a universal mapping for Chinese option contracts.

Which klt value is used for 期权日K线数据?

The klt=101 parameter represents daily K-line data (日K线). Whether it returns data for a particular option contract depends on endpoint support and the validity of its secid.

What does fqt=0 mean?

fqt=0 means no price adjustment (不复权). It is a sensible starting point when inspecting actual historical option trading prices.

Can I retrieve historical option prices using Python?

Yes, Python can send HTTP requests, process JSON responses, and convert K-line records into Pandas DataFrames. However, successful retrieval depends on whether the selected Eastmoney endpoint supports the requested option contract.

What information does daily option K-line data contain?

A typical K-line record can include opening price, closing price, highest price, lowest price, trading volume, trading amount, amplitude, percentage change, and turnover rate.

The exact fields available depend on the endpoint and instrument.

Does Eastmoney provide a free API key for K-line requests?

The commonly used public historical K-line interface does not generally require a separately issued API key. However, it is an unofficially documented web interface, and access is subject to Eastmoney's service conditions and technical restrictions.

How can I troubleshoot an incorrect option market code?

Verify the exchange, contract code, provider-specific identifier, and returned instrument name. Compare the response against a trusted source before using the data for financial analysis.

Conclusion

The eastmoney api option kline secid market code combination is important for developers who want to retrieve historical Chinese financial market information and investigate 期权日K线数据.

Understanding secid, market codes, klt=101, fqt, date parameters, and K-line response fields makes it easier to construct and troubleshoot historical data requests.

However, the most important consideration is instrument compatibility. Standard Shanghai and Shenzhen stock market codes should not automatically be applied to options. Always verify the option contract identifier and confirm that the selected Eastmoney endpoint returns the correct instrument.

With proper identifier validation, Python-based data processing, and reliable historical data verification, developers can build more accurate financial analysis tools and options research workflows.