Gov APIstatssa.gov.za ↗
Access South African CPI, PPI, retail trade sales, manufacturing production index, and employment time series from Statistics South Africa via a single API.
What is the Gov API?
The Stats SA API exposes 6 endpoints covering South Africa's key national economic indicators, sourced from Statistics South Africa (statssa.gov.za). You can retrieve full monthly time series for headline CPI, core CPI, PPI, retail trade sales, and the manufacturing production index, plus a quarterly employment series with sector-level breakdowns. Each endpoint returns a structured time series with observation dates, index or value readings, and year-over-year or quarter-over-quarter percentage changes.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/a0a792cf-df9f-4db2-b5cb-0ad696f26e57/get_retail_sales' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace statssa-gov-za-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Stats SA Economic Indicators SDK — bounded, re-runnable; every call capped."""
from parse_apis.Stats_SA_Economic_Indicators_API import StatsSA, ParseError
client = StatsSA()
# Fetch headline CPI observations (all items, all urban areas)
for obs in client.headline_cpis.fetch(limit=3):
print(obs.date, obs.value, obs.pct_change_yoy)
# Fetch core CPI observations (excl food & NAB, fuel and energy)
for obs in client.core_cpis.fetch(limit=3):
print(obs.date, obs.value, obs.pct_change_yoy)
# Fetch retail trade sales observations (monthly, constant 2019 prices)
for obs in client.retail_saleses.fetch(limit=3):
print(obs.date, obs.value, obs.pct_change_yoy)
# Fetch manufacturing production index observations
for obs in client.industrial_productions.fetch(limit=3):
print(obs.date, obs.value, obs.pct_change_yoy)
# Fetch quarterly employment data with sector breakdown
for obs in client.employments.fetch(limit=3):
print(obs.date, obs.total_employed, obs.pct_change_qoq)
for sector, count in list(obs.sector_breakdown.items())[:2]:
print(f" {sector}: {count}")
# Typed error handling around a fetch call
try:
latest = client.producer_price_indexes.fetch(limit=1).first()
if latest:
print(latest.date, latest.value, latest.series_code)
except ParseError as e:
print(f"error: {e.code}")
print("exercised: headline_cpis.fetch / core_cpis.fetch / retail_saleses.fetch / industrial_productions.fetch / employments.fetch / producer_price_indexes.fetch")
Full monthly time series of South African retail trade sales at constant 2019 prices (actual values). Covers total retail from January 2002, ordered newest-first. Each observation carries the value in R Million and year-over-year percentage change. The series code is con_act (constant prices, actual estimates) from publication P6242.1.
No input parameters required.
{
"type": "object",
"fields": {
"unit": "Unit of measurement (R Million)",
"count": "Total number of observations",
"title": "Series title",
"end_date": "Most recent observation date (YYYY-MM)",
"frequency": "Data frequency (Monthly)",
"start_date": "Earliest observation date (YYYY-MM)",
"price_basis": "Price basis description",
"publication": "Stats SA publication code (P6242.1)",
"series_code": "Internal series identifier",
"time_series": "Array of monthly observations ordered newest-first, each with date, value, pct_change_yoy, and series_code"
},
"sample": {
"data": {
"unit": "R Million",
"count": 292,
"title": "Retail trade sales",
"end_date": "2026-04",
"frequency": "Monthly",
"start_date": "2002-01",
"price_basis": "Constant 2019 prices",
"publication": "P6242.1",
"series_code": "con_act",
"time_series": [
{
"date": "2026-04",
"value": 96764,
"series_code": "con_act",
"pct_change_yoy": 1.27
},
{
"date": "2026-03",
"value": 99422,
"series_code": "con_act",
"pct_change_yoy": 2.49
}
]
},
"status": "success"
}
}About the Gov API
What the API covers
Six endpoints map directly to Stats SA's flagship statistical releases. get_headline_cpi and get_core_cpi both return monthly CPI series (base Dec 2024=100) from January 2008 onward, covering all urban areas. Headline CPI uses all items; core CPI excludes food and non-alcoholic beverages, fuel, and energy. get_ppi returns the Producer Price Index for final manufactured goods (base Dec 2023=100) from January 2012. get_retail_sales returns total retail trade sales at constant 2019 prices in R Million from January 2002. get_industrial_production returns the manufacturing production index (base 2019=100) from January 1998. get_employment returns quarterly formal non-agricultural employment totals from Q3 2009, with a sector breakdown per observation.
Response shape
Every endpoint returns a metadata envelope — title, series_code, publication, frequency, unit, start_date, end_date, and count — alongside a time_series array ordered newest-first. Monthly endpoints carry date (YYYY-MM), value, pct_change_yoy, and series_code per entry. The quarterly get_employment endpoint uses date in YYYY-QN format, total_employed (number of employees), pct_change_qoq, and a sector_breakdown object per observation. Publication codes (e.g. P0141 for CPI, P3041.2 for manufacturing, P0277 for employment) match Stats SA's official release identifiers.
Coverage notes
All series start at the earliest available observation in the respective Stats SA database and extend to the most recent published figure. None of the endpoints require input parameters — each call returns the complete available history for that series. Series codes such as MPI3, CPS0000, and con_act correspond to Stats SA's own internal identifiers and are included in both the envelope and individual observations to support downstream data lineage tracking.
The Gov API is a managed, monitored endpoint for statssa.gov.za — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when statssa.gov.za changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official statssa.gov.za API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Charting South Africa's inflation trend by plotting
pct_change_yoyfromget_headline_cpiandget_core_cpiside by side over time - Building a South African economic dashboard that displays the latest retail trade value in R Million from
get_retail_sales - Monitoring manufacturing sector health by tracking the production index and year-over-year changes from
get_industrial_production - Comparing upstream and downstream price pressures by overlaying PPI from
get_ppiwith headline CPI fromget_headline_cpi - Tracking formal employment trends and sector composition using the quarterly
total_employedandsector_breakdownfields fromget_employment - Feeding South African macro indicators into econometric models using the full back-history available in each time series
- Alerting systems that flag when the latest
pct_change_yoyin any series crosses a defined threshold
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Statistics South Africa have an official developer API?+
What does `get_employment` return beyond a headline employment total?+
total_employed (number of employees in formal non-agricultural sectors), pct_change_qoq (quarter-over-quarter percentage change), and a sector_breakdown object that splits employment across industry sectors. The series starts from Q3 2009 and maps to Stats SA publication P0277.Does the API cover sub-categories of retail trade or CPI by expenditure group?+
get_retail_sales returns the aggregate total retail series, and the CPI endpoints cover all-items headline and a single core (ex-food, fuel, energy) series. Breakdowns by retail sub-sector or individual CPI expenditure group are not exposed. You can fork this API on Parse and revise it to add endpoints for specific sub-categories.How far back does the manufacturing production index go?+
get_industrial_production endpoint returns data from January 1998, making it the longest historical series in this API. The index uses base 2019=100 and corresponds to Stats SA publication P3041.2. The complete history is returned in a single call with no pagination parameters.