Find an API

Search public APIs with auth details & Postman guides

← All APIs

Bureau of Labor Statistics Public Data API

bls.gov · Government

Government API Key Free & Open Government Insurance Financial Services Labor Employment Economics

Access BLS time-series data including employment, wages, CPI, unemployment, and Occupational Safety & Health statistics. The OIICS survey data (series prefix IIU) contains industry-level workers compensation injury and illness rates — the primary federal source for workers comp actuarial tables.

Authentication

API Key Free registration at bls.gov/developers gives an API key. Unregistered requests are allowed but rate-limited to 25/day vs 500/day with a key.

Parameter name: registrationkey (in query)

Sample Requests

GET Get CPI series (inflation)

Returns Consumer Price Index — All Urban Consumers, All Items. Series IDs found at bls.gov/help/hlpforma.htm.

https://api.bls.gov/publicAPI/v2/timeseries/data/CUUR0000SA0?registrationkey=YOUR_API_KEY

Hover any highlighted part to learn what it does

curl -X GET "https://api.bls.gov/publicAPI/v2/timeseries/data/CUUR0000SA0?registrationkey=YOUR_API_KEY"
import requests
params = {
    "registrationkey": "YOUR_API_KEY"
}
response = requests.get(
    "https://api.bls.gov/publicAPI/v2/timeseries/data/CUUR0000SA0",
    params=params,
)
print(response.json())
const url = new URL('https://api.bls.gov/publicAPI/v2/timeseries/data/CUUR0000SA0');
url.searchParams.set('registrationkey', 'YOUR_API_KEY');

const response = await fetch(url); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	baseURL, _ := url.Parse("https://api.bls.gov/publicAPI/v2/timeseries/data/CUUR0000SA0")
	q := baseURL.Query()
	q.Set("registrationkey", "YOUR_API_KEY")
	baseURL.RawQuery = q.Encode()
	targetURL := baseURL.String()
	req, _ := http.NewRequest("GET", targetURL, nil)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://api.bls.gov/publicAPI/v2/timeseries/data/CUUR0000SA0")
uri.query = URI.encode_www_form({
  "registrationkey" => "YOUR_API_KEY"
})

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Get.new(uri)

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://api.bls.gov/publicAPI/v2/timeseries/data/CUUR0000SA0?" . http_build_query([
    "registrationkey" => "YOUR_API_KEY"
]);
$opts = ["http" => [
    "method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
POST Get multiple series with date range (POST)

Fetch multiple BLS series in one call. Workers comp injury series start with IIU (e.g. IIU00_10000000 = all private industry injury/illness cases).

https://api.bls.gov/publicAPI/v2/timeseries/data

Hover any highlighted part to learn what it does

Headers — extra info sent with the request
Content-Type application/json
Request Body — data you're sending
{
  "endyear": "2024",
  "seriesid": [
    "IIU00_10000000",
    "CUUR0000SA0"
  ],
  "startyear": "2020",
  "registrationkey": "YOUR_API_KEY"
}
curl -X POST "https://api.bls.gov/publicAPI/v2/timeseries/data" \
  -H "Content-Type: application/json" \
  -H "Content-Type: application/json" \
  -d '{"endyear":"2024","seriesid":["IIU00_10000000","CUUR0000SA0"],"startyear":"2020","registrationkey":"YOUR_API_KEY"}'
import requests
headers = {
    "Content-Type": "application/json"
}
data = {
    "endyear": "2024",
    "seriesid": [
        "IIU00_10000000",
        "CUUR0000SA0"
    ],
    "startyear": "2020",
    "registrationkey": "YOUR_API_KEY"
}
response = requests.post(
    "https://api.bls.gov/publicAPI/v2/timeseries/data",
    headers=headers,
    json=data,
)
print(response.json())
const url = 'https://api.bls.gov/publicAPI/v2/timeseries/data';

const response = await fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
  "endyear": "2024",
  "seriesid": [
    "IIU00_10000000",
    "CUUR0000SA0"
  ],
  "startyear": "2020",
  "registrationkey": "YOUR_API_KEY"
}),
}); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
	"bytes"
	"encoding/json"
)

func main() {
	targetURL := "https://api.bls.gov/publicAPI/v2/timeseries/data"
	jsonData, _ := json.Marshal({"endyear":"2024","seriesid":["IIU00_10000000","CUUR0000SA0"],"startyear":"2020","registrationkey":"YOUR_API_KEY"})
	req, _ := http.NewRequest("POST", targetURL, bytes.NewBuffer(jsonData))
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("Content-Type", "application/json")

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://api.bls.gov/publicAPI/v2/timeseries/data")

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Post.new(uri)
req["Content-Type"] = "application/json"
req["Content-Type"] = "application/json"
req.body = "{\"endyear\":\"2024\",\"seriesid\":[\"IIU00_10000000\",\"CUUR0000SA0\"],\"startyear\":\"2020\",\"registrationkey\":\"YOUR_API_KEY\"}"

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://api.bls.gov/publicAPI/v2/timeseries/data";
$opts = ["http" => [
    "method" => "POST",
    "header" => implode("\r\n", [
        "Content-Type: application/json",
        "Content-Type: application/json"
    ]),
    "content" => json_encode({"endyear":"2024","seriesid":["IIU00_10000000","CUUR0000SA0"],"startyear":"2020","registrationkey":"YOUR_API_KEY"}),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));

Postman Setup Guide

Get Postman ↗
  1. Register free at https://data.bls.gov/registrationEngine/ to get an API key (500 req/day)
  2. Find series IDs at https://www.bls.gov/help/hlpforma.htm — workers comp series start with IIU
  3. For workers comp injury rates: series prefix IIU, e.g. IIU00_10000000 = all private industry
  4. For state-level workers comp data: series prefix IIU followed by state FIPS code
  5. In Postman, POST to https://api.bls.gov/publicAPI/v2/timeseries/data
  6. Body: { "seriesid": ["SERIES_ID"], "startyear": "2020", "endyear": "2024", "registrationkey": "YOUR_KEY" }
  7. Response includes data array with year, period, value — value is incidence rate per 100 FTE workers

What can you build with Bureau of Labor Statistics Public Data API?

Bureau of Labor Statistics Public Data API is a Government API. Developers commonly use government APIs for:

  • surfacing public datasets in citizen-facing apps
  • building transparency and civic engagement tools
  • accessing legislation, court records, and official data
  • powering research and journalism tools
  • creating compliance and regulatory monitoring dashboards

API Key authentication. You'll receive a key after signing up. Send it with every request — in a header or query parameter. Keep it out of client-side code and never commit it to version control. Bureau of Labor Statistics Public Data API is free to use, making it a low-risk choice to experiment with.

New to APIs? Read our beginner's guide · Learn about API keys · What is REST?

Open documentation ↗