Contenido principal

release

Retrieve FRED release information

Since R2026a

    Description

    d = release(c,s) returns a table that contains metadata for a Federal Reserve Economic Data (FRED®) release, where c is a fredrs connection object and s is the release ID.

    example

    d = release(c,s,t) specifies the type of release information, t, to retrieve. For example, release(c,s,"tags") returns the tags associated with a given release ID.

    d = release(c,s,t,fredParams) additionally specifies a comma-separated list of FRED REST API parameters. For example, release(c,"53","tags","sort_order","asc") returns a table with the tags for release 53 sorted in ascending order. For more details on specifying FRED parameters, see the FRED REST API documentation.

    [d,response] = release(___) also returns a response message for any of the previous syntaxes.

    Examples

    collapse all

    This example assumes that you have obtained your API user token from the Federal Reserve Bank of St. Louis website and you stored it in the MATLAB® vault by using the setSecret function.

    Use the getSecret function to retrieve your API user token from the MATLAB vault. Then, create a connection to the FRED server by using the fredrs function.

    APIkey = getSecret("MyAPIkeyFREDRS");
    c = fredrs(APIkey);

    Retrieve the release metadata for release 53.

    s = "53";
    [d,response] = release(c,s)
    d =
    
      1×3 table
    
        realtime_start    realtime_end                                                                   releases                                                               
        ______________    ____________    ______________________________________________________________________________________________________________________________________
    
                                          id    realtime_start    realtime_end             name             press_release                           link                        
                                          __    ______________    ____________    ______________________    _____________    ___________________________________________________
                                                                                                                                                                                
         20-Nov-2025      20-Nov-2025     53     20-Nov-2025      20-Nov-2025     Gross Domestic Product        true         https://www.bea.gov/data/gdp/gross-domestic-product
    
    response = 
    
      ResponseMessage with properties:
    
        StatusLine: 'HTTP/1.1 200 OK'
        StatusCode: OK
            Header: [1×13 matlab.net.http.HeaderField]
              Body: [1×1 matlab.net.http.MessageBody]
         Completed: 0

    Retrieve the time series for release 53.

    t = "series";
    d = release(c,s,t)
    d =
    
      1×8 table
    
        realtime_start    realtime_end      order_by       sort_order    count    offset    limit        seriess    
        ______________    ____________    _____________    __________    _____    ______    _____    _______________
    
         21-Nov-2025      21-Nov-2025     {'series_id'}     {'asc'}      12715      0       1000     {1000×16 table}

    Input Arguments

    collapse all

    FRED REST connection, specified as a fredrs object.

    Release ID, specified as a string scalar or character vector.

    Example: s = "53"

    Data Types: string | char

    Type of release information, specified as a string scalar or character vector. For a given release, you can specify any of the following types:

    • "dates" – Get the dates.

    • "series" – Get the series.

    • "sources" – Get the sources.

    • "tags" – Get the tags.

    • "related_tags" – Get the related tags.

    • "tables" – Get the tables.

    Data Types: string | char

    FRED REST API arguments, specified as a comma-separated list. For example, release(c,"53","tags","sort_order","desc") retrieves the tags for release 53 sorted in descending order. For more information about specifying FRED parameters, see the FRED REST API documentation.

    Output Arguments

    collapse all

    FRED release information, returned as a table.

    HTTP request response, returned as a ResponseMessage object. For details, see matlab.net.http.ResponseMessage.

    Version History

    Introduced in R2026a