Securities Bao Www.baostock.com is a free, open-source securities data platform.
Provide a large number of accurate and complete securities historical market data, listed company financial data, real-time securities market push services.
Acquisition of securities data information through the Python API, to meet quantitative trading investors, quantitative financial enthusiasts, metering economic practitioners data needs.
This introduction interface: To obtain quarterly frequency Performance Bulletin data :query_performance_express_report ()
(The following code from the official website, invasion and deletion )
Method Description: Query quarterly frequency company Performance Express information, can be set through the parameters to obtain the year-end data, provide 2006 to date data.
return type: The Dataframe type of pandas.
The sample code is as follows:
import baostock as bsimport pandas as pd#### Landing System ### #lg = Bs.login () # display login return information print (' Login respond error_code: ' +lg.error_code) print (' Login respond error_msg: ' +lg.error_msg) #### get company Performance Express ### #rs = bs.query_performance_express_ Report ("sh.600000", start_date= "2015-01-01", end_date= "2017-12-31") print (' Query_performance_express_ Report respond error_code: ' +rs.error_code ' Print (' query_performance_express_report respond error_msg: ' +rs.error_msg ' result_list = []while (rs.error_code == ' 0 ') & rs.next (): result_list.append (Rs.get_row_data ()) # Gets a record that merges the records together RESULT = PD. DataFrame (result_list, columns=rs.fields) #### result set Output to CSV file ### #result. To_csv ("D:\\performance_ Express_report.csv ", encoding=" GBK ", index=false) print (Result) #### logout system ### #bs. Logout ()
parameter meaning:
Code: Stock code, SH or sz.+6 digit code, or index code, such as: sh.601398. SH: Shanghai; SZ: Shenzhen. This parameter is not nullable;
start_date: Start date, release date or update date within this range;
end_date: End date, release date, or update date within this range.
Return Data Description
parameter name |
parameter description |
code |
security code |
performanceexppubdate |
results announcement Day |
performanceexpstatdate |
performance bulletin statistics date |
performanceexpupdatedate |
results Announcement Day (latest) |
performanceexpresstotalasset |
Performance Express Total assets |
performanceexpressnetasset |
Performance Express Net assets |
performanceexpressepschgpct |
Performance earnings per share growth |
performanceexpre***oewa |
performance Express Net asset yield roe-weighted |
performanceexpressepsdiluted |
Performance Express earnings per share eps-diluted |
performanceexpressgryoy |
Performance Express Total revenue YoY |
performanceexpressopyoy |
Performance Express operating profit YoY |
Sample data:
Use Python to get the "performance letters of the total assets, net worth" and other "listed company Performance Express" data