Skill Tracer
Skills › Scientific Agent Skills › database-lookup › bls.md

bls.md

235 lines · skills/database-lookup/references/bls.md at 5f2bc03

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# Bureau of Labor Statistics (BLS) Public Data API
2

Bureau of Labor Statistics (BLS) Public Data API

Raw lines 1 to 2
3## Base URL
4
5```
6https://api.bls.gov/publicAPI/v2
7```
8
9Version 1 (no key): `https://api.bls.gov/publicAPI/v1`

Base URL

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

Version 1 (no key): https://api.bls.gov/publicAPI/v1

Raw lines 3 to 10
11## Authentication
13**API key optional but strongly recommended.** Register at https://data.bls.gov/registrationEngine/
15- **V1 (no key):** Limited to 25 requests/day, 10-year date range, 25 series per query.
16- **V2 (with key):** 500 requests/day, 20-year date range, 50 series per query, plus catalog data and calculations.

Authentication

API key optional but strongly recommended. Register at https://data.bls.gov/registrationEngine/

  • V1 (no key): Limited to 25 requests/day, 10-year date range, 25 series per query.
  • V2 (with key): 500 requests/day, 20-year date range, 50 series per query, plus catalog data and calculations.
Raw lines 11 to 17
18## Key Endpoints

Key Endpoints

Raw lines 18 to 19
20### 1. Get Series Data (POST -- primary method)
21```
22POST /timeseries/data/
23```
24Content-Type: `application/json`
26**Request body:**
27```json
29 "seriesid": ["CUUR0000SA0", "LNS14000000"],
30 "startyear": "2020",
31 "endyear": "2024",
32 "registrationkey": "YOUR_KEY",
33 "catalog": true,
34 "calculations": true,
35 "annualaverage": true,
36 "aspects": true
38```
40| Field | Required | V1 | V2 | Description |
41|------------------|----------|-----|-----|------------------------------------------------------|
42| seriesid | Yes | Yes | Yes | Array of series IDs (max 25 v1 / 50 v2) |
43| startyear | No | Yes | Yes | 4-digit start year |
44| endyear | No | Yes | Yes | 4-digit end year |
45| registrationkey | No | No | Yes | API key (required for v2 features) |
46| catalog | No | No | Yes | `true` to include series metadata |
47| calculations | No | No | Yes | `true` to include net/pct changes |
48| annualaverage | No | No | Yes | `true` to include annual averages |
49| aspects | No | No | Yes | `true` to include footnotes and aspects |

1. Get Series Data (POST -- primary method)

POST /timeseries/data/

Content-Type: application/json

Request body:

{
  "seriesid": ["CUUR0000SA0", "LNS14000000"],
  "startyear": "2020",
  "endyear": "2024",
  "registrationkey": "YOUR_KEY",
  "catalog": true,
  "calculations": true,
  "annualaverage": true,
  "aspects": true
}
FieldRequiredV1V2Description
seriesidYesYesYesArray of series IDs (max 25 v1 / 50 v2)
startyearNoYesYes4-digit start year
endyearNoYesYes4-digit end year
registrationkeyNoNoYesAPI key (required for v2 features)
catalogNoNoYestrue to include series metadata
calculationsNoNoYestrue to include net/pct changes
annualaverageNoNoYestrue to include annual averages
aspectsNoNoYestrue to include footnotes and aspects
Raw lines 20 to 50
51### 2. Get Single Series Data (GET -- convenience)
52```
53GET /timeseries/data/{seriesID}
54```
55Example:
56```
57https://api.bls.gov/publicAPI/v2/timeseries/data/CUUR0000SA0?registrationkey=YOUR_KEY&startyear=2022&endyear=2024
58```

2. Get Single Series Data (GET -- convenience)

GET /timeseries/data/{seriesID}

Example:

https://api.bls.gov/publicAPI/v2/timeseries/data/CUUR0000SA0?registrationkey=YOUR_KEY&startyear=2022&endyear=2024
Raw lines 51 to 59
60### 3. Latest Data (GET -- no date range)
61```
62GET /timeseries/data/{seriesID}
63```
64Without startyear/endyear, returns the most recent 3 years.
66Example:
67```
68https://api.bls.gov/publicAPI/v2/timeseries/data/LNS14000000?registrationkey=YOUR_KEY
69```

