Rust client for the FRED API — economic time series from the Federal Reserve. Async, typed, JSON only.
FRED is a database of economic time series maintained by the Federal Reserve Bank of St. Louis. Thousands of series from national, international, public, and private sources.
Categories, series, observations, releases, sources, tags, search, and GeoFRED (regional data).
Add this to your Cargo.toml:
[dependencies]
fred-api-client = "1.0.0"Or install using cargo:
cargo add fred-api-clientGet a FRED API key, then:
use fred_api_client::{apis::default_api, apis::configuration::Configuration};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = Configuration {
base_path: "https://api.stlouisfed.org".to_string(),
..Default::default()
};
// Get GDP series data
let response = default_api::fred_series_get(
&config,
"your_api_key_here",
"GDP",
Some("json"),
None,
None,
).await?;
println!("GDP Series Info: {}", response);
Ok(())
}| Endpoint | What you get |
|---|---|
| Categories | Browse and search category trees, list series in a category |
| Series | Observations, metadata, vintage dates, text/tag search |
| Releases | Release schedules, sources, related series |
| Sources | Data source metadata and their releases |
| Tags | Filter and browse by tag, find related tags |
| GeoFRED | Regional economic data and shape files |
- API Reference
- FRED API docs
cargo doc --open
Check out the examples/ directory for more usage examples:
cargo run --example basic_usage
cargo run --example series_observations
cargo run --example category_search- Commercial support: christian@aktagon.com
- Issues: GitHub Issues
MIT. This is an unofficial client. FRED is a registered trademark of the Federal Reserve Bank of St. Louis.