Documentation

fetch

Request data from FRED data servers

Syntax

data = fetch(Connect, 'Series')
data = fetch(Connect, 'Series', 'D1')
data = fetch(Connect, 'Series', 'D1', 'D2')

Arguments

Connect

FRED® connection object created with the fred function.

'Series'

MATLAB® string containing the name of a series in a format recognizable by the FRED server.

'D1'

MATLAB string or date number indicating the date from which to retrieve data.

'D2'

MATLAB string or date number indicating the date range from which to retrieve data.

Description

For a given series, fetch returns historical data using the connection to the FRED data server.

data = fetch(Connect, 'Series') returns data for Series, using the connection object Connect.

data = fetch(Connect, 'Series', 'D1') returns data for Series, using the connection object Connect, for the date D1.

data = fetch(Connect, 'Series', 'D1', 'D2') returns all data for Series, using the connection object Connect, for the date range 'D1' to 'D2'.

    Note:   You can specify dates in any of the formats supported by datestr and datenum that show a year, month, and day.

Examples

Fetch all available daily U.S. dollar to European foreign exchange rates.

d = fetch(f,'DEXUSEU')
d = 
                 Title: 'U.S. / Euro Foreign Exchange Rate'
              SeriesID: 'DEXUSEU'
                Source: 'Board of Governors of the Federal Reserve System'
               Release: 'H.10 Foreign Exchange Rates'
    SeasonalAdjustment: 'Not Applicable'
             Frequency: 'Daily'
                 Units: 'U.S. Dollars to One Euro'
             DateRange: '1999-01-04 to 2006-06-19'
           LastUpdated: '2006-06-20 9:39 AM CT'
                 Notes: 'Noon buying rates in New York City for 
                          cable transfers payable in foreign currencies.'
                  Data: [1877x2 double]

Data is an N-by-2 element double array that contains dates in the first column and the series values in second column.

Fetch data for 01/01/2007 through 06/01/2007.

d = fetch(f, 'DEXUSEU', '01/01/2007', '06/01/2007')
d = 
                 Title: ' U.S. / Euro Foreign Exchange Rate'
              SeriesID: ' DEXUSEU'
                Source: ' Board of Governors of the Federal Reserve System'
               Release: ' H.10 Foreign Exchange Rates'
    SeasonalAdjustment: ' Not Applicable'
             Frequency: ' Daily'
                 Units: ' U.S. Dollars to One Euro'
             DateRange: ' 1999-01-04 to 2006-06-19'
           LastUpdated: ' 2006-06-20 9:39 AM CT'
                 Notes: ' Noon buying rates in New York City for 
                          cable transfers payable in foreign currencies.'
                  Data: [105x2 double]

Data is an N-by-2 element double array that contains dates in the first column and the series values in second column.

See Also

| |

Was this topic helpful?