FRED and BLS Economic Indicator Data for Developers
Developers often need access to economic indicators like CPI, NFP, GDP, PCE, and unemployment rates for their macro trading or analytics apps. These data points are crucial for understanding market trends and making informed decisions.
Problem: Accessing the Latest Economic Indicators in Python
Let's say you want to get the latest Consumer Price Index (CPI), Non-Farm Payrolls (NFP), GDP, Personal Consumption Expenditures (PCE) index, and Unemployment Rate data using Python. Fetching this information directly from FRED or BLS can be a bit cumbersome.
Here is an example of how you might use the requests library to fetch the NFP data:
import requests
def get_nfp_data():
url = "https://api.verilexdata.com/api/v1/econ/stats?indicator=NFP"
response = requests.get(url)
if response.status_code == 200:
return response.json()
else:
print(f"Failed to retrieve data: {response.text}")
return None
nfp_data = get_nfp_data()
if nfp_data:
print(nfp_data)
Endpoint for Economic Indicator Data
For accessing the latest economic indicators like CPI, NFP, GDP, PCE, and unemployment
Top comments (0)