Processing Financial Data with FRED API: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 14: Line 14:
</syntaxhighlight>
</syntaxhighlight>


=Code Examples=
Search for a dataset using full text search. The result is a [[Pandas_DataFrames|DataFrame]].


==Search==
<syntaxhighlight lang='py'>
<syntaxhighlight lang='py'>
df = fred.search("S&P", limit=1000, order_by=None, sort_order=None, filter=None)
</syntaxhighlight>
fred.search("text", limit=1000, order_by=None, sort_order=None, filter=None)
fred.search("text", limit=1000, order_by=None, sort_order=None, filter=None)
</syntaxhighlight>
</syntaxhighlight>

Revision as of 19:36, 8 October 2023

Internal

Overview

This article describes the sequence of steps required to process financial data obtained from FRED API.

Procedure

Import the package and establish a connection to the FRED backend, providing the API Key obtained as described here.

from fredapi import Fred
fred = Fred(api_key='...')

Search for a dataset using full text search. The result is a DataFrame.

df = fred.search("S&P", limit=1000, order_by=None, sort_order=None, filter=None)

fred.search("text", limit=1000, order_by=None, sort_order=None, filter=None) </syntaxhighlight> Do a full text search for series in the FRED data set. Returns the results as a data frame.

Get Series