01 GDP Analysis

Interfaces implemented in this chapter are listed below; uncovered indicators are noted under “To be added” at the end.

Three-industry breakdown

Interface: macro_china_gdp

Source URL: http://data.eastmoney.com/cjsj/gdp.html

Description: Gross domestic product and value added of the primary, secondary, and tertiary industries (absolute values and YoY), for three-industry breakdown; data from East Money

Limits: Returns all historical data in a single call

Input

Name Type Description
- - -

Output

Name Type Description
Quarter object -
GDP-Absolute float64 Unit: 100 million yuan
GDP-YoY float64 Unit: %
Primary industry-Absolute float64 Unit: 100 million yuan
Primary industry-YoY float64 Unit: %
Secondary industry-Absolute float64 Unit: 100 million yuan
Secondary industry-YoY float64 Unit: %
Tertiary industry-Absolute float64 Unit: 100 million yuan
Tertiary industry-YoY float64 Unit: %

Example

import meshare as ms

macro_china_gdp_df = ms.macro_china_gdp()
print(macro_china_gdp_df)

Sample data

   Quarter  GDP-Absolute  GDP-YoY  ...  Secondary industry-YoY  Tertiary industry-Absolute  Tertiary industry-YoY
0   2021-03-01    249310.0         18.3  ...       24.4  145355.0       15.6
1   2020-12-01   1015986.2          2.3  ...        2.6  553976.8        2.1
2   2020-09-01    719688.4          0.7  ...        0.9  401249.1        0.4
3   2020-06-01    454712.1         -1.6  ...       -1.9  258427.4       -1.6
4   2020-03-01    205727.0         -6.8  ...       -9.6  123008.5       -5.2
..         ...         ...          ...  ...        ...       ...        ...
56  2007-03-01     57159.3         13.8  ...       14.8   27703.2       14.1
57  2006-12-01    219438.5         12.7  ...       13.5   91762.2       14.1
58  2006-09-01    155816.8         12.8  ...       13.7   67187.0       13.7
59  2006-06-01     99752.2         13.1  ...       14.2   44996.5       13.6
60  2006-03-01     47078.9         12.5  ...       13.1   22648.0       13.1

Three-demand breakdown

Interface: macro_china_gdp_demand

Source URL: https://data.stats.gov.cn/dg/website/page.html#/pc/national/quarterData

Description: NBS quarterly series “Contribution of the three demands to GDP growth”. Returns contribution rates of final consumption expenditure, gross capital formation, and net exports of goods and services to GDP growth (current-quarter and cumulative values, unit %). Note: this interface returns contribution rates, not expenditure-approach absolute amounts.

Limits: Returns all quarterly data within the specified time range in a single call

Input

Name Type Description
start str Start quarter, format YYYYMM; MM is 01/02/03/04 for Q1–Q4; default 199201
end str End quarter, same format as start; default 203604

Output

Name Type Description
Quarter object e.g. 2025Q4
Quarter name object e.g. 2025 Q4
Final consumption contribution-Current float64 Unit: %
Final consumption contribution-Cumulative float64 Unit: %
Gross capital formation contribution-Current float64 Unit: %
Gross capital formation contribution-Cumulative float64 Unit: %
Net exports contribution-Current float64 Unit: %
Net exports contribution-Cumulative float64 Unit: %

Example

import meshare as ms

df = ms.macro_china_gdp_demand()
print(df)

# Specified range
df = ms.macro_china_gdp_demand(start="201001", end="202504")
print(df.tail())