Find an API

Search public APIs with auth details & Postman guides

← All APIs

FRED API (Federal Reserve)

api.stlouisfed.org · Finance

Finance API Key Free Tier Economics Finance Government

Federal Reserve Economic Data — 800,000+ US and international economic time series: GDP, inflation, unemployment, interest rates, exchange rates, and more. Free API key required.

Authentication

API Key Free API key at fred.stlouisfed.org/docs/api/fred/. Pass as &api_key= query parameter.

Sample Requests

GET Get GDP data

Get latest US GDP observations.

https://api.stlouisfed.org/fred/series/observations?limit=10&api_key=YOUR_API_KEY&file_type=json&series_id=GDP&sort_order=desc

Hover any highlighted part to learn what it does

curl -X GET "https://api.stlouisfed.org/fred/series/observations?limit=10&api_key=YOUR_API_KEY&file_type=json&series_id=GDP&sort_order=desc"
import requests
params = {
    "limit": "10",
    "api_key": "YOUR_API_KEY",
    "file_type": "json",
    "series_id": "GDP",
    "sort_order": "desc"
}
response = requests.get(
    "https://api.stlouisfed.org/fred/series/observations",
    params=params,
)
print(response.json())
const url = new URL('https://api.stlouisfed.org/fred/series/observations');
url.searchParams.set('limit', '10');
url.searchParams.set('api_key', 'YOUR_API_KEY');
url.searchParams.set('file_type', 'json');
url.searchParams.set('series_id', 'GDP');
url.searchParams.set('sort_order', 'desc');

const response = await fetch(url); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	baseURL, _ := url.Parse("https://api.stlouisfed.org/fred/series/observations")
	q := baseURL.Query()
	q.Set("limit", "10")
	q.Set("api_key", "YOUR_API_KEY")
	q.Set("file_type", "json")
	q.Set("series_id", "GDP")
	q.Set("sort_order", "desc")
	baseURL.RawQuery = q.Encode()
	targetURL := baseURL.String()
	req, _ := http.NewRequest("GET", targetURL, nil)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://api.stlouisfed.org/fred/series/observations")
uri.query = URI.encode_www_form({
  "limit" => "10",
  "api_key" => "YOUR_API_KEY",
  "file_type" => "json",
  "series_id" => "GDP",
  "sort_order" => "desc"
})

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Get.new(uri)

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://api.stlouisfed.org/fred/series/observations?" . http_build_query([
    "limit" => "10",
    "api_key" => "YOUR_API_KEY",
    "file_type" => "json",
    "series_id" => "GDP",
    "sort_order" => "desc"
]);
$opts = ["http" => [
    "method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET Search series

Search for economic data series.

https://api.stlouisfed.org/fred/series/search?limit=5&api_key=YOUR_API_KEY&file_type=json&search_text=unemployment rate

Hover any highlighted part to learn what it does

curl -X GET "https://api.stlouisfed.org/fred/series/search?limit=5&api_key=YOUR_API_KEY&file_type=json&search_text=unemployment%20rate"
import requests
params = {
    "limit": "5",
    "api_key": "YOUR_API_KEY",
    "file_type": "json",
    "search_text": "unemployment rate"
}
response = requests.get(
    "https://api.stlouisfed.org/fred/series/search",
    params=params,
)
print(response.json())
const url = new URL('https://api.stlouisfed.org/fred/series/search');
url.searchParams.set('limit', '5');
url.searchParams.set('api_key', 'YOUR_API_KEY');
url.searchParams.set('file_type', 'json');
url.searchParams.set('search_text', 'unemployment rate');

const response = await fetch(url); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	baseURL, _ := url.Parse("https://api.stlouisfed.org/fred/series/search")
	q := baseURL.Query()
	q.Set("limit", "5")
	q.Set("api_key", "YOUR_API_KEY")
	q.Set("file_type", "json")
	q.Set("search_text", "unemployment rate")
	baseURL.RawQuery = q.Encode()
	targetURL := baseURL.String()
	req, _ := http.NewRequest("GET", targetURL, nil)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://api.stlouisfed.org/fred/series/search")
uri.query = URI.encode_www_form({
  "limit" => "5",
  "api_key" => "YOUR_API_KEY",
  "file_type" => "json",
  "search_text" => "unemployment rate"
})

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Get.new(uri)

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://api.stlouisfed.org/fred/series/search?" . http_build_query([
    "limit" => "5",
    "api_key" => "YOUR_API_KEY",
    "file_type" => "json",
    "search_text" => "unemployment rate"
]);
$opts = ["http" => [
    "method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));

Postman Setup Guide

Get Postman ↗
  1. Request a free API key at fred.stlouisfed.org/docs/api/fred/
  2. Pass as api_key= query param and file_type=json
  3. Key series: GDP (US GDP), UNRATE (unemployment), CPIAUCSL (CPI inflation), FEDFUNDS (Fed funds rate)
  4. Try GET /fred/series/observations?series_id=UNRATE&api_key=YOUR_KEY&file_type=json&limit=12&sort_order=desc

Open documentation ↗