3. Latest Data (GET -- no date range)

GET /timeseries/data/{seriesID}

Without startyear/endyear, returns the most recent 3 years.

Example:

https://api.bls.gov/publicAPI/v2/timeseries/data/LNS14000000?registrationkey=YOUR_KEY
Raw lines 60 to 70
71## Common Series IDs

Common Series IDs

Raw lines 71 to 72
73### Consumer Price Index (CPI)
74| Series ID | Description |
75|-----------------|---------------------------------------------------|
76| CUUR0000SA0 | CPI-U All Items, US City Avg, Not Seasonally Adj |
77| CUSR0000SA0 | CPI-U All Items, US City Avg, Seasonally Adj |
78| CUUR0000SAF1 | CPI-U Food, US City Avg |
79| CUUR0000SETB01 | CPI-U Gasoline (all types) |
80| CUUR0000SAH1 | CPI-U Shelter |
81| CUUR0000SAM | CPI-U Medical Care |
83CPI series ID structure: `CU` + `U/S` (unadj/adj) + `R/S` (revision) + area code + item code

Consumer Price Index (CPI)

Series IDDescription
CUUR0000SA0CPI-U All Items, US City Avg, Not Seasonally Adj
CUSR0000SA0CPI-U All Items, US City Avg, Seasonally Adj
CUUR0000SAF1CPI-U Food, US City Avg
CUUR0000SETB01CPI-U Gasoline (all types)
CUUR0000SAH1CPI-U Shelter
CUUR0000SAMCPI-U Medical Care

CPI series ID structure: CU + U/S (unadj/adj) + R/S (revision) + area code + item code

Raw lines 73 to 84
85### Employment / Unemployment (Current Population Survey)
86| Series ID | Description |
87|-----------------|---------------------------------------------------|
88| LNS14000000 | Unemployment Rate (seasonally adjusted) |
89| LNS11000000 | Civilian Labor Force Level |
90| LNS12000000 | Employment Level |
91| LNS13000000 | Unemployment Level |
92| LNS14000006 | Unemployment Rate - Black or African American |
93| LNS14000009 | Unemployment Rate - Hispanic or Latino |

Employment / Unemployment (Current Population Survey)

Series IDDescription
LNS14000000Unemployment Rate (seasonally adjusted)
LNS11000000Civilian Labor Force Level
LNS12000000Employment Level
LNS13000000Unemployment Level
LNS14000006Unemployment Rate - Black or African American
LNS14000009Unemployment Rate - Hispanic or Latino
Raw lines 85 to 94
95### Employment (Current Employment Statistics / Nonfarm Payrolls)
96| Series ID | Description |
97|-----------------|---------------------------------------------------|
98| CES0000000001 | Total Nonfarm Employment (seasonally adj) |
99| CES0500000003 | Average Hourly Earnings, Total Private |
100| CES0500000002 | Average Weekly Hours, Total Private |

Employment (Current Employment Statistics / Nonfarm Payrolls)

Series IDDescription
CES0000000001Total Nonfarm Employment (seasonally adj)
CES0500000003Average Hourly Earnings, Total Private
CES0500000002Average Weekly Hours, Total Private
Raw lines 95 to 101
102### Producer Price Index (PPI)
103| Series ID | Description |
104|-----------------|---------------------------------------------------|
105| WPSFD4 | PPI Final Demand |
106| WPUFD49104 | PPI Final Demand less Foods & Energy |

Producer Price Index (PPI)

Series IDDescription
WPSFD4PPI Final Demand
WPUFD49104PPI Final Demand less Foods & Energy
Raw lines 102 to 107
108### Employment Cost Index (ECI)
109| Series ID | Description |
110|-----------------|---------------------------------------------------|
111| CIU1010000000000A | ECI Total Compensation, All Civilians |

Employment Cost Index (ECI)

