How to query financial data through the stock quote interface?

When we do transactions, sometimes we still need to use the financial data of some listed companies. Is there any section that can quickly obtain financial data? That must be to use the stock market interface to query, so how to do it specifically? The following set of code can understand:

get_fundamentals - query financial data
get_fundamentals(query, entry_date, interval=None, report_quarter=False, expect_df=False)

Obtain the historical financial data table, currently supports more than 400 indicators in the Chinese market, please refer to the financial data document for details. At present, only the Chinese market is supported. It should be noted that when querying fundamental data on RiceQuant, we use the announcement date of all annual reports as the standard, because only after the financial report is released can it become publicly available data in the market.

Parameters:
|Parameters|Type|Description|------ |query|SQLAlchemyQueryObject|SQLAlchemy Query object. Among them, you can fill in the indicators to be queried in 'query', and fill in the data filter conditions in 'filter'. For details, please refer to sqlalchemy's query documentation to learn to use more convenient query statements. From a data scientist's point of view, the use of sqlalchemy is simpler and more powerful than sql |entry_date|str, datetime.date, datetime.datetime, pandasTimestamp|query the base start date of financial data |interval|str|interval of query financial data. For example, if you fill in '5y', it means to go back 5 years from the entry_date (including entry_date), and the returned data time is at an interval of years. 'd' - day, 'w' - week, 'm' - month, 'q' - quarter, 'y' - year |report_quarter|bool|whether to show the report period, the default is not to show. 'Q1' - 1st quarterly report, 'Q2' - semi-annual report, 'Q3' - 3rd quarterly report, 'Q4' - annual report |expect_df|boolean|default returns the original Panel data structure. If called true, returns pandas dataframe

Return pandas DataPanel - financial data query results.
[In]
dp = get_fundamentals(query(fundamentals.eod_derivative_indicator.pe_ratio).filter(fundamentals.stockcode == '000001.XSHE'), '2016-08-01','4q' ,report_quarter = True)
[In]
dp.minor_xs('000001.XSHE')
[Out]
  report_quarter pe_ratio
2016-08-01 2016-Q1 7.0768
2016-04-29 2016-Q1 6.7755
2016-01-29 2015- Q3 6.5492
2015-10-29 2015-Q3 7.3809

What are the useful data market interfaces at present? On gitee, there is such a demo , which can get many different types of stock data, for example:

Interested friends, you can go to gitee to see for yourself, or you can contact qq below to find out more details.

 

Guess you like

Origin blog.csdn.net/QQ2037696191/article/details/128135178