Access labour market statistics from the US Bureau of Labor Statistics including employment, unemployment, wages, inflation (CPI), and productivity data. Widely used in economic data pipelines for trend analysis, time-series modelling, and government data ingestion workflows.
Engineers use the BLS Public Data API v2 with `requests`, posting JSON series IDs to retrieve time-series data. The `blsapi` wrapper simplifies authentication. Results are parsed into pandas time-series indexed DataFrames for economic analysis.
BLS statistics ground AI economic analysis tools in official government data. RAG pipelines retrieve CPI and employment figures so LLM agents can answer 'What is the current US unemployment rate?' with authoritative, up-to-date data rather than outdated training knowledge.
# pip install requests pandas
import requests, pandas as pd
payload = {
"seriesid": ["LNS14000000"], # US unemployment rate
"startyear": "2020",
"endyear": "2024",
"registrationkey": "YOUR_API_KEY"
}
resp = requests.post("https://api.bls.gov/publicAPI/v2/timeseries/data/", json=payload)
series = resp.json()["Results"]["series"][0]["data"]
df = pd.DataFrame(series)[["year", "period", "value"]]
print(df.head(10))Official dataset source
More datasets used by Python data engineers.
Access US macroeconomic statistics from the Bureau of Economic Analysis, including GDP, personal income, consumer spending, and international trade data. Ideal for building economic indicator pipelines, loading national accounts data into warehouses, and time-series analysis in Python.
Access real-time company registration data, director information, filing history, and financial statements from the UK Companies House streaming API. Used in data engineering for corporate intelligence pipelines, KYC/AML workflows, entity resolution, and building business analytics systems in Python.
The Swedish government monopoly liquor store API providing product catalogues, store locations, inventory, and pricing data. Useful for practising structured API ingestion, building retail analytics pipelines, and learning how to work with government-published commercial datasets in Python.