data-analyst-mcp 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +262 -3
- package/dist/adapters/_acf_tidy.d.ts +18 -0
- package/dist/adapters/_acf_tidy.js +432 -0
- package/dist/adapters/_acf_tidy.js.map +1 -0
- package/dist/adapters/_actuaries_read.d.ts +38 -0
- package/dist/adapters/_actuaries_read.js +728 -0
- package/dist/adapters/_actuaries_read.js.map +1 -0
- package/dist/adapters/_census_micro.d.ts +70 -0
- package/dist/adapters/_census_micro.js +622 -0
- package/dist/adapters/_census_micro.js.map +1 -0
- package/dist/adapters/_census_util.d.ts +40 -0
- package/dist/adapters/_census_util.js +275 -0
- package/dist/adapters/_census_util.js.map +1 -0
- package/dist/adapters/_dol_states.d.ts +6 -0
- package/dist/adapters/_dol_states.js +58 -0
- package/dist/adapters/_dol_states.js.map +1 -0
- package/dist/adapters/_govinfo_entities.d.ts +4 -0
- package/dist/adapters/_govinfo_entities.js +6 -0
- package/dist/adapters/_govinfo_entities.js.map +1 -0
- package/dist/adapters/_govinfo_json.d.ts +13 -0
- package/dist/adapters/_govinfo_json.js +107 -0
- package/dist/adapters/_govinfo_json.js.map +1 -0
- package/dist/adapters/_govinfo_py.d.ts +22 -0
- package/dist/adapters/_govinfo_py.js +272 -0
- package/dist/adapters/_govinfo_py.js.map +1 -0
- package/dist/adapters/_govinfo_xml.d.ts +22 -0
- package/dist/adapters/_govinfo_xml.js +233 -0
- package/dist/adapters/_govinfo_xml.js.map +1 -0
- package/dist/adapters/_hud_excel.d.ts +2 -0
- package/dist/adapters/_hud_excel.js +166 -0
- package/dist/adapters/_hud_excel.js.map +1 -0
- package/dist/adapters/_omb_grid.d.ts +17 -0
- package/dist/adapters/_omb_grid.js +132 -0
- package/dist/adapters/_omb_grid.js.map +1 -0
- package/dist/adapters/_omb_util.d.ts +40 -0
- package/dist/adapters/_omb_util.js +192 -0
- package/dist/adapters/_omb_util.js.map +1 -0
- package/dist/adapters/_usaspending_state.d.ts +6 -0
- package/dist/adapters/_usaspending_state.js +54 -0
- package/dist/adapters/_usaspending_state.js.map +1 -0
- package/dist/adapters/_usda-fna_book.d.ts +59 -0
- package/dist/adapters/_usda-fna_book.js +869 -0
- package/dist/adapters/_usda-fna_book.js.map +1 -0
- package/dist/adapters/_usda-fna_pdf.d.ts +20 -0
- package/dist/adapters/_usda-fna_pdf.js +361 -0
- package/dist/adapters/_usda-fna_pdf.js.map +1 -0
- package/dist/adapters/_usda-outlook_read.d.ts +70 -0
- package/dist/adapters/_usda-outlook_read.js +362 -0
- package/dist/adapters/_usda-outlook_read.js.map +1 -0
- package/dist/adapters/acf.d.ts +3 -0
- package/dist/adapters/acf.js +187 -0
- package/dist/adapters/acf.js.map +1 -0
- package/dist/adapters/actuaries.d.ts +3 -0
- package/dist/adapters/actuaries.js +293 -0
- package/dist/adapters/actuaries.js.map +1 -0
- package/dist/adapters/bts.d.ts +3 -0
- package/dist/adapters/bts.js +26 -0
- package/dist/adapters/bts.js.map +1 -0
- package/dist/adapters/census-geocoder.d.ts +10 -0
- package/dist/adapters/census-geocoder.js +47 -0
- package/dist/adapters/census-geocoder.js.map +1 -0
- package/dist/adapters/census.d.ts +17 -0
- package/dist/adapters/census.js +983 -0
- package/dist/adapters/census.js.map +1 -0
- package/dist/adapters/cfpb.d.ts +7 -0
- package/dist/adapters/cfpb.js +348 -0
- package/dist/adapters/cfpb.js.map +1 -0
- package/dist/adapters/clinical-trials.d.ts +3 -0
- package/dist/adapters/clinical-trials.js +135 -0
- package/dist/adapters/clinical-trials.js.map +1 -0
- package/dist/adapters/cms.d.ts +3 -0
- package/dist/adapters/cms.js +292 -0
- package/dist/adapters/cms.js.map +1 -0
- package/dist/adapters/college-scorecard.d.ts +3 -0
- package/dist/adapters/college-scorecard.js +122 -0
- package/dist/adapters/college-scorecard.js.map +1 -0
- package/dist/adapters/congress.d.ts +33 -0
- package/dist/adapters/congress.js +589 -0
- package/dist/adapters/congress.js.map +1 -0
- package/dist/adapters/dhs-ohss.d.ts +13 -0
- package/dist/adapters/dhs-ohss.js +598 -0
- package/dist/adapters/dhs-ohss.js.map +1 -0
- package/dist/adapters/doj-news.d.ts +7 -0
- package/dist/adapters/doj-news.js +286 -0
- package/dist/adapters/doj-news.js.map +1 -0
- package/dist/adapters/dol.d.ts +4 -0
- package/dist/adapters/dol.js +634 -0
- package/dist/adapters/dol.js.map +1 -0
- package/dist/adapters/eia.d.ts +15 -0
- package/dist/adapters/eia.js +456 -0
- package/dist/adapters/eia.js.map +1 -0
- package/dist/adapters/epa-aqs.d.ts +3 -0
- package/dist/adapters/epa-aqs.js +357 -0
- package/dist/adapters/epa-aqs.js.map +1 -0
- package/dist/adapters/epa.d.ts +3 -0
- package/dist/adapters/epa.js +298 -0
- package/dist/adapters/epa.js.map +1 -0
- package/dist/adapters/fbi.d.ts +3 -0
- package/dist/adapters/fbi.js +192 -0
- package/dist/adapters/fbi.js.map +1 -0
- package/dist/adapters/fda.d.ts +5 -0
- package/dist/adapters/fda.js +184 -0
- package/dist/adapters/fda.js.map +1 -0
- package/dist/adapters/fdic.d.ts +4 -0
- package/dist/adapters/fdic.js +95 -0
- package/dist/adapters/fdic.js.map +1 -0
- package/dist/adapters/fec.d.ts +3 -0
- package/dist/adapters/fec.js +142 -0
- package/dist/adapters/fec.js.map +1 -0
- package/dist/adapters/fed-board.d.ts +12 -0
- package/dist/adapters/fed-board.js +581 -0
- package/dist/adapters/fed-board.js.map +1 -0
- package/dist/adapters/federal-register.d.ts +11 -0
- package/dist/adapters/federal-register.js +43 -0
- package/dist/adapters/federal-register.js.map +1 -0
- package/dist/adapters/fhfa.d.ts +3 -0
- package/dist/adapters/fhfa.js +253 -0
- package/dist/adapters/fhfa.js.map +1 -0
- package/dist/adapters/fsa.d.ts +9 -0
- package/dist/adapters/fsa.js +335 -0
- package/dist/adapters/fsa.js.map +1 -0
- package/dist/adapters/govinfo.d.ts +30 -0
- package/dist/adapters/govinfo.js +636 -0
- package/dist/adapters/govinfo.js.map +1 -0
- package/dist/adapters/gsa-calc.d.ts +10 -0
- package/dist/adapters/gsa-calc.js +318 -0
- package/dist/adapters/gsa-calc.js.map +1 -0
- package/dist/adapters/hud.d.ts +3 -0
- package/dist/adapters/hud.js +200 -0
- package/dist/adapters/hud.js.map +1 -0
- package/dist/adapters/index.d.ts +3 -0
- package/dist/adapters/index.js +25 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/irs-soi.d.ts +6 -0
- package/dist/adapters/irs-soi.js +576 -0
- package/dist/adapters/irs-soi.js.map +1 -0
- package/dist/adapters/naep.d.ts +15 -0
- package/dist/adapters/naep.js +341 -0
- package/dist/adapters/naep.js.map +1 -0
- package/dist/adapters/nhtsa.d.ts +10 -0
- package/dist/adapters/nhtsa.js +239 -0
- package/dist/adapters/nhtsa.js.map +1 -0
- package/dist/adapters/nih.d.ts +5 -0
- package/dist/adapters/nih.js +196 -0
- package/dist/adapters/nih.js.map +1 -0
- package/dist/adapters/noaa.d.ts +3 -0
- package/dist/adapters/noaa.js +148 -0
- package/dist/adapters/noaa.js.map +1 -0
- package/dist/adapters/nrel.d.ts +3 -0
- package/dist/adapters/nrel.js +186 -0
- package/dist/adapters/nrel.js.map +1 -0
- package/dist/adapters/nws.d.ts +3 -0
- package/dist/adapters/nws.js +119 -0
- package/dist/adapters/nws.js.map +1 -0
- package/dist/adapters/omb.d.ts +15 -0
- package/dist/adapters/omb.js +517 -0
- package/dist/adapters/omb.js.map +1 -0
- package/dist/adapters/open-payments.d.ts +5 -0
- package/dist/adapters/open-payments.js +149 -0
- package/dist/adapters/open-payments.js.map +1 -0
- package/dist/adapters/pbgc.d.ts +13 -0
- package/dist/adapters/pbgc.js +283 -0
- package/dist/adapters/pbgc.js.map +1 -0
- package/dist/adapters/philfed.d.ts +12 -0
- package/dist/adapters/philfed.js +59 -0
- package/dist/adapters/philfed.js.map +1 -0
- package/dist/adapters/regulations.d.ts +6 -0
- package/dist/adapters/regulations.js +58 -0
- package/dist/adapters/regulations.js.map +1 -0
- package/dist/adapters/sec.d.ts +13 -0
- package/dist/adapters/sec.js +504 -0
- package/dist/adapters/sec.js.map +1 -0
- package/dist/adapters/senate-lobbying.d.ts +3 -0
- package/dist/adapters/senate-lobbying.js +181 -0
- package/dist/adapters/senate-lobbying.js.map +1 -0
- package/dist/adapters/snapqc.d.ts +32 -0
- package/dist/adapters/snapqc.js +701 -0
- package/dist/adapters/snapqc.js.map +1 -0
- package/dist/adapters/treasury-yields.d.ts +3 -0
- package/dist/adapters/treasury-yields.js +170 -0
- package/dist/adapters/treasury-yields.js.map +1 -0
- package/dist/adapters/usaspending.d.ts +3 -0
- package/dist/adapters/usaspending.js +340 -0
- package/dist/adapters/usaspending.js.map +1 -0
- package/dist/adapters/usda-fna.d.ts +7 -0
- package/dist/adapters/usda-fna.js +707 -0
- package/dist/adapters/usda-fna.js.map +1 -0
- package/dist/adapters/usda-fooddata.d.ts +3 -0
- package/dist/adapters/usda-fooddata.js +101 -0
- package/dist/adapters/usda-fooddata.js.map +1 -0
- package/dist/adapters/usda-nass.d.ts +3 -0
- package/dist/adapters/usda-nass.js +108 -0
- package/dist/adapters/usda-nass.js.map +1 -0
- package/dist/adapters/usda-outlook.d.ts +12 -0
- package/dist/adapters/usda-outlook.js +696 -0
- package/dist/adapters/usda-outlook.js.map +1 -0
- package/dist/adapters/usgs.d.ts +9 -0
- package/dist/adapters/usgs.js +265 -0
- package/dist/adapters/usgs.js.map +1 -0
- package/dist/adapters/usitc.d.ts +18 -0
- package/dist/adapters/usitc.js +170 -0
- package/dist/adapters/usitc.js.map +1 -0
- package/dist/adapters/uspto.d.ts +3 -0
- package/dist/adapters/uspto.js +47 -0
- package/dist/adapters/uspto.js.map +1 -0
- package/dist/adapters/world-bank.d.ts +3 -0
- package/dist/adapters/world-bank.js +163 -0
- package/dist/adapters/world-bank.js.map +1 -0
- package/dist/analysis/cite.d.ts +31 -0
- package/dist/analysis/cite.js +229 -0
- package/dist/analysis/cite.js.map +1 -0
- package/dist/analysis/combine.d.ts +27 -0
- package/dist/analysis/combine.js +198 -0
- package/dist/analysis/combine.js.map +1 -0
- package/dist/analysis/compute.d.ts +62 -0
- package/dist/analysis/compute.js +583 -0
- package/dist/analysis/compute.js.map +1 -0
- package/dist/analysis/expr.d.ts +69 -0
- package/dist/analysis/expr.js +780 -0
- package/dist/analysis/expr.js.map +1 -0
- package/dist/analysis/factfmt.d.ts +16 -0
- package/dist/analysis/factfmt.js +187 -0
- package/dist/analysis/factfmt.js.map +1 -0
- package/dist/analysis/facts.d.ts +63 -0
- package/dist/analysis/facts.js +355 -0
- package/dist/analysis/facts.js.map +1 -0
- package/dist/analysis/handoff.d.ts +58 -0
- package/dist/analysis/handoff.js +208 -0
- package/dist/analysis/handoff.js.map +1 -0
- package/dist/analysis/pyfmt.d.ts +16 -0
- package/dist/analysis/pyfmt.js +156 -0
- package/dist/analysis/pyfmt.js.map +1 -0
- package/dist/analysis/rerun.d.ts +13 -0
- package/dist/analysis/rerun.js +125 -0
- package/dist/analysis/rerun.js.map +1 -0
- package/dist/analysis/table.d.ts +18 -0
- package/dist/analysis/table.js +109 -0
- package/dist/analysis/table.js.map +1 -0
- package/dist/analysis/tools.d.ts +67 -0
- package/dist/analysis/tools.js +217 -0
- package/dist/analysis/tools.js.map +1 -0
- package/dist/analysis/write_table.d.ts +13 -0
- package/dist/analysis/write_table.js +59 -0
- package/dist/analysis/write_table.js.map +1 -0
- package/dist/bin/cli.d.ts +10 -0
- package/dist/bin/cli.js +177 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/core/cache.d.ts +14 -0
- package/dist/core/cache.js +90 -0
- package/dist/core/cache.js.map +1 -0
- package/dist/core/context.d.ts +12 -0
- package/dist/core/context.js +15 -0
- package/dist/core/context.js.map +1 -0
- package/dist/core/env.d.ts +14 -0
- package/dist/core/env.js +52 -0
- package/dist/core/env.js.map +1 -0
- package/dist/core/generic-rest.d.ts +61 -0
- package/dist/core/generic-rest.js +639 -0
- package/dist/core/generic-rest.js.map +1 -0
- package/dist/core/http.d.ts +120 -0
- package/dist/core/http.js +514 -0
- package/dist/core/http.js.map +1 -0
- package/dist/core/keys.d.ts +43 -0
- package/dist/core/keys.js +174 -0
- package/dist/core/keys.js.map +1 -0
- package/dist/core/manual.d.ts +41 -0
- package/dist/core/manual.js +218 -0
- package/dist/core/manual.js.map +1 -0
- package/dist/core/package.d.ts +58 -0
- package/dist/core/package.js +228 -0
- package/dist/core/package.js.map +1 -0
- package/dist/core/packs.d.ts +139 -0
- package/dist/core/packs.js +173 -0
- package/dist/core/packs.js.map +1 -0
- package/dist/core/policy.d.ts +69 -0
- package/dist/core/policy.js +189 -0
- package/dist/core/policy.js.map +1 -0
- package/dist/core/py.d.ts +40 -0
- package/dist/core/py.js +171 -0
- package/dist/core/py.js.map +1 -0
- package/dist/core/routing.d.ts +10 -0
- package/dist/core/routing.js +39 -0
- package/dist/core/routing.js.map +1 -0
- package/dist/core/tabular.d.ts +21 -0
- package/dist/core/tabular.js +229 -0
- package/dist/core/tabular.js.map +1 -0
- package/dist/deep/_bea_api.d.ts +102 -0
- package/dist/deep/_bea_api.js +457 -0
- package/dist/deep/_bea_api.js.map +1 -0
- package/dist/deep/_bea_fetch.d.ts +151 -0
- package/dist/deep/_bea_fetch.js +1274 -0
- package/dist/deep/_bea_fetch.js.map +1 -0
- package/dist/deep/_bea_util.d.ts +14 -0
- package/dist/deep/_bea_util.js +156 -0
- package/dist/deep/_bea_util.js.map +1 -0
- package/dist/deep/_bls_api.d.ts +84 -0
- package/dist/deep/_bls_api.js +231 -0
- package/dist/deep/_bls_api.js.map +1 -0
- package/dist/deep/_bls_ids.d.ts +43 -0
- package/dist/deep/_bls_ids.js +188 -0
- package/dist/deep/_bls_ids.js.map +1 -0
- package/dist/deep/_bls_lib.d.ts +61 -0
- package/dist/deep/_bls_lib.js +442 -0
- package/dist/deep/_bls_lib.js.map +1 -0
- package/dist/deep/_fred_api.d.ts +148 -0
- package/dist/deep/_fred_api.js +545 -0
- package/dist/deep/_fred_api.js.map +1 -0
- package/dist/deep/_fred_pack.d.ts +162 -0
- package/dist/deep/_fred_pack.js +1027 -0
- package/dist/deep/_fred_pack.js.map +1 -0
- package/dist/deep/_fred_py.d.ts +40 -0
- package/dist/deep/_fred_py.js +199 -0
- package/dist/deep/_fred_py.js.map +1 -0
- package/dist/deep/_ipums_bundle.d.ts +29 -0
- package/dist/deep/_ipums_bundle.js +194 -0
- package/dist/deep/_ipums_bundle.js.map +1 -0
- package/dist/deep/_ipums_ddi.d.ts +23 -0
- package/dist/deep/_ipums_ddi.js +162 -0
- package/dist/deep/_ipums_ddi.js.map +1 -0
- package/dist/deep/_opm_io.d.ts +26 -0
- package/dist/deep/_opm_io.js +383 -0
- package/dist/deep/_opm_io.js.map +1 -0
- package/dist/deep/_opm_parquet.d.ts +31 -0
- package/dist/deep/_opm_parquet.js +744 -0
- package/dist/deep/_opm_parquet.js.map +1 -0
- package/dist/deep/_opm_py.d.ts +6 -0
- package/dist/deep/_opm_py.js +74 -0
- package/dist/deep/_opm_py.js.map +1 -0
- package/dist/deep/_treasury_api.d.ts +48 -0
- package/dist/deep/_treasury_api.js +221 -0
- package/dist/deep/_treasury_api.js.map +1 -0
- package/dist/deep/_treasury_context.d.ts +34 -0
- package/dist/deep/_treasury_context.js +142 -0
- package/dist/deep/_treasury_context.js.map +1 -0
- package/dist/deep/_treasury_lib.d.ts +109 -0
- package/dist/deep/_treasury_lib.js +686 -0
- package/dist/deep/_treasury_lib.js.map +1 -0
- package/dist/deep/bea.d.ts +3 -0
- package/dist/deep/bea.js +248 -0
- package/dist/deep/bea.js.map +1 -0
- package/dist/deep/bls.d.ts +3 -0
- package/dist/deep/bls.js +220 -0
- package/dist/deep/bls.js.map +1 -0
- package/dist/deep/fred.d.ts +3 -0
- package/dist/deep/fred.js +325 -0
- package/dist/deep/fred.js.map +1 -0
- package/dist/deep/ipums.d.ts +59 -0
- package/dist/deep/ipums.js +744 -0
- package/dist/deep/ipums.js.map +1 -0
- package/dist/deep/opm.d.ts +56 -0
- package/dist/deep/opm.js +1033 -0
- package/dist/deep/opm.js.map +1 -0
- package/dist/deep/treasury.d.ts +3 -0
- package/dist/deep/treasury.js +218 -0
- package/dist/deep/treasury.js.map +1 -0
- package/dist/envelope.d.ts +47 -0
- package/dist/envelope.js +88 -0
- package/dist/envelope.js.map +1 -0
- package/dist/index.d.ts +277 -0
- package/dist/index.js +106 -0
- package/dist/index.js.map +1 -0
- package/dist/remote/app.d.ts +21 -0
- package/dist/remote/app.js +218 -0
- package/dist/remote/app.js.map +1 -0
- package/dist/remote/oauth.d.ts +14 -0
- package/dist/remote/oauth.js +90 -0
- package/dist/remote/oauth.js.map +1 -0
- package/dist/remote/pages.d.ts +8 -0
- package/dist/remote/pages.js +56 -0
- package/dist/remote/pages.js.map +1 -0
- package/dist/remote/sign.d.ts +4 -0
- package/dist/remote/sign.js +40 -0
- package/dist/remote/sign.js.map +1 -0
- package/dist/remote/store.d.ts +31 -0
- package/dist/remote/store.js +129 -0
- package/dist/remote/store.js.map +1 -0
- package/dist/report/audit_answer.d.ts +94 -0
- package/dist/report/audit_answer.js +1349 -0
- package/dist/report/audit_answer.js.map +1 -0
- package/dist/report/audit_report.d.ts +23 -0
- package/dist/report/audit_report.js +637 -0
- package/dist/report/audit_report.js.map +1 -0
- package/dist/report/build_report.d.ts +27 -0
- package/dist/report/build_report.js +1168 -0
- package/dist/report/build_report.js.map +1 -0
- package/dist/report/method_audit.d.ts +47 -0
- package/dist/report/method_audit.js +710 -0
- package/dist/report/method_audit.js.map +1 -0
- package/dist/report/policyset.d.ts +50 -0
- package/dist/report/policyset.js +421 -0
- package/dist/report/policyset.js.map +1 -0
- package/dist/report/py.d.ts +58 -0
- package/dist/report/py.js +311 -0
- package/dist/report/py.js.map +1 -0
- package/dist/report/scan_secrets.d.ts +21 -0
- package/dist/report/scan_secrets.js +234 -0
- package/dist/report/scan_secrets.js.map +1 -0
- package/dist/report/style_check.d.ts +29 -0
- package/dist/report/style_check.js +173 -0
- package/dist/report/style_check.js.map +1 -0
- package/dist/report/tools.d.ts +87 -0
- package/dist/report/tools.js +167 -0
- package/dist/report/tools.js.map +1 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.js +246 -0
- package/dist/server.js.map +1 -0
- package/dist/session.d.ts +47 -0
- package/dist/session.js +107 -0
- package/dist/session.js.map +1 -0
- package/dist/toolkit.d.ts +21 -0
- package/dist/toolkit.js +2 -0
- package/dist/toolkit.js.map +1 -0
- package/dist/tools.d.ts +299 -0
- package/dist/tools.js +491 -0
- package/dist/tools.js.map +1 -0
- package/guide/WORKFLOW.md +134 -0
- package/guide/assets/disclaimer.txt +1 -0
- package/guide/assets/download_data.ps1 +162 -0
- package/guide/assets/download_data.sh +143 -0
- package/guide/assets/report_template.html +597 -0
- package/guide/references/report_patterns.md +199 -0
- package/guide/references/routing.md +171 -0
- package/guide/references/style_guide.md +398 -0
- package/package.json +56 -6
- package/packs/acf/endpoints.json +114 -0
- package/packs/acf/policy.json +104 -0
- package/packs/acf/source.md +138 -0
- package/packs/actuaries/endpoints.json +82 -0
- package/packs/actuaries/policy.json +109 -0
- package/packs/actuaries/source.md +137 -0
- package/packs/bea/assets/download_bea.ps1 +182 -0
- package/packs/bea/assets/download_bea.sh +144 -0
- package/packs/bea/docs/bea_api.md +461 -0
- package/packs/bea/docs/datasets.md +157 -0
- package/packs/bea/docs/report_patterns.md +112 -0
- package/packs/bea/policy.json +170 -0
- package/packs/bea/source.md +152 -0
- package/packs/bls/assets/download_bls.ps1 +152 -0
- package/packs/bls/assets/download_bls.sh +167 -0
- package/packs/bls/docs/analysis_patterns.md +108 -0
- package/packs/bls/docs/bls_api.md +73 -0
- package/packs/bls/docs/series_ids.md +149 -0
- package/packs/bls/policy.json +238 -0
- package/packs/bls/series_ids.json +1375 -0
- package/packs/bls/source.md +156 -0
- package/packs/bts/endpoints.json +347 -0
- package/packs/bts/policy.json +94 -0
- package/packs/bts/source.md +97 -0
- package/packs/cdc/endpoints.json +197 -0
- package/packs/cdc/policy.json +83 -0
- package/packs/cdc/source.md +74 -0
- package/packs/census/endpoints.json +99 -0
- package/packs/census/policy.json +238 -0
- package/packs/census/source.md +304 -0
- package/packs/census-geocoder/endpoints.json +70 -0
- package/packs/census-geocoder/policy.json +80 -0
- package/packs/census-geocoder/source.md +53 -0
- package/packs/cfpb/endpoints.json +327 -0
- package/packs/cfpb/policy.json +119 -0
- package/packs/cfpb/source.md +96 -0
- package/packs/clinical-trials/endpoints.json +167 -0
- package/packs/clinical-trials/policy.json +84 -0
- package/packs/clinical-trials/source.md +82 -0
- package/packs/cms/endpoints.json +69 -0
- package/packs/cms/policy.json +96 -0
- package/packs/cms/source.md +112 -0
- package/packs/college-scorecard/endpoints.json +253 -0
- package/packs/college-scorecard/policy.json +106 -0
- package/packs/college-scorecard/source.md +92 -0
- package/packs/congress/endpoints.json +1701 -0
- package/packs/congress/policy.json +117 -0
- package/packs/congress/source.md +190 -0
- package/packs/dhs-ohss/endpoints.json +66 -0
- package/packs/dhs-ohss/policy.json +107 -0
- package/packs/dhs-ohss/source.md +120 -0
- package/packs/doj-news/endpoints.json +59 -0
- package/packs/doj-news/policy.json +96 -0
- package/packs/doj-news/source.md +99 -0
- package/packs/dol/endpoints.json +818 -0
- package/packs/dol/policy.json +135 -0
- package/packs/dol/source.md +181 -0
- package/packs/eia/endpoints.json +718 -0
- package/packs/eia/policy.json +112 -0
- package/packs/eia/source.md +112 -0
- package/packs/epa/endpoints.json +292 -0
- package/packs/epa/policy.json +99 -0
- package/packs/epa/source.md +99 -0
- package/packs/epa-aqs/endpoints.json +174 -0
- package/packs/epa-aqs/policy.json +96 -0
- package/packs/epa-aqs/source.md +97 -0
- package/packs/fbi/endpoints.json +1842 -0
- package/packs/fbi/policy.json +118 -0
- package/packs/fbi/source.md +108 -0
- package/packs/fda/endpoints.json +238 -0
- package/packs/fda/policy.json +121 -0
- package/packs/fda/source.md +117 -0
- package/packs/fdic/endpoints.json +417 -0
- package/packs/fdic/policy.json +83 -0
- package/packs/fdic/source.md +92 -0
- package/packs/fec/endpoints.json +708 -0
- package/packs/fec/policy.json +93 -0
- package/packs/fec/source.md +90 -0
- package/packs/fed-board/endpoints.json +89 -0
- package/packs/fed-board/policy.json +136 -0
- package/packs/fed-board/source.md +118 -0
- package/packs/federal-register/endpoints.json +143 -0
- package/packs/federal-register/policy.json +86 -0
- package/packs/federal-register/source.md +98 -0
- package/packs/fema/endpoints.json +646 -0
- package/packs/fema/policy.json +103 -0
- package/packs/fema/source.md +103 -0
- package/packs/fhfa/endpoints.json +105 -0
- package/packs/fhfa/policy.json +109 -0
- package/packs/fhfa/source.md +108 -0
- package/packs/fred/assets/download_fred.ps1 +122 -0
- package/packs/fred/assets/download_fred.sh +123 -0
- package/packs/fred/docs/analysis_patterns.md +124 -0
- package/packs/fred/docs/fred_api.md +94 -0
- package/packs/fred/docs/series.md +188 -0
- package/packs/fred/policy.json +253 -0
- package/packs/fred/source.md +142 -0
- package/packs/fsa/endpoints.json +150 -0
- package/packs/fsa/policy.json +99 -0
- package/packs/fsa/source.md +102 -0
- package/packs/govinfo/endpoints.json +520 -0
- package/packs/govinfo/policy.json +116 -0
- package/packs/govinfo/source.md +241 -0
- package/packs/gsa-calc/endpoints.json +93 -0
- package/packs/gsa-calc/policy.json +97 -0
- package/packs/gsa-calc/source.md +108 -0
- package/packs/hud/endpoints.json +147 -0
- package/packs/hud/policy.json +84 -0
- package/packs/hud/source.md +97 -0
- package/packs/ipums/assets/download_ipums.ps1 +215 -0
- package/packs/ipums/assets/download_ipums.sh +192 -0
- package/packs/ipums/docs/ipums_api.md +67 -0
- package/packs/ipums/docs/report_patterns.md +117 -0
- package/packs/ipums/docs/variables.md +284 -0
- package/packs/ipums/lib/fetch_text.json +112 -0
- package/packs/ipums/policy.json +215 -0
- package/packs/ipums/source.md +169 -0
- package/packs/irs-soi/endpoints.json +114 -0
- package/packs/irs-soi/policy.json +107 -0
- package/packs/irs-soi/source.md +124 -0
- package/packs/medicaid/endpoints.json +412 -0
- package/packs/medicaid/policy.json +108 -0
- package/packs/medicaid/source.md +136 -0
- package/packs/naep/endpoints.json +217 -0
- package/packs/naep/policy.json +100 -0
- package/packs/naep/source.md +120 -0
- package/packs/nhtsa/endpoints.json +132 -0
- package/packs/nhtsa/policy.json +93 -0
- package/packs/nhtsa/source.md +109 -0
- package/packs/nih/endpoints.json +453 -0
- package/packs/nih/policy.json +86 -0
- package/packs/nih/source.md +108 -0
- package/packs/noaa/endpoints.json +432 -0
- package/packs/noaa/policy.json +95 -0
- package/packs/noaa/source.md +88 -0
- package/packs/nrel/endpoints.json +328 -0
- package/packs/nrel/policy.json +96 -0
- package/packs/nrel/source.md +91 -0
- package/packs/nws/endpoints.json +272 -0
- package/packs/nws/policy.json +82 -0
- package/packs/nws/source.md +81 -0
- package/packs/nyfed/endpoints.json +80 -0
- package/packs/nyfed/policy.json +92 -0
- package/packs/nyfed/source.md +89 -0
- package/packs/omb/endpoints.json +460 -0
- package/packs/omb/policy.json +106 -0
- package/packs/omb/source.md +130 -0
- package/packs/open-payments/endpoints.json +298 -0
- package/packs/open-payments/policy.json +101 -0
- package/packs/open-payments/source.md +99 -0
- package/packs/opm/assets/download_opm.ps1 +125 -0
- package/packs/opm/assets/download_opm.sh +85 -0
- package/packs/opm/docs/fields.md +184 -0
- package/packs/opm/docs/opm_api.md +71 -0
- package/packs/opm/docs/report_patterns.md +83 -0
- package/packs/opm/lib/data_dictionary.csv +73 -0
- package/packs/opm/policy.json +142 -0
- package/packs/opm/source.md +137 -0
- package/packs/pbgc/endpoints.json +483 -0
- package/packs/pbgc/policy.json +94 -0
- package/packs/pbgc/source.md +95 -0
- package/packs/philfed/endpoints.json +85 -0
- package/packs/philfed/policy.json +94 -0
- package/packs/philfed/source.md +125 -0
- package/packs/port.json +287 -0
- package/packs/regulations/endpoints.json +288 -0
- package/packs/regulations/policy.json +86 -0
- package/packs/regulations/source.md +84 -0
- package/packs/sec/endpoints.json +237 -0
- package/packs/sec/policy.json +86 -0
- package/packs/sec/source.md +101 -0
- package/packs/senate-lobbying/endpoints.json +554 -0
- package/packs/senate-lobbying/policy.json +99 -0
- package/packs/senate-lobbying/source.md +100 -0
- package/packs/snapqc/endpoints.json +1426 -0
- package/packs/snapqc/policy.json +92 -0
- package/packs/snapqc/source.md +96 -0
- package/packs/treasury/catalog.json +2267 -0
- package/packs/treasury/docs/api_guide.md +245 -0
- package/packs/treasury/docs/datasets.md +56 -0
- package/packs/treasury/docs/report_patterns.md +126 -0
- package/packs/treasury/policy.json +159 -0
- package/packs/treasury/source.md +165 -0
- package/packs/treasury-yields/endpoints.json +226 -0
- package/packs/treasury-yields/policy.json +86 -0
- package/packs/treasury-yields/source.md +80 -0
- package/packs/usaspending/endpoints.json +1316 -0
- package/packs/usaspending/policy.json +109 -0
- package/packs/usaspending/source.md +103 -0
- package/packs/usda-fna/endpoints.json +427 -0
- package/packs/usda-fna/policy.json +133 -0
- package/packs/usda-fna/source.md +217 -0
- package/packs/usda-fooddata/endpoints.json +181 -0
- package/packs/usda-fooddata/policy.json +94 -0
- package/packs/usda-fooddata/source.md +105 -0
- package/packs/usda-nass/endpoints.json +324 -0
- package/packs/usda-nass/policy.json +95 -0
- package/packs/usda-nass/source.md +85 -0
- package/packs/usda-outlook/endpoints.json +86 -0
- package/packs/usda-outlook/policy.json +109 -0
- package/packs/usda-outlook/source.md +144 -0
- package/packs/usgs/endpoints.json +313 -0
- package/packs/usgs/policy.json +95 -0
- package/packs/usgs/source.md +96 -0
- package/packs/usitc/endpoints.json +74 -0
- package/packs/usitc/policy.json +111 -0
- package/packs/usitc/source.md +90 -0
- package/packs/uspto/endpoints.json +141 -0
- package/packs/uspto/policy.json +95 -0
- package/packs/uspto/source.md +101 -0
- package/packs/va/endpoints.json +414 -0
- package/packs/va/policy.json +101 -0
- package/packs/va/source.md +129 -0
- package/packs/world-bank/endpoints.json +122 -0
- package/packs/world-bank/policy.json +101 -0
- package/packs/world-bank/source.md +93 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
<#
|
|
2
|
+
.SYNOPSIS
|
|
3
|
+
Download BLS time series with the BLS Public Data API: send the requests built into this script and
|
|
4
|
+
save the replies as response_*.json next to it. (Windows PowerShell counterpart of download_bls.sh.)
|
|
5
|
+
|
|
6
|
+
.DESCRIPTION
|
|
7
|
+
- Needs no other file: the requests are inside this script.
|
|
8
|
+
- When the requests need a BLS registration key (API v2), uses $env:BLS_API_KEY when it is set and
|
|
9
|
+
otherwise asks for the key (hidden input). The key is only sent to api.bls.gov: it is never shown,
|
|
10
|
+
saved, or put on a command line. With a key set, keyless requests also go through API v2.
|
|
11
|
+
- Saves response_01.json, response_02.json, ... next to this script, each with the request it answers
|
|
12
|
+
(without the key), and prints their full paths at the end.
|
|
13
|
+
- Needs nothing beyond Windows PowerShell 5.1 (built into Windows 10 and 11) or PowerShell 7.
|
|
14
|
+
|
|
15
|
+
Get a free key at https://data.bls.gov/registrationEngine/ (BLS emails it within minutes).
|
|
16
|
+
|
|
17
|
+
.PARAMETER NoPause
|
|
18
|
+
Do not wait for Enter before closing the window.
|
|
19
|
+
|
|
20
|
+
.EXAMPLE
|
|
21
|
+
powershell -NoProfile -ExecutionPolicy Bypass -File "$HOME\Downloads\download_bls.ps1"
|
|
22
|
+
#>
|
|
23
|
+
[CmdletBinding()]
|
|
24
|
+
param(
|
|
25
|
+
[switch]$NoPause
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
$ErrorActionPreference = 'Stop'
|
|
29
|
+
$ProgressPreference = 'SilentlyContinue' # Invoke-WebRequest is very slow with the progress bar
|
|
30
|
+
try {
|
|
31
|
+
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
|
|
32
|
+
} catch { }
|
|
33
|
+
|
|
34
|
+
$Here = $PSScriptRoot
|
|
35
|
+
if (-not $Here) { $Here = (Get-Location).Path }
|
|
36
|
+
$Utf8 = New-Object Text.UTF8Encoding($false)
|
|
37
|
+
$Key = $null
|
|
38
|
+
$Req = $null
|
|
39
|
+
|
|
40
|
+
# Keep the window open when the script was started with "Run with PowerShell".
|
|
41
|
+
function Finish([int]$Code) {
|
|
42
|
+
$script:Key = $null
|
|
43
|
+
if ($script:Req) { Remove-Item -LiteralPath $script:Req -Recurse -Force -ErrorAction SilentlyContinue }
|
|
44
|
+
if (-not $NoPause -and -not [Console]::IsInputRedirected) {
|
|
45
|
+
Write-Host ''
|
|
46
|
+
[void](Read-Host -Prompt 'Press Enter to close')
|
|
47
|
+
}
|
|
48
|
+
exit $Code
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function Fail([string]$Message) {
|
|
52
|
+
Write-Host ''
|
|
53
|
+
Write-Host "ERROR: $(Hide-Key $Message)" -ForegroundColor Red
|
|
54
|
+
Finish 1
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
# BLS repeats a rejected key in its error message: never let it reach the screen or a file.
|
|
58
|
+
function Hide-Key([string]$Text) {
|
|
59
|
+
if ($script:Key -and $Text) { return $Text.Replace($script:Key, '[REDACTED]') }
|
|
60
|
+
return $Text
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
# ---------------------------------------------------------------------------- the requests
|
|
64
|
+
# manifest.json and query_NN.json are built into this script; they go to a temporary folder that is
|
|
65
|
+
# removed when the script ends.
|
|
66
|
+
$Embedded = [ordered]@{}
|
|
67
|
+
# @QUERIES@
|
|
68
|
+
$Req = Join-Path ([IO.Path]::GetTempPath()) ('download_bls.' + [IO.Path]::GetRandomFileName())
|
|
69
|
+
[void](New-Item -ItemType Directory -Path $Req)
|
|
70
|
+
foreach ($name in $Embedded.Keys) { [IO.File]::WriteAllText((Join-Path $Req $name), $Embedded[$name], $Utf8) }
|
|
71
|
+
$manifestFile = Join-Path $Req 'manifest.json'
|
|
72
|
+
if (-not (Test-Path -LiteralPath $manifestFile)) {
|
|
73
|
+
Fail "This script has no requests built in. Use the download_bls.ps1 from the analyst's download files."
|
|
74
|
+
}
|
|
75
|
+
$Manifest = [IO.File]::ReadAllText($manifestFile, $Utf8) | ConvertFrom-Json
|
|
76
|
+
$Queries = @(Get-ChildItem -LiteralPath $Req -Filter 'query_*.json' | Sort-Object Name)
|
|
77
|
+
if ($Queries.Count -eq 0) { Fail "This script has no requests built in. Use the download_bls.ps1 from the analyst's download files." }
|
|
78
|
+
$Bodies = @()
|
|
79
|
+
foreach ($q in $Queries) { $Bodies += ,([IO.File]::ReadAllText($q.FullName, $Utf8) | ConvertFrom-Json) }
|
|
80
|
+
|
|
81
|
+
$needKey = ($Manifest.api_version -eq 'v2')
|
|
82
|
+
foreach ($b in $Bodies) { if ($b.PSObject.Properties['registrationkey']) { $needKey = $true } }
|
|
83
|
+
|
|
84
|
+
# ---------------------------------------------------------------------------- API key
|
|
85
|
+
$Key = $env:BLS_API_KEY
|
|
86
|
+
if ($Key) {
|
|
87
|
+
Write-Host 'Using the BLS key in $env:BLS_API_KEY.'
|
|
88
|
+
} elseif ($needKey) {
|
|
89
|
+
Write-Host 'These requests need a free BLS registration key (https://data.bls.gov/registrationEngine/).'
|
|
90
|
+
if ([Console]::IsInputRedirected) {
|
|
91
|
+
$Key = [Console]::In.ReadLine()
|
|
92
|
+
} else {
|
|
93
|
+
$secure = Read-Host -Prompt 'Paste your BLS key (input is hidden), then press Enter' -AsSecureString
|
|
94
|
+
$bstr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($secure)
|
|
95
|
+
try { $Key = [Runtime.InteropServices.Marshal]::PtrToStringBSTR($bstr) }
|
|
96
|
+
finally { [Runtime.InteropServices.Marshal]::ZeroFreeBSTR($bstr) }
|
|
97
|
+
Remove-Variable secure
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if ($null -eq $Key) { $Key = '' }
|
|
101
|
+
$Key = $Key -replace '\s', ''
|
|
102
|
+
if ($needKey -and -not $Key) { Fail 'No key entered. Get one at https://data.bls.gov/registrationEngine/' }
|
|
103
|
+
|
|
104
|
+
$Version = 'v1'
|
|
105
|
+
if ($Key -and $Manifest.urls.v2) { $Version = 'v2' }
|
|
106
|
+
$Url = [string]$Manifest.urls.$Version
|
|
107
|
+
Write-Host "Sending $($Queries.Count) request(s) to BLS API $Version ..."
|
|
108
|
+
|
|
109
|
+
# ---------------------------------------------------------------------------- send each request
|
|
110
|
+
$Saved = @()
|
|
111
|
+
for ($i = 0; $i -lt $Queries.Count; $i++) {
|
|
112
|
+
$q = $Queries[$i]
|
|
113
|
+
$body = $Bodies[$i]
|
|
114
|
+
$body.PSObject.Properties.Remove('registrationkey')
|
|
115
|
+
if ($Version -eq 'v2' -and $Manifest.v2_options) {
|
|
116
|
+
foreach ($p in $Manifest.v2_options.PSObject.Properties) {
|
|
117
|
+
$body | Add-Member -NotePropertyName $p.Name -NotePropertyValue $p.Value -Force
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
$requestJson = $body | ConvertTo-Json -Depth 10 -Compress # the request without the key
|
|
121
|
+
$body | Add-Member -NotePropertyName 'registrationkey' -NotePropertyValue $Key -Force
|
|
122
|
+
if ($Version -ne 'v2') { $body.PSObject.Properties.Remove('registrationkey') }
|
|
123
|
+
$sendJson = $body | ConvertTo-Json -Depth 10 -Compress # in memory only
|
|
124
|
+
$body.PSObject.Properties.Remove('registrationkey')
|
|
125
|
+
|
|
126
|
+
try {
|
|
127
|
+
$resp = Invoke-WebRequest -Uri $Url -Method Post -Body $Utf8.GetBytes($sendJson) `
|
|
128
|
+
-ContentType 'application/json' -UserAgent 'data-analyst/1.0' -UseBasicParsing -TimeoutSec 120
|
|
129
|
+
} catch {
|
|
130
|
+
Fail "$($q.Name): the request to api.bls.gov failed ($($_.Exception.Message)). Check the internet connection, VPN and proxy, then run this script again."
|
|
131
|
+
}
|
|
132
|
+
$sendJson = $null
|
|
133
|
+
$text = $Utf8.GetString($resp.RawContentStream.ToArray()).Trim()
|
|
134
|
+
try { $reply = $text | ConvertFrom-Json } catch { $reply = $null }
|
|
135
|
+
if ($null -eq $reply -or -not $text.EndsWith('}') -or $reply.PSObject.Properties.Count -eq 0) {
|
|
136
|
+
Fail "$($q.Name): BLS did not answer with JSON. The reply began: $($text.Substring(0, [Math]::Min(200, $text.Length)))"
|
|
137
|
+
}
|
|
138
|
+
# Keep the reply exactly as BLS sent it and add the request it answers, like download_bls.sh.
|
|
139
|
+
$text = $text.Substring(0, $text.LastIndexOf('}')).TrimEnd() + ",`n `"_request`": " + $requestJson + "`n}"
|
|
140
|
+
$dest = Join-Path $Here ($q.Name -replace '^query_', 'response_')
|
|
141
|
+
[IO.File]::WriteAllText($dest, (Hide-Key $text) + "`n", $Utf8)
|
|
142
|
+
$Saved += $dest
|
|
143
|
+
$msg = Hide-Key ((@($reply.message) | Where-Object { $_ }) -join '; ')
|
|
144
|
+
if ($msg.Length -gt 200) { $msg = $msg.Substring(0, 200) }
|
|
145
|
+
Write-Host "$(Split-Path -Leaf $dest) $($reply.status) $msg"
|
|
146
|
+
if ($i -lt $Queries.Count - 1) { Start-Sleep -Milliseconds 500 }
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
Write-Host ''
|
|
150
|
+
Write-Host 'Done. Upload these files to the chat (do not edit them):' -ForegroundColor Green
|
|
151
|
+
foreach ($p in $Saved) { Write-Host " $p" }
|
|
152
|
+
Finish 0
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Download BLS time series with the BLS Public Data API: send the requests built into this script and
|
|
3
|
+
# save the replies as response_*.json next to it. (macOS, Linux, Git Bash, WSL; on Windows PowerShell
|
|
4
|
+
# use download_bls.ps1.)
|
|
5
|
+
#
|
|
6
|
+
# Usage: bash download_bls.sh (for example: bash ~/Downloads/download_bls.sh)
|
|
7
|
+
#
|
|
8
|
+
# - Needs no other file: the requests are inside this script.
|
|
9
|
+
# - When the requests need a BLS registration key (API v2), it uses $BLS_API_KEY when it is set and
|
|
10
|
+
# otherwise asks for the key (hidden input). The key is only sent to api.bls.gov, in the request
|
|
11
|
+
# body on curl's standard input: it is never shown, saved, or put on a command line. With a key
|
|
12
|
+
# set, keyless requests also go through API v2.
|
|
13
|
+
# - Saves response_01.json, response_02.json, ... next to this script, each with the request it
|
|
14
|
+
# answers (without the key), and prints their full paths at the end.
|
|
15
|
+
# - Needs only bash and curl, which macOS and most Linux systems have.
|
|
16
|
+
#
|
|
17
|
+
# Get a free key at https://data.bls.gov/registrationEngine/ (BLS emails it within minutes).
|
|
18
|
+
set -euo pipefail
|
|
19
|
+
|
|
20
|
+
case "${1:-}" in
|
|
21
|
+
-h|--help) sed -n '2,17p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
|
|
22
|
+
esac
|
|
23
|
+
|
|
24
|
+
die() { echo "ERROR: $*" >&2; exit 1; }
|
|
25
|
+
|
|
26
|
+
command -v curl >/dev/null 2>&1 || die "curl is not installed. Install it (for example: sudo apt install curl) and run this script again."
|
|
27
|
+
|
|
28
|
+
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
29
|
+
|
|
30
|
+
# --------------------------------------------------------------------------- the requests
|
|
31
|
+
# manifest.json and query_NN.json are built into this script; they go to a temporary folder that is
|
|
32
|
+
# removed when the script ends.
|
|
33
|
+
REQ="$(mktemp -d "${TMPDIR:-/tmp}/download_bls.XXXXXX")" || die "Could not create a temporary folder."
|
|
34
|
+
trap 'rm -rf "$REQ"' EXIT
|
|
35
|
+
# @QUERIES@
|
|
36
|
+
MANIFEST="$REQ/manifest.json"
|
|
37
|
+
[ -f "$MANIFEST" ] || die "This script has no requests built in. Use the download_bls.sh from the analyst's download files."
|
|
38
|
+
|
|
39
|
+
# flat FILE: the JSON file on one line (CR and LF removed)
|
|
40
|
+
flat() { tr -d '\r\n' < "$1"; }
|
|
41
|
+
|
|
42
|
+
MAN="$(flat "$MANIFEST")"
|
|
43
|
+
json_str() { # json_str TEXT NAME: the first "NAME": "value" in TEXT
|
|
44
|
+
printf '%s' "$1" | grep -o "\"$2\" *: *\"[^\"]*\"" | head -n 1 | sed 's/^[^:]*: *"//; s/"$//' || true
|
|
45
|
+
}
|
|
46
|
+
API_VERSION="$(json_str "$MAN" api_version)"
|
|
47
|
+
URL_V1="$(json_str "$MAN" v1)"
|
|
48
|
+
URL_V2="$(json_str "$MAN" v2)"
|
|
49
|
+
# "annualaverage": true, "catalog": true (or nothing)
|
|
50
|
+
V2_OPTIONS="$(printf '%s' "$MAN" | grep -o '"v2_options" *: *{[^}]*}' | sed 's/^[^{]*{//; s/}$//; s/^ *//; s/ *$//' || true)"
|
|
51
|
+
[ -n "$URL_V1" ] || die "The requests built into this script have no API addresses. Do not edit the script."
|
|
52
|
+
|
|
53
|
+
QUERIES=()
|
|
54
|
+
for q in "$REQ"/query_*.json; do
|
|
55
|
+
[ -f "$q" ] && QUERIES+=("$q")
|
|
56
|
+
done
|
|
57
|
+
[ ${#QUERIES[@]} -gt 0 ] || die "This script has no requests built in. Use the download_bls.sh from the analyst's download files."
|
|
58
|
+
|
|
59
|
+
NEED_KEY=0
|
|
60
|
+
[ "$API_VERSION" = v2 ] && NEED_KEY=1
|
|
61
|
+
for q in "${QUERIES[@]}"; do
|
|
62
|
+
if grep -q '"registrationkey"' "$q"; then NEED_KEY=1; fi
|
|
63
|
+
done
|
|
64
|
+
|
|
65
|
+
# --------------------------------------------------------------------------- API key
|
|
66
|
+
KEY="${BLS_API_KEY:-}"
|
|
67
|
+
if [ -n "$KEY" ]; then
|
|
68
|
+
echo "Using the BLS key in \$BLS_API_KEY."
|
|
69
|
+
elif [ $NEED_KEY -eq 1 ]; then
|
|
70
|
+
echo "These requests need a free BLS registration key (https://data.bls.gov/registrationEngine/)."
|
|
71
|
+
if [ -t 0 ]; then
|
|
72
|
+
printf 'Paste your BLS key (input is hidden), then press Enter: '
|
|
73
|
+
IFS= read -rs KEY || true; echo
|
|
74
|
+
else
|
|
75
|
+
IFS= read -r KEY || true
|
|
76
|
+
fi
|
|
77
|
+
fi
|
|
78
|
+
KEY="$(printf '%s' "$KEY" | tr -d '[:space:]')"
|
|
79
|
+
[ $NEED_KEY -eq 0 ] || [ -n "$KEY" ] || die "No key entered. Get one at https://data.bls.gov/registrationEngine/"
|
|
80
|
+
case "$KEY" in
|
|
81
|
+
*'"'*|*'\'*) die "The key contains a quote or a backslash; BLS keys are letters and digits only. Check it." ;;
|
|
82
|
+
esac
|
|
83
|
+
|
|
84
|
+
VERSION=v1; URL="$URL_V1"
|
|
85
|
+
if [ -n "$KEY" ] && [ -n "$URL_V2" ]; then VERSION=v2; URL="$URL_V2"; fi
|
|
86
|
+
|
|
87
|
+
# hide TEXT: TEXT with the key removed (BLS repeats a rejected key in its error message)
|
|
88
|
+
hide() {
|
|
89
|
+
local t="$1"
|
|
90
|
+
if [ -n "$KEY" ]; then t="${t//"$KEY"/[REDACTED]}"; fi
|
|
91
|
+
printf '%s' "$t" | sed -E 's/([Tt]he [Kk]ey:? *)[0-9A-Fa-f]{20,}/\1[REDACTED]/g'
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
# request FILE: the request body on one line, without any key, with the v2 options when using v2
|
|
95
|
+
request() {
|
|
96
|
+
local b
|
|
97
|
+
b="$(flat "$1" | sed -E 's/"registrationkey" *: *"[^"]*" *,? *//; s/, *}$/}/; s/ *$//')"
|
|
98
|
+
if [ "$VERSION" = v2 ] && [ -n "$V2_OPTIONS" ]; then
|
|
99
|
+
b="$(printf '%s' "$b" | sed -E 's/, *"(annualaverage|calculations|catalog|aspects)" *: *(true|false)//g')"
|
|
100
|
+
b="${b%\}}, $V2_OPTIONS}"
|
|
101
|
+
fi
|
|
102
|
+
printf '%s' "$b"
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
# --------------------------------------------------------------------------- send each request
|
|
106
|
+
echo "Sending ${#QUERIES[@]} request(s) to BLS API $VERSION ..."
|
|
107
|
+
SAVED=(); REFUSED=()
|
|
108
|
+
total=${#QUERIES[@]}
|
|
109
|
+
n=0
|
|
110
|
+
for q in "${QUERIES[@]}"; do
|
|
111
|
+
n=$((n + 1))
|
|
112
|
+
name="$(basename "$q")"
|
|
113
|
+
dest="$HERE/response_${name#query_}"
|
|
114
|
+
req="$(request "$q")"
|
|
115
|
+
send="$req"
|
|
116
|
+
if [ "$VERSION" = v2 ]; then send="${req%\}}, \"registrationkey\": \"$KEY\"}"; fi # in memory only
|
|
117
|
+
|
|
118
|
+
tries=0
|
|
119
|
+
while :; do
|
|
120
|
+
tries=$((tries + 1))
|
|
121
|
+
set +e
|
|
122
|
+
# printf is a shell builtin: the body (and the key in it) reaches curl on stdin, not on a command line
|
|
123
|
+
out="$(printf '%s' "$send" | curl -sS -X POST -H 'Content-Type: application/json' -A 'data-analyst/1.0' \
|
|
124
|
+
--max-time 120 --data-binary @- -w '\n%{http_code}' "$URL" 2>&1)"
|
|
125
|
+
rc=$?
|
|
126
|
+
set -e
|
|
127
|
+
code="${out##*$'\n'}"; body="${out%$'\n'*}"
|
|
128
|
+
if [ $rc -eq 0 ]; then
|
|
129
|
+
case "$code" in 5??|429) ;; *) break ;; esac
|
|
130
|
+
fi
|
|
131
|
+
if [ $tries -ge 4 ]; then
|
|
132
|
+
[ $rc -eq 0 ] && die "BLS replied with HTTP $code for $name. Run this script again later; if it happens again, tell the analyst."
|
|
133
|
+
die "$name: the request to api.bls.gov failed ($(hide "$body")). Check the internet connection, VPN and proxy, then run this script again."
|
|
134
|
+
fi
|
|
135
|
+
sleep $((tries * 5))
|
|
136
|
+
done
|
|
137
|
+
send=""
|
|
138
|
+
|
|
139
|
+
body="$(printf '%s' "$body" | sed -e 's/[[:space:]]*$//')"
|
|
140
|
+
status="$(json_str "$body" status)"
|
|
141
|
+
case "$body" in
|
|
142
|
+
*'}') ;;
|
|
143
|
+
*) die "$name: BLS did not answer with JSON (HTTP $code). The reply began: $(hide "${body:0:200}")" ;;
|
|
144
|
+
esac
|
|
145
|
+
[ -n "$status" ] || die "$name: BLS did not answer with JSON (HTTP $code). The reply began: $(hide "${body:0:200}")"
|
|
146
|
+
|
|
147
|
+
# Keep the reply exactly as BLS sent it and add the request it answers, like download_bls.ps1.
|
|
148
|
+
hide "${body%\}}"$',\n "_request": '"$req"$'\n}\n' > "$dest.part"
|
|
149
|
+
mv -f "$dest.part" "$dest"
|
|
150
|
+
SAVED+=("$dest")
|
|
151
|
+
msg="$(printf '%s' "$body" | grep -o '"message" *: *\[[^]]*\]' | head -n 1 | sed 's/^[^[]*\[//; s/\]$//' || true)"
|
|
152
|
+
msg="$(hide "$msg")"
|
|
153
|
+
echo "[$n/$total] $(basename "$dest") $status ${msg:0:200}"
|
|
154
|
+
[ "$status" = REQUEST_SUCCEEDED ] || REFUSED+=("$(basename "$dest") ($status)")
|
|
155
|
+
if [ $n -lt $total ]; then sleep 0.5; fi
|
|
156
|
+
done
|
|
157
|
+
KEY=""
|
|
158
|
+
|
|
159
|
+
echo
|
|
160
|
+
if [ ${#REFUSED[@]} -gt 0 ]; then
|
|
161
|
+
echo "BLS refused some requests (the message above says why, often the daily limit or the key)."
|
|
162
|
+
echo "Upload those files anyway:"
|
|
163
|
+
for w in "${REFUSED[@]}"; do echo " $w"; done
|
|
164
|
+
echo
|
|
165
|
+
fi
|
|
166
|
+
echo "Done. Upload these files to the chat (do not edit them):"
|
|
167
|
+
for f in "${SAVED[@]}"; do echo " $f"; done
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Analysis patterns for BLS time series
|
|
2
|
+
|
|
3
|
+
Read this once at the start of any analysis. It lists the choices that change headline numbers (and
|
|
4
|
+
so become the critical questions), BLS's own conventions to follow, and how a BLS data product is
|
|
5
|
+
laid out.
|
|
6
|
+
|
|
7
|
+
Contents: 1. Critical questions catalog · 2. Conventions · 3. Benchmarks and reliability ·
|
|
8
|
+
4. Typical questions · 5. Publication structure · 6. Chart forms
|
|
9
|
+
|
|
10
|
+
## 1. Critical questions catalog
|
|
11
|
+
Ask only the ones the request leaves open **and** that would change a headline number. Each has a
|
|
12
|
+
default rule for "Don't know — decide empirically".
|
|
13
|
+
|
|
14
|
+
| Choice | Typical options | Default rule when the user does not know |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| **Which measure** | Unemployment: U-3 (official) vs. U-6. Wages: average hourly earnings (CES, all employees or production and nonsupervisory), median weekly earnings (CPS, full-time), ECI (fixed job mix). Inflation: CPI-U, CPI-W, C-CPI-U; headline vs. core. Jobs: payroll (CES) vs. household (CPS) employment | Use the measure BLS leads with in its news release (U-3, CES payrolls, CPI-U headline). For wages, show AHE and say that composition shifts move it (2020); add ECI when the period includes large composition changes |
|
|
17
|
+
| **Seasonal adjustment** | SA vs. NSA | Month-to-month or short-run changes, levels in charts: SA. 12-month changes of the CPI: NSA (BLS's headline 12-month CPI change uses NSA indexes). Import/export price indexes have no SA version: NSA throughout. Annual averages: NSA (BLS computes them from NSA data) |
|
|
18
|
+
| **Frequency** | Monthly, quarterly, annual averages | Monthly for spans up to about 10 years; annual averages for long histories. Use BLS-published annual averages (v2 key) over computed ones |
|
|
19
|
+
| **Period and baseline** | Since a date (Feb 2020 pre-pandemic peak, Jan 2021, 10 years), calendar years, a recession | The business-cycle peak before the event the user cares about (Feb 2020 for the pandemic); otherwise the latest 10 years. Show a sensitivity with one alternative baseline (2019 average) |
|
|
20
|
+
| **Nominal vs. real** | Current dollars vs. constant dollars; deflator CPI-U, CPI-W, C-CPI-U (PCE is BEA, not BLS) | Real, deflated as BLS does it: CPI-W for production and nonsupervisory employees, CPI-U for all employees and other groups (all items, NSA for annual, SA for monthly), base = latest full year; say "in <year> dollars". CPI-U-RS is not in the API |
|
|
21
|
+
| **Change measure** | Net change, percent change, 12-month change, annualized 3- or 6-month rate, CAGR | Follow the series' BLS convention: payrolls as net change (thousands); rates as percentage-point change; prices and wages as 12-month percent change, plus annualized 3-month for momentum |
|
|
22
|
+
| **Geography** | U.S., state (LAUS, CES state), metro, county | As asked. State unemployment: LAUS SA. Note that LAUS and state CES are model-based and revised each March |
|
|
23
|
+
| **Gaps and preliminary data** | Interpolate a missing month or leave it; include preliminary months | Leave gaps empty; compute changes only between published values (say so); include preliminary values but label them |
|
|
24
|
+
| **Comparison groups** | Demographic groups (CPS), industries (CES), areas | As asked; flag thin CPS groups (small groups have wide confidence intervals; use 12-month averages or annual averages) |
|
|
25
|
+
|
|
26
|
+
Ask at most four, in one round. A question about which series ID to use is never put to the user:
|
|
27
|
+
resolve it yourself with the `request_schema` search `describe <ID>` and the tables in `series_ids.md`.
|
|
28
|
+
|
|
29
|
+
## 2. Conventions
|
|
30
|
+
- **Definitions:** unemployment rate = unemployed ÷ labor force; participation rate = labor force ÷
|
|
31
|
+
civilian noninstitutional population; employment-population ratio = employed ÷ population. CES counts
|
|
32
|
+
jobs (a person with two jobs counts twice); CPS counts people.
|
|
33
|
+
- **Units:** CES and CPS levels are in thousands. JOLTS levels are in thousands; rates are percentages.
|
|
34
|
+
CPI is an index (1982-84=100); never report an index level as a price.
|
|
35
|
+
- **Percent changes of indexes:** compute from the published index values (rounded to three decimals) and
|
|
36
|
+
round the result to one decimal; that reproduces BLS's published CPI changes.
|
|
37
|
+
- **Social Security COLA** (SSA's rule, not a BLS series): the CPI-W, not seasonally adjusted (`CWUR0000SA0`),
|
|
38
|
+
averaged over July-September and rounded to three decimals, compared with the same average of the last
|
|
39
|
+
year a COLA was paid; the percent increase rounded to one decimal is the COLA payable from the next
|
|
40
|
+
January. SSA announces it with the September CPI (mid-October); benchmark against SSA's announcement.
|
|
41
|
+
- **12-month change across a gap:** October 2026 vs. October 2025 has no value when October 2025 was not
|
|
42
|
+
collected. Say so; do not substitute September or an interpolated value.
|
|
43
|
+
- **Revisions:** CES revises the two prior months each release and benchmarks every February (back to the
|
|
44
|
+
previous March); seasonal factors for CPI are revised each February for five years; LAUS is revised each
|
|
45
|
+
March; C-CPI-U is final 10 to 12 months later. State the retrieval date (the builder adds it).
|
|
46
|
+
- **January population controls (CPS):** levels shift in January; compare levels across Januaries only with
|
|
47
|
+
a note, or use rates.
|
|
48
|
+
- **Annual averages:** BLS's M13 values are preferred. A computed average needs all 12 months; a year with a
|
|
49
|
+
gap has no computed average (leave it empty).
|
|
50
|
+
- **Recessions (NBER):** March–November 2001, December 2007–June 2009, February–April 2020. Use the note
|
|
51
|
+
"Recessions begin just after a peak in economic activity and run through the subsequent trough."
|
|
52
|
+
- **Correlation, not cause:** a policy or event "coincided with" a change unless a method that supports a
|
|
53
|
+
causal claim was used.
|
|
54
|
+
|
|
55
|
+
## 3. Benchmarks and reliability
|
|
56
|
+
- **Benchmark every headline number** against a BLS publication: the latest news release (Employment
|
|
57
|
+
Situation, CPI, JOLTS, Employment Cost Index, Productivity and Costs, State Employment and Unemployment),
|
|
58
|
+
or the API's own `calculations` (fetch with a key and `"calculations": true`; they arrive as
|
|
59
|
+
`bls_pct_12m`, `bls_net_1m` ... columns). Record the comparison in Data and Methods.
|
|
60
|
+
- **Statistical significance:** BLS tests at the 90-percent level. Published thresholds (read the current
|
|
61
|
+
technical note before using, they are updated; values below are from 2026-10-19):
|
|
62
|
+
- CES total nonfarm monthly change: about ±122,000 (Employment Situation technical note).
|
|
63
|
+
- CPS monthly change in unemployment: about ±425,000; in the unemployment rate: about ±0.3 percentage point.
|
|
64
|
+
- JOLTS: median standard errors in the "significant change" tables on the JOLTS page.
|
|
65
|
+
- CPI: standard errors of 1-, 2-, 6- and 12-month changes on the CPI variance estimates page.
|
|
66
|
+
Compare each change with its threshold before describing it. Call a change "statistically significant"
|
|
67
|
+
only when it exceeds the threshold; otherwise "little changed" (BLS's own phrase) or "about the same".
|
|
68
|
+
- Sampling error does not apply to QCEW (a census of UI records), but revisions do.
|
|
69
|
+
|
|
70
|
+
## 4. Typical questions
|
|
71
|
+
- **Labor market since the pandemic:** unemployment (U-3, U-6), participation and prime-age employment rate,
|
|
72
|
+
payrolls vs. February 2020, job openings and quits. Benchmark: the latest Employment Situation and JOLTS.
|
|
73
|
+
- **Inflation:** 12-month CPI-U change (NSA), core vs. headline, contributions of food, energy, shelter;
|
|
74
|
+
3-month annualized core for momentum. Benchmark: CPI news release table A.
|
|
75
|
+
- **Real wages:** BLS's own real AHE: `CES0500000013` all employees (CPI-U), `CES0500000032` production and
|
|
76
|
+
nonsupervisory employees (CPI-W, `CWSR0000SA0`), as the Real Earnings release reports them; real median weekly
|
|
77
|
+
earnings, `LES1252881600` seasonally adjusted, as the Usual Weekly Earnings release headlines it); ECI vs. CPI over 12 months.
|
|
78
|
+
- **States and metros:** LAUS unemployment rates ranked, change over a year; state payrolls (SM).
|
|
79
|
+
- **Industries:** CES employment by supersector, net change since a baseline; JOLTS by industry.
|
|
80
|
+
- **Productivity and labor costs:** quarterly annualized rates; long-run averages by business cycle.
|
|
81
|
+
|
|
82
|
+
## 5. Publication structure (the report builder's `"mode": "report"`)
|
|
83
|
+
Same exhibit chartbook as the style guide describes:
|
|
84
|
+
1. Cover with the month and year, the title with the period, and an optional hero chart.
|
|
85
|
+
2. **At a Glance:** one framing paragraph (which measures, which period) and 3–5 findings, each with a bold
|
|
86
|
+
lead naming its section.
|
|
87
|
+
3. Contents and List of Exhibits (built automatically).
|
|
88
|
+
4. **Notes About This Report:** calendar years; rounding; seasonal adjustment; dollar year and deflator;
|
|
89
|
+
data source and retrieval date; definitions; preliminary values and gaps; recession shading.
|
|
90
|
+
5. **Introduction:** a lead paragraph with the headline numbers; question-style subsections ("How Has
|
|
91
|
+
Unemployment Changed Since 2019?") and "What Data Were Used?".
|
|
92
|
+
6. **Sections** (2–5): a summary page, then one exhibit per page with 2–4 paragraphs beside the chart
|
|
93
|
+
(level, change, comparison).
|
|
94
|
+
7. **Appendix A: Data and Methods:** series IDs and titles, seasonal adjustment, definitions, computations
|
|
95
|
+
(change measures, deflation, annual averages), benchmark comparisons, significance thresholds,
|
|
96
|
+
limitations. The builder appends the data vintage and the BLS terms statement.
|
|
97
|
+
8. References; About This Document (optional); replication materials and audit trail.
|
|
98
|
+
|
|
99
|
+
Exhibit titles end with the period: "Unemployment Rate, January 2019 to September 2026". The units line
|
|
100
|
+
names the adjustment: "Percent, seasonally adjusted". Source line: "Analyst calculations using data from the
|
|
101
|
+
Bureau of Labor Statistics, Current Population Survey (series LNS14000000)."
|
|
102
|
+
|
|
103
|
+
## 6. Chart forms
|
|
104
|
+
- Trends: line charts, at most 4–5 series; facet rather than crowd. Monthly x-axis labels "Sep 2026".
|
|
105
|
+
- Changes by group at one date: horizontal bars when labels are long (industries, states), columns otherwise.
|
|
106
|
+
- Composition (contributions to CPI change, payroll gains by industry): stacked columns.
|
|
107
|
+
- Index comparisons (wages vs. prices): rebase both to 100 at the same date (a `compute` derive step).
|
|
108
|
+
- No dual axes, no pies, no 3-D. Do not draw a line through a gap: leave the cell empty in the exhibit CSV.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# BLS Public Data API cheat sheet
|
|
2
|
+
|
|
3
|
+
The `fetch` tool already handles all of this. Read this file when you debug an API problem or need a feature
|
|
4
|
+
the bls spec does not expose. Behaviors marked ✔ were tested on 2026-10-19.
|
|
5
|
+
|
|
6
|
+
## Versions and limits (https://www.bls.gov/developers/api_faqs.htm)
|
|
7
|
+
| | v2, registered key | v1, no key |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| Queries per day | 500 | 25 |
|
|
10
|
+
| Series per query | 50 | 25 |
|
|
11
|
+
| Years per query | 20 | 10 |
|
|
12
|
+
| Requests per 10 seconds | 50 | 50 |
|
|
13
|
+
| Annual averages, catalog (titles), net/percent changes | yes | no |
|
|
14
|
+
|
|
15
|
+
- Register at https://data.bls.gov/registrationEngine/ (email + organization; the key arrives by email
|
|
16
|
+
from labstat@bls.gov). **Keys expire after a year**; a rejected key that used to work is usually expired.
|
|
17
|
+
- Daily limits are per key (v2) or per IP address (v1). This server does not count the queries used today;
|
|
18
|
+
only BLS knows how many remain, and it says so only by refusing once the limit is used up.
|
|
19
|
+
- Calling v2 without a key works ✔ but gets v1 limits and no catalog ("The catalog has been disabled for
|
|
20
|
+
this request").
|
|
21
|
+
|
|
22
|
+
## Endpoint
|
|
23
|
+
`POST https://api.bls.gov/publicAPI/v2/timeseries/data/` (or `/v1/`) with `Content-Type: application/json`:
|
|
24
|
+
```json
|
|
25
|
+
{"seriesid": ["LNS14000000", "CES0000000001"], "startyear": "2015", "endyear": "2024",
|
|
26
|
+
"annualaverage": true, "catalog": true, "calculations": true, "aspects": false,
|
|
27
|
+
"registrationkey": "<key>"}
|
|
28
|
+
```
|
|
29
|
+
- `GET .../timeseries/data/<SERIES_ID>` returns the last three years of one series; `?latest=true` the latest value.
|
|
30
|
+
- A bare GET of the endpoint returns HTTP 415 and costs no query ✔ (it shows the host is reachable, but not
|
|
31
|
+
whether POSTs are blocked: see HTTP 503 below).
|
|
32
|
+
- Responses:
|
|
33
|
+
`{"status": "REQUEST_SUCCEEDED", "message": [...], "Results": {"series": [{"seriesID", "data": [...], "catalog"?}]}}`.
|
|
34
|
+
Each observation: `{"year": "2026", "period": "M09", "periodName": "September", "latest": "true",
|
|
35
|
+
"value": "4.2", "footnotes": [{"code": "P", "text": "preliminary"}], "calculations"?: {...}}`.
|
|
36
|
+
|
|
37
|
+
## Gotchas (all handled by fetch; check for them in any code you write yourself)
|
|
38
|
+
- **HTTP 200 even on failure ✔.** Read `status` and `message`. A rejected key gives
|
|
39
|
+
`REQUEST_NOT_PROCESSED` and a message that **echoes the key** ✔, so always pass messages through `redact()`.
|
|
40
|
+
- **Silent truncation ✔.** Asking v1 for more than 10 years returns `REQUEST_SUCCEEDED` with only 10 years
|
|
41
|
+
and the message "Year range has been reduced to the system-allowed limit of 10 years." fetch splits
|
|
42
|
+
the request so this never happens and stops if it does.
|
|
43
|
+
- **Bad series IDs do not fail the request ✔.** The series comes back with `"data": []` and a message such as
|
|
44
|
+
"Series does not exist", "Database is locked for Series X" or "No Data Available for Series X Year: 2024".
|
|
45
|
+
fetch lists them in `problems`.
|
|
46
|
+
- **Missing values ✔** come as `"value": "-"` with a footnote, for example code `X` / `9` "Data unavailable due
|
|
47
|
+
to the 2025 lapse in appropriations" (October 2025 CPI, CPS and LAUS were not collected) or code `10`
|
|
48
|
+
(CPS weekly earnings, 2025 Q4 not produced). They are empty in `bls_series.csv`.
|
|
49
|
+
- **"Unable to get Catalog Data for series X" ✔** can come back for some series (JOLTS, for example) even on v1,
|
|
50
|
+
which never asks for the catalog. It is informational: the data are complete. It is kept in
|
|
51
|
+
`series.csv` `bls_messages`; titles then come from data.bls.gov (`request_schema` search `describe <ID>`).
|
|
52
|
+
- **Preliminary values ✔** carry footnote code `P` (CES: the two latest months; JOLTS and LAUS: the latest).
|
|
53
|
+
- **Population controls ✔.** CPS January values carry footnote code `12` when new population controls were
|
|
54
|
+
introduced: levels (employment, labor force) are not comparable from December to January; rates are
|
|
55
|
+
little affected. Say so when comparing levels across January.
|
|
56
|
+
- **Periods:** `M01`–`M12` months, `M13` annual average (v2 with `annualaverage`), `Q01`–`Q04` quarters,
|
|
57
|
+
`Q05` annual average of a quarterly series, `S01`/`S02` half-years, `S03` annual, `A01` annual (OEWS).
|
|
58
|
+
- **Calculations** (v2): `net_changes` and `pct_changes` over 1, 3, 6 and 12 months, BLS's own numbers.
|
|
59
|
+
They are the best benchmark for changes you compute (`bls_pct_12m` etc. in `bls_series.csv`).
|
|
60
|
+
- HTTP 429 means the rate or daily limit was hit; the client backs off once, then fetch fails with
|
|
61
|
+
`agency_unavailable` (the daily limit resets the next day).
|
|
62
|
+
- HTTP 503 "The BLS website is busy" (an HTML page) can answer POSTs for hours while the bare GET still
|
|
63
|
+
answers 415 (seen 2026-10-22); after retries fetch fails with `agency_unavailable`.
|
|
64
|
+
|
|
65
|
+
## Other BLS data services (not used by fetch)
|
|
66
|
+
- QCEW has its own open-data CSV slices (https://www.bls.gov/cew/additional-resources/open-data/); QCEW
|
|
67
|
+
series (prefix EN) are also in the time-series API.
|
|
68
|
+
- Bulk flat files (download.bls.gov/pub/time.series/) need a User-Agent with a contact email; this pack does
|
|
69
|
+
not use them. A very large request (hundreds of series) is split across days or narrowed instead.
|
|
70
|
+
- Web pages on www.bls.gov often answer HTTP 403 to scripts and to WebFetch. Read publications in the
|
|
71
|
+
browser, or through the Wayback Machine (`https://web.archive.org/web/<year>/<url>`), and cite the original URL.
|
|
72
|
+
`https://data.bls.gov/timeseries/<ID>` (series titles, used by the `request_schema` search `describe <ID>`)
|
|
73
|
+
does answer scripts ✔.
|