1 unstable release
0.1.0 | May 21, 2022 |
---|
#182 in #rest
32KB
778 lines
Freddo
This is an opinionated library for accessing the Federal Reserve of St Louis data API. It may not implement all the functionalities of the API.
For a like-for-like implementation of the API in Rust, see fred-rs
.
Pre-requisites
- You will need an API key that can be generated here
- To use the library, store the API key as the environment variable
FRED_API_KEY
General structure
- A
client
stores the API key and the base URLs that are needed to interact with the API - The use of the library starts with the construction of a
query
- Each
query
belongs to one of the three types: - Each query has an
execute
method to carry out the request
lib.rs
:
Freddo is an opinionated way to access the Federal Reserve of St. Louis Data API.
Everything starts by instantiating a Query.
There are 3 types of queries.
data
: Gets observation data from the APIsearch
: Search for data series via search textinfo
: Gets metadata associated with a data series
Calling the execute
method on a query
will send the REST request via a client
which stores session parameters and the API key.
Dependencies
~4–16MB
~216K SLoC