Main Content

haverview

Create HaverView cloud connection

Since R2024a

    Description

    The haverview function creates an object that represents a connection to the HaverView™ cloud platform. After you create a haverview object, you can retrieve historical data for a specified range as well as information about database lists, variables, recessions, and currencies.

    Accessing the HaverView platform requires an authentication token from Haver Analytics®. For details on obtaining a token, see https://haverproducts.com/.

    From MATLAB®, you can retrieve HaverView data by following these steps:

    1. Create a HaverView connection by using the haverview function.

    2. List available databases by using the databases function.

    3. List database variables by using the info function.

    4. Retrieve data by using the fetch function.

    Creation

    Description

    example

    c = haverview(token,databasename) creates a connection to a database on the HaverView cloud platform using a valid authentication token.

    example

    c = haverview(token,databasename,timeout,url,mediatype,debugmodevalue) sets the timeout value, the HaverView base endpoint URL, the REST API call media type, and the MATLAB HTTP library debug value.

    Input Arguments

    expand all

    HaverView authentication token, specified as a character vector or string scalar. This argument sets the Token property.

    Example: "681b61cf-dc7d-4698-a168-74c79b0c1a04"

    HaverView database name, specified as a character vector or string scalar. This argument sets the DatabaseName property.

    Example: "USECON"

    Timeout value for HaverView REST API call responses, specified as a positive numeric scalar. This argument sets the TimeOut property.

    HaverView base endpoint URL, specified as a character vector or string scalar. This argument sets the URL property.

    REST API call media type, specified as a character vector or string scalar. This argument sets the MediaType property.

    MATLAB HTTP library debug mode, specified as a numeric scalar. You can control the amount of diagnostic information that returns when making data requests by setting this argument as follows:

    • 0 returns no output.

    • 1 returns partial output.

    • 2 returns complete output.

    This argument sets the DebugModeValue property.

    Properties

    expand all

    HaverView database name, specified as a character vector or string scalar. This property is set by the databasename argument.

    Public

    Timeout value for HaverView REST API call responses, specified as a positive numeric scalar. This property is set by the timeout argument.

    Private

    HaverView authentication token, specified as a character vector or string scalar. This property is set by the token argument.

    Hidden

    MATLAB HTTP library debug mode, specified as a numeric scalar. You can control the amount of diagnostic information that returns when making data requests by setting this property as follows:

    • 0 returns no output.

    • 1 returns partial output.

    • 2 returns complete output.

    This property is set by the debugmodevalue argument.

    REST API call media type, specified as a character vector or string scalar. This property is set by the mediatype argument.

    HaverView base endpoint URL, specified as a character vector or string scalar. This property is set by the url argument.

    Object Functions

    databasesRetrieve HaverView database information
    fetchRequest data from Haver Analytics database
    infoRetrieve information about Haver Analytics variables
    searchSearch for HaverView variables
    seriesRetrieve HaverView series information
    recessionsRetrieve HaverView recession information
    currenciesRetrieve HaverView currency information

    Examples

    collapse all

    Create a HaverView connection by 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

    Version History

    Introduced in R2024a