Series IDDescription
CIU1010000000000AECI Total Compensation, All Civilians
Raw lines 108 to 112
113### Occupational Employment & Wage Statistics (OEWS)
114| Series ID Pattern | Description |
115|-------------------|-------------------------------------------------|
116| OEUM003342000000011-0000 | Example: specific occupation/area combo |
118OEWS series IDs are complex. Use the BLS Series ID finder: https://data.bls.gov/cgi-bin/srgate

Occupational Employment & Wage Statistics (OEWS)

Series ID PatternDescription
OEUM003342000000011-0000Example: specific occupation/area combo

OEWS series IDs are complex. Use the BLS Series ID finder: https://data.bls.gov/cgi-bin/srgate

Raw lines 113 to 119
Runs code bin/srgate :118
120## Series ID Structure
122BLS series IDs encode survey, seasonal adjustment, area, industry, and item information. Key survey prefixes:
124| Prefix | Survey |
125|--------|------------------------------------------------|
126| CU | Consumer Price Index |
127| LN | Current Population Survey (Labor Force) |
128| CE | Current Employment Statistics |
129| WP | Producer Price Index |
130| CI | Employment Cost Index / National Compensation |
131| OE | Occupational Employment & Wage Statistics |
132| LA | Local Area Unemployment Statistics |
133| SM | State and Metro Area Employment (CES) |
134| JT | Job Openings and Labor Turnover (JOLTS) |

Series ID Structure

BLS series IDs encode survey, seasonal adjustment, area, industry, and item information. Key survey prefixes:

PrefixSurvey
CUConsumer Price Index
LNCurrent Population Survey (Labor Force)
CECurrent Employment Statistics
WPProducer Price Index
CIEmployment Cost Index / National Compensation
OEOccupational Employment & Wage Statistics
LALocal Area Unemployment Statistics
SMState and Metro Area Employment (CES)
JTJob Openings and Labor Turnover (JOLTS)
Raw lines 120 to 135
136## Response Format

Response Format

Raw lines 136 to 137
138### Standard response
139```json
141 "status": "REQUEST_SUCCEEDED",
142 "responseTime": 85,
143 "message": [],
144 "Results": {
145 "series": [
146 {
147 "seriesID": "CUUR0000SA0",
148 "catalog": {
149 "series_title": "All items in U.S. city average, all urban consumers, not seasonally adjusted",
150 "series_id": "CUUR0000SA0",
151 "seasonality": "Not Seasonally Adjusted",
152 "survey_name": "Consumer Price Index - All Urban Consumers",
153 "survey_abbreviation": "CU",
154 "measure_data_type": "All items",
155 "area": "U.S. city average",
156 "item": "All items"
157 },
158 "data": [
159 {
160 "year": "2024",
161 "period": "M01",
162 "periodName": "January",
163 "latest": "true",
164 "value": "308.417",
165 "footnotes": [{}],
166 "calculations": {
167 "net_changes": {
168 "1": "0.5",
169 "3": "1.2",
170 "6": "2.1",
171 "12": "3.1"
172 },
173 "pct_changes": {
174 "1": "0.2",
175 "3": "0.4",
176 "6": "0.7",
177 "12": "3.1"
178 }
179 }
180 },
181 {
182 "year": "2023",
183 "period": "M12",
184 "periodName": "December",
185 "value": "306.746",
186 "footnotes": [{}]
187 }
188 ]
189 }
190 ]
191 }
193```

Standard response

