Access data via the Application Programming Interface
Understanding the BLS API
The Bureau of Labor Statistics (BLS) API provides free public access to a wealth of economic data. Here's a breakdown of what you need to know:
Key Features:
• | Two Versions: The API has two versions: |
o | Version 1 (Public): Requires no registration and is suitable for casual use. It has limitations on the number of queries and the amount of data you can retrieve. |
o | Version 2 (Registered): Requires a free registration and provides an API key. This version offers higher query limits, more data per request, and additional features like calculations and series catalogs. It is the recommended version for most applications. |
• | Data Available: You can access data from all BLS programs, including: |
o | Consumer Price Index (CPI): Measures inflation. |
o | Producer Price Index (PPI): Measures inflation from the perspective of producers. |
o | Employment and Unemployment Data: From the Current Population Survey (CPS). |
o | Wages and Compensation Data: From the National Compensation Survey. |
o | Productivity Data: And much more. |
• | Data Format: The API returns data primarily in JSON format, which is a standard for data interchange on the web. It can also return data in Excel format. |
• | Series IDs: To request specific data, you need to use a "series ID." This is a unique identifier for each time series. You can find these IDs using the data-finding tools on the BLS website. |
Getting Started:
2. | Find Series IDs: Use the tools on the BLS website to find the series IDs for the data you're interested in. |
3. | Make API Requests: Use your preferred programming language to send HTTP requests to the BLS API endpoints. |