Main Content


Retrieve HaverView recession information

Since R2024a


    data = recessions(c) returns all available HaverView™ recession information, where c is a haverview connection object.


    data = recessions(c,ID) returns recession information for the specified ID.

    data = recessions(c,ID,haverParams) returns recession information, where haverParams is an optional comma-separated list of HaverView API flags. For more information, see the Haver API documentation.

    [data,response] = recessions(___) also returns a response message.


    collapse all

    Create a HaverView connection using a valid authentication token and database name. In this example, replace 681b61cf-dc7d-4698-a168-74c79b0c1a04 with your authentication token and replace USECON with the name of your database.

    token = "681b61cf-dc7d-4698-a168-74c79b0c1a04";
    databasename = "USECON";
    c = haverview(token,databasename)
    c = 
      haverview with properties:
        DatabaseName: "USECON"
             TimeOut: 200.00

    Return recession information corresponding to a specific ID.

    ID = "116";
    data = recessions(c,ID)
    data =
          1x5 table
            index      startDate       country       endDate          id  
            _____    ______________    _______    ______________    ______
            1.00     {'2007-12-01'}    {'USA'}    {'2009-07-01'}    116.00

    Input Arguments

    collapse all

    HaverView connection, specified as a haverview object.

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

    HaverView API arguments, specified as a comma-separated list. For more information, see the Haver API documentation.

    Output Arguments

    collapse all

    Recession data for the HaverView recession ID, returned as a table.

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

    Version History

    Introduced in R2024a