Page
Library
Module
Module type
Parameter
Class
Class type
Source
API Documentation: https://gborough.github.io/fred/fred/fred/index.html
API binding for FRED, the Federal Reserve Economic Data set(https://fred.stlouisfed.org/)
Up-to-date as of April 2024
Visit https://fredaccount.stlouisfed.org/login/secure/ and register for an account to obtain API key
This library is organised in modules that reflect available FRED API endpoints:
The general steps are:
Example of a full Categories Series query:
open Fred
let api_key = Conf.api_key_of_string "abcdefghijklmnopqrstuvwxyz123456" in
(* or set API key in FRED_API_KEY env variable, using Conf.api_key_of_env *)
let query =
Categories_query.make_series_query ~realtime_start:"2024-04-11" ~realtime_end:"2024-04-11"
~limit:1 ~offset:1 ~order_by:Models.Series.Title
~sort_order:Models.Sort_order.Ascending
~filter_variable:Models.Series.Frequency ~filter_value:"Quarterly"
~tag_names:"income;bea" ~exclude_tag_names:"discontinued;annual"
~category_id:125 ()
(* make query with various parameters *)
in
let run = Categories_query.run_series_query ~query:query ~api_key:api_key in
(* run query *)
let res = get_result run in
(* get result *)
match res with
| Ok r -> (* handle returned categories type *)
| Error e -> (* handle returned api_error type *)
Supported Platforms: UNIX
Caveats:
This project is licensed under the MIT license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in fred by you, shall be licensed as MIT, without any additional terms or conditions.