Skills › Scientific Agent Skills › database-lookup › bls.md
bls.md
235 lines · skills/database-lookup/references/bls.md at 5f2bc03
Most marks come from matching words in the file, so treat them as pointers.
Bureau of Labor Statistics (BLS) Public Data API
Raw lines 1 to 23## Base URL
5```
6https://api.bls.gov/publicAPI/v2
7```
9Version 1 (no key): `https://api.bls.gov/publicAPI/v1`
Base URL
https://api.bls.gov/publicAPI/v2Version 1 (no key): https://api.bls.gov/publicAPI/v1
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.
Key Endpoints
Raw lines 18 to 1920### 1. Get Series Data (POST -- primary method)
21```
22POST /timeseries/data/
23```
24Content-Type: `application/json`
26**Request body:**
27```json
28{
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
37}
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
}| Field | Required | V1 | V2 | Description |
|---|---|---|---|---|
| seriesid | Yes | Yes | Yes | Array of series IDs (max 25 v1 / 50 v2) |
| startyear | No | Yes | Yes | 4-digit start year |
| endyear | No | Yes | Yes | 4-digit end year |
| registrationkey | No | No | Yes | API key (required for v2 features) |
| catalog | No | No | Yes | true to include series metadata |
| calculations | No | No | Yes | true to include net/pct changes |
| annualaverage | No | No | Yes | true to include annual averages |
| aspects | No | No | Yes | true to include footnotes and aspects |
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=2024Raw lines 51 to 5960### 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_KEYRaw lines 60 to 70Common Series IDs
Raw lines 71 to 7273### 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 ID | Description |
|---|---|
| CUUR0000SA0 | CPI-U All Items, US City Avg, Not Seasonally Adj |
| CUSR0000SA0 | CPI-U All Items, US City Avg, Seasonally Adj |
| CUUR0000SAF1 | CPI-U Food, US City Avg |
| CUUR0000SETB01 | CPI-U Gasoline (all types) |
| CUUR0000SAH1 | CPI-U Shelter |
| CUUR0000SAM | CPI-U Medical Care |
CPI series ID structure: CU + U/S (unadj/adj) + R/S (revision) + area code + item code
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 ID | Description |
|---|---|
| LNS14000000 | Unemployment Rate (seasonally adjusted) |
| LNS11000000 | Civilian Labor Force Level |
| LNS12000000 | Employment Level |
| LNS13000000 | Unemployment Level |
| LNS14000006 | Unemployment Rate - Black or African American |
| LNS14000009 | Unemployment Rate - Hispanic or Latino |
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 ID | Description |
|---|---|
| CES0000000001 | Total Nonfarm Employment (seasonally adj) |
| CES0500000003 | Average Hourly Earnings, Total Private |
| CES0500000002 | Average Weekly Hours, Total Private |
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 ID | Description |
|---|---|
| WPSFD4 | PPI Final Demand |
| WPUFD49104 | PPI Final Demand less Foods & Energy |
108### Employment Cost Index (ECI)
109| Series ID | Description |
110|-----------------|---------------------------------------------------|
111| CIU1010000000000A | ECI Total Compensation, All Civilians |
Employment Cost Index (ECI)
| Series ID | Description |
|---|---|
| CIU1010000000000A | ECI Total Compensation, All Civilians |
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 Pattern | Description |
|---|---|
| OEUM003342000000011-0000 | Example: 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 119Runs 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:
| Prefix | Survey |
|---|---|
| CU | Consumer Price Index |
| LN | Current Population Survey (Labor Force) |
| CE | Current Employment Statistics |
| WP | Producer Price Index |
| CI | Employment Cost Index / National Compensation |
| OE | Occupational Employment & Wage Statistics |
| LA | Local Area Unemployment Statistics |
| SM | State and Metro Area Employment (CES) |
| JT | Job Openings and Labor Turnover (JOLTS) |
Response Format
Raw lines 136 to 137138### Standard response
139```json
140{
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 }
192}
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 194195### 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 stringperiod:M01-M12(monthly),Q01-Q05(quarterly),A01(annual),S01-S03(semi-annual)periodName: Human-readable period namevalue: String (convert to float for calculations)latest:"true"on the most recent observation onlycalculations: Only present whencalculations: truein request (V2). Containsnet_changesandpct_changesover 1, 3, 6, 12 month spans.footnotes: Array of footnote objects
204### Error response
205```json
206{
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 }
213}
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 215216## 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
| Feature | V1 (no key) | V2 (with key) |
|---|---|---|
| Daily query limit | 25 requests | 500 requests |
| Series per query | 25 | 50 |
| Years per query | 10 | 20 |
| Catalog data | No | Yes |
| Calculations | No | Yes |
| Annual averages | No | Yes |
| Net/pct changes | No | Yes |
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
M13represents the annual average (only present whenannualaverage: true). - All
valuefields 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
calculationsfeature 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.
Runs code bin/srgate :234