Gov APIstatssa.gov.za ↗
Access South African retail trade sales, manufacturing production index, core CPI, and quarterly employment data from Statistics South Africa via a single API.
What is the Gov API?
The Stats SA API exposes four endpoints covering South Africa's key macroeconomic time series published by Statistics South Africa. The get_retail_sales endpoint alone returns monthly observations from January 2002, each with a value in R Million and a year-over-year percentage change. All four endpoints deliver full historical time series with consistent metadata fields including start_date, end_date, frequency, publication, and series_code.
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 recent 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 Producer Price Index observations (final manufactured goods)
for obs in client.producer_price_indexes.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 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: retail_saleses.fetch / industrial_productions.fetch / producer_price_indexes.fetch / core_cpis.fetch / employments.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
Four endpoints map directly to Stats SA statistical releases: retail trade sales (P6242.1), manufacturing production index (P3041.2), quarterly employment statistics (P0277), and core CPI (P0141). Each response includes a time_series array ordered newest-first, alongside metadata fields such as title, unit, count, start_date, and end_date. No query parameters are needed — each endpoint returns the full available history for its series.
Endpoint Details
get_retail_sales returns monthly total retail trade sales at constant 2019 prices, expressed in R Million, from January 2002. Each observation includes value and pct_change_yoy. get_industrial_production returns the manufacturing production index (base 2019=100) from January 1998, also with value and pct_change_yoy per month. get_employment delivers quarterly formal non-agricultural employment from Q3 2009; each observation adds a sector_breakdown object alongside total_employed and pct_change_qoq. get_core_cpi returns headline CPI excluding food, non-alcoholic beverages, fuel, and energy, indexed to December 2024=100, from January 2008.
Data Shape and Dates
Date formatting is consistent across endpoints: monthly series use YYYY-MM and the quarterly employment series uses YYYY-QN notation (e.g. 2024-Q1). The publication field on each response echoes the official Stats SA release code, making it straightforward to cross-reference the underlying statistical release. The series_code field appears both in the top-level response object and inside each observation in the time_series array.
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 African retail trade sales trends over time using the
valueandpct_change_yoyfields fromget_retail_sales. - Tracking manufacturing output cycles by monitoring the production index returned by
get_industrial_productionagainst its 2019=100 baseline. - Building a South African economic dashboard that combines CPI, employment, retail, and industrial production in one data pipeline.
- Calculating real GDP proxies or coincident indicators by combining
get_retail_salesandget_industrial_productionmonthly series. - Monitoring formal sector employment trends quarter-over-quarter using
total_employedandpct_change_qoqfromget_employment. - Analyzing sector-level employment shifts using the
sector_breakdownobject returned in eachget_employmentobservation. - Tracking underlying inflation pressure in South Africa using the core CPI series from
get_core_cpi, which strips out food and energy.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Statistics South Africa provide an official developer API?+
What does the `get_employment` endpoint return beyond a headline employment number?+
total_employed (number of employees in formal non-agricultural sectors), pct_change_qoq (quarter-over-quarter percentage change), date in YYYY-QN format, series_code, and a sector_breakdown object that disaggregates employment across industries within that quarter. Coverage starts at Q3 2009.Does the API cover provincial or sub-national breakdowns of retail sales or CPI?+
How fresh is the data, and how often is it updated?+
end_date field in each response tells you the most recent observation date, so you can check data currency without fetching the full time_series array.Can I retrieve a subset of the time series, for example only the last 12 months?+
time_series array is ordered newest-first, so you can slice the first N observations client-side. You can fork this API on Parse and revise it to add date-filter parameters if you need server-side range queries.