主要内容

getData

Retrieve data from CoreLogic

Since R2026a

    Description

    [data,response] = getData(c,httpMethod,stubAPI,corelogicParams) retrieves CoreLogic® climate and property data, where c is a corelogic connection object, httpMethod represents the HTTP request type, stubAPI represents the API stub for the CoreLogic endpoint, and corelogicParams contains a list of parameters that specify the HTTP body for GET requests. For more information about the CoreLogic API, see the documentation on the CoreLogic website.

    example

    Examples

    collapse all

    This example assumes that you have obtained your user credentials from CoreLogic and you stored them in the MATLAB® vault by using the setSecret function.

    Use the getSecret function to retrieve the ConsumerKey and ConsumerSecret from the MATLAB vault. Then, create a connection to the CoreLogic data server by using the corelogic function.

    ConsumerKey = getSecret("ConsumerKeyCoreLogic");
    ConsumerSecret = getSecret("ConsumerSecretCoreLogic");
    c = corelogic(ConsumerKey,ConsumerSecret)

    Retrieve hurricane hazard data for a GET HTTP request by using the getData function. This example uses the API stub, "spatial-api/us-hurricane-hazard" for the CoreLogic endpoint. Specify the latitude and longitude for the CoreLogic data request.

    httpMethod = "GET";
    stubAPI = "spatial-api/us-hurricane-hazard";
    [data,response] = getData(c,httpMethod,stubAPI,"latitude",42.28,"longitude",-71.34)
    data =
         1×7 table
              WindSpeedExposure50 WindSpeedExposure100 WindSpeedExposure250 WindSpeedExposure500 DistanceToCoast GroundElev    location
              ___________________ ____________________ ____________________ ____________________ _______________ _____________ __________
     
              74.00               81.24                88.74                93.00                {'14.74 mi'}    {'189.97 ft'} 1×1 struct
    
    response = 
    
      ResponseMessage with properties:
    
      StatusLine: 'HTTP/1.1 200 OK'
      StatusCode: OK
          Header: [1×19 matlab.net.http.HeaderField]
            Body: [1×1 matlab.net.http.MessageBody]
        Completed: 0

    Input Arguments

    collapse all

    CoreLogic connection, specified as a corelogic object.

    HTTP method, specified as a string scalar or character vector representing the type of HTTP request to make on the CoreLogic data server. To retrieve data from the data server, set httpMethod to "GET".

    Example: httpMethod = "GET"

    API stub for the CoreLogic endpoint, specified as a string scalar or character vector. For more information about the API stubs that you can specify, see the API documentation on the CoreLogic website.

    Example: stubsAPI = "spatial-api/flood-risk-score"

    CoreLogic API arguments, specified as a comma-separated list. Use this input argument to specify the HTTP body for GET requests. For example, [data,response] = getData(c,"GET",stubAPI,"latitude",42.28,"longitude",-71.34) retrieves data for a specified set of latitude-longitude values. For more information about CoreLogic parameters that you can specify, see the API documentation on the CoreLogic website.

    Output Arguments

    collapse all

    CoreLogic climate and property data, returned as a table. CoreLogic provides access to the following data categories:

    • Property records

    • Natural hazard risk (physical risk)

    • Property mapping visualization data

    • Property data for insurance solutions

    • Property parcel information

    • Weather event monitoring

    • Tax servicing

    • Historical post weather events

    • Property fraud risk

    • Legal information

    • Property ownership reports

    For more information about these categories, see the API documentation on the CoreLogic website.

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

    Version History

    Introduced in R2026a