Create an Analysis

Creating an Analysis is the first step in understand which types of events impact your demand.

Request

HTTP Request

POST https://api.predicthq.com/v1/beam/analyses

Request Headers

HeaderValue

Content-Type

application/json

Request Body

FieldDescription

name string required

Name of an analysis. E.g. My Location Analysis 1

location.* object required

This should be the location of your data. We will use this location for our time series modelling and to correlate with events in the specified area.

{
  "geopoint": {
    "lat": "-36.849761",
    "lon": "174.7628903"
  },
  "radius": 1.2,
  "unit": "km"
}

We recommend using the Suggested Radius API to find a suitable radius for your location/industry. Possible radius units: mi - Miles m - Meters km - Kilometers

rank.* object required

Specifies which rank type to use when calculating event impacts and anomaly detection. If you're unsure which to use we recommend using phq.

{
  "type": "phq"
}

Possible rank type values: phq - PHQ Rank aviation - Aviation Rank Optionally, specify the minimum rank level to use when calculating event impacts.

E.g.

{
  "type": "phq",
  "levels": {
    "phq": {
      "min": 51
    }
  }
}

tz string optional

Time zone of the location in TZ Database format. E.g. Pacific/Auckland

Note: this field is being used in the Control Center Beam UI for the purpose of fetching a list of relevant events in the correct time zone. It no longer has bearing on the outcome of a Beam analysis.

Response

Example response

Below is an example response:

{
  "analysis_id": "2iJcUzm3-ZE"
}

Examples

curl -X POST https://api.predicthq.com/v1/beam/analyses \
     -H "Accept: application/json" \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     --data @<(cat <<EOF
    {
        "name": "Analysis 1",
        "location": {
            "geopoint": {
                "lat": "-36.849761",
                "lon": "174.7628903"
            },
            "radius": 1.2,
            "unit": "km"
        },
        "rank": {
            "type": "phq"
        }
    }
    EOF
    )

Guides

Below are some guides relevant to this API:

Last updated

© 2024 PredictHQ Ltd