{
  "status": "REQUEST_SUCCEEDED",
  "responseTime": 85,
  "message": [],
  "Results": {
    "series": [
      {
        "seriesID": "CUUR0000SA0",
        "catalog": {
          "series_title": "All items in U.S. city average, all urban consumers, not seasonally adjusted",
          "series_id": "CUUR0000SA0",
          "seasonality": "Not Seasonally Adjusted",
          "survey_name": "Consumer Price Index - All Urban Consumers",
          "survey_abbreviation": "CU",
          "measure_data_type": "All items",
          "area": "U.S. city average",
          "item": "All items"
        },
        "data": [
          {
            "year": "2024",
            "period": "M01",
            "periodName": "January",
            "latest": "true",
            "value": "308.417",
            "footnotes": [{}],
            "calculations": {
              "net_changes": {
                "1": "0.5",
                "3": "1.2",
                "6": "2.1",
                "12": "3.1"
              },
              "pct_changes": {
                "1": "0.2",
                "3": "0.4",
                "6": "0.7",
                "12": "3.1"
              }
            }
          },
          {
            "year": "2023",
            "period": "M12",
            "periodName": "December",
            "value": "306.746",
            "footnotes": [{}]
          }
        ]
      }
    ]
  }
}
Raw lines 138 to 194
195### Key fields in data objects
196- `year`: 4-digit year string
197- `period`: `M01`-`M12` (monthly), `Q01`-`Q05` (quarterly), `A01` (annual), `S01`-`S03` (semi-annual)
198- `periodName`: Human-readable period name
199- `value`: String (convert to float for calculations)
200- `latest`: `"true"` on the most recent observation only
201- `calculations`: Only present when `calculations: true` in request (V2). Contains `net_changes` and `pct_changes` over 1, 3, 6, 12 month spans.
202- `footnotes`: Array of footnote objects

Key fields in data objects

  • year: 4-digit year string
  • period: M01-M12 (monthly), Q01-Q05 (quarterly), A01 (annual), S01-S03 (semi-annual)
  • periodName: Human-readable period name
  • value: String (convert to float for calculations)
  • latest: "true" on the most recent observation only
  • calculations: Only present when calculations: true in request (V2). Contains net_changes and pct_changes over 1, 3, 6, 12 month spans.
  • footnotes: Array of footnote objects
Raw lines 195 to 203
204### Error response
205```json
207 "status": "REQUEST_NOT_PROCESSED",
208 "responseTime": 10,
209 "message": ["No data available for the given series and date range."],
210 "Results": {
211 "series": []
212 }
214```

Error response

{
  "status": "REQUEST_NOT_PROCESSED",
  "responseTime": 10,
  "message": ["No data available for the given series and date range."],
  "Results": {
    "series": []
  }
}
Raw lines 204 to 215
216## Rate Limits
218| Feature | V1 (no key) | V2 (with key) |
219|---------------------|-----------------|------------------|
220| Daily query limit | 25 requests | 500 requests |
221| Series per query | 25 | 50 |
222| Years per query | 10 | 20 |
223| Catalog data | No | Yes |
224| Calculations | No | Yes |
225| Annual averages | No | Yes |
226| Net/pct changes | No | Yes |

Rate Limits

FeatureV1 (no key)V2 (with key)
Daily query limit25 requests500 requests
Series per query2550
Years per query1020
Catalog dataNoYes
CalculationsNoYes
Annual averagesNoYes
Net/pct changesNoYes
Raw lines 216 to 227
228## Notes
230- BLS strongly prefers POST requests for data retrieval. The GET endpoint is a convenience wrapper.
231- Period `M13` represents the annual average (only present when `annualaverage: true`).
232- All `value` fields are strings. Missing data is typically omitted (the observation simply won't appear).
233- For CPI percent change (inflation rate), you can either calculate from raw index values or use the V2 `calculations` feature which provides pre-computed 12-month percent changes.
234- The BLS website has a Series ID finder tool for constructing IDs: https://data.bls.gov/cgi-bin/srgate
235- Bulk data is available for download at https://download.bls.gov/pub/time.series/ organized by survey prefix.

Notes

  • BLS strongly prefers POST requests for data retrieval. The GET endpoint is a convenience wrapper.
  • Period M13 represents the annual average (only present when annualaverage: true).
  • All value fields are strings. Missing data is typically omitted (the observation simply won't appear).
  • For CPI percent change (inflation rate), you can either calculate from raw index values or use the V2 calculations feature which provides pre-computed 12-month percent changes.
  • The BLS website has a Series ID finder tool for constructing IDs: https://data.bls.gov/cgi-bin/srgate
  • Bulk data is available for download at https://download.bls.gov/pub/time.series/ organized by survey prefix.
Raw lines 228 to 235
Runs code bin/srgate :234