# FRED Economic Wellbeing Data Directory This directory contains data files generated by the update.ts script. ## Files - **latest.json** - Raw JSON data from FRED API (all indicators with full observation history) - **latest.txt** - Transformed pipe-delimited format for Substrate (all observations) - **update.log** - Update script execution log (if present) ## Update Process Run the update script from the parent directory: ```bash # Set your FRED API key (get free key at https://fred.stlouisfed.org/docs/api/api_key.html) export FRED_API_KEY="your_api_key_here" # Run update script ./update.ts ``` ## Data Freshness Different indicators have different update frequencies: - **Weekly:** Financial Stress Index (STLFSI4), 30-Year Mortgage Rate (MORTGAGE30US) - **Monthly:** Consumer Sentiment (UMCSENT), Unemployment indicators, Personal Saving Rate (PSAVERT) - **Quarterly:** Debt Service Ratio (TDSP), Credit Card Delinquency (DRCCLACBS), Median Home Price (MSPUS) - **Annual:** GINI Income Inequality Index (SIPOVGINIUSA) Run weekly updates to capture high-frequency indicators; monthly updates sufficient for most indicators. ## Data Format ### Pipe-Delimited Format (latest.txt) ``` RECORD ID | SERIES ID | SERIES NAME | DATE | VALUE | FREQUENCY | DESCRIPTION DS-00004-TDSP-2023-Q1 | TDSP | Household Debt Service Ratio | 2023-01-01 | 9.69 | Quarterly | Household Debt Service Payments as % of Disposable Personal Income ``` ### JSON Format (latest.json) ```json [ { "seriesId": "TDSP", "seriesName": "Household Debt Service Ratio", "description": "Household Debt Service Payments as % of Disposable Personal Income", "frequency": "Quarterly", "observations": [ { "date": "2023-01-01", "value": "9.69", "realtime_start": "2023-06-09", "realtime_end": "2023-06-09" } ] } ] ``` ## Source Federal Reserve Economic Data (FRED) https://fred.stlouisfed.org/ API Documentation: https://fred.stlouisfed.org/docs/api/fred/