How to Pull BLS Labor Statistics from Claude Code
Claude Code is great at reasoning about data, but it doesn’t have live access to government statistics. If you’re building anything that needs current CPI numbers, unemployment rates, or payroll figures, you need real data from the Bureau of Labor Statistics. AgentPatch’s BLS Data tool gives Claude Code direct access to BLS time series data without you leaving the terminal.
Why This Matters
The Bureau of Labor Statistics publishes some of the most important economic indicators in the US: the Consumer Price Index, unemployment rates, nonfarm payrolls, average wages. These numbers drive policy decisions, financial models, and business planning. But getting the data programmatically means knowing the right series IDs, dealing with the BLS API directly, and parsing a response format that isn’t exactly intuitive.
With the BLS Data tool available, Claude Code can pull time series data by series ID, specify date ranges, and even include period-over-period calculations. You ask for unemployment data and it comes back structured — year, period, value, and optional net/percent changes. No API key management, no response parsing on your end.
Setup
Install the AgentPatch CLI (zero dependencies, Python 3.10+):
pip install agentpatch
Set your API key:
export AGENTPATCH_API_KEY=your_api_key
Then use it:
ap search "web search"
ap run agentpatch google-search --input '{"query": "test"}'
Get your API key from the AgentPatch dashboard.
Run this command to add AgentPatch as an MCP server:
claude mcp add -s user --transport http agentpatch https://agentpatch.ai/mcp \
--header "Authorization: Bearer YOUR_API_KEY"
Replace YOUR_API_KEY with your actual key from the AgentPatch dashboard. Claude Code discovers all AgentPatch tools automatically.
Example
You’re working on a pricing model and need to check recent CPI trends. You ask Claude Code:
“Pull the last two years of CPI-U data with month-over-month and year-over-year percent changes.”
Claude Code calls the BLS Data tool directly:
Fetching BLS series CUUR0000SA0 for 2024-2026 with calculations enabled...
Here's the CPI-U trend:
Dec 2025: 319.082 (+0.1% MoM, +2.6% YoY)
Nov 2025: 318.782 (+0.2% MoM, +2.7% YoY)
Oct 2025: 318.150 (+0.1% MoM, +2.5% YoY)
...
Inflation has been running around 2.5-2.7% year-over-year for the last several
months, with small monthly increases. Want me to update the inflation assumption
in the pricing model to 2.6%?
Claude Code pulled real BLS data, summarized the trend, and connected it back to the task at hand. You can also query up to 5 series at once — useful for comparing CPI against wages, or unemployment against payrolls, in a single call.
Each call costs 50 credits ($0.005), so running a few comparisons during a session is negligible.
Wrapping Up
AgentPatch gives Claude Code access to BLS time series data — CPI, unemployment, payrolls, wages, and thousands of other series the Bureau publishes. The same connection also unlocks every other tool on the marketplace, from FRED economic data to web search to email. Explore what’s available at agentpatch.ai.