Create an Analysis

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

Create an Analysis

post

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

Authorizations
Body
namestring · min: 1Required

Name of an analysis.

Example: My Location Analysis 1
external_idstring · min: 1Optional

External identifier associated with the Analysis (optional, user-defined).

Example: {"external_id":"abc123"}
labelstring[] · min: 1Optional

Comma-separated list of labels that can be used to search and filter analyses.

Example: ["label1","label2","label3"]
Responses
201

Successful Response

application/json
post
/v1/beam/analyses
POST /v1/beam/analyses HTTP/1.1
Host: api.predicthq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 358

{
  "name": "My Location Analysis 1",
  "location": {
    "saved_location_id": "8gZ2rn8BRcTjM_3SWdjP"
  },
  "demand_type": {
    "demand_type": {
      "industry": "restaurants",
      "currency_code": "USD",
      "unit_currency_multiplier": 1,
      "unit_descriptor": "Sales"
    }
  },
  "external_id": {
    "external_id": "abc123"
  },
  "label": [
    "label1",
    "label2",
    "label3"
  ],
  "rank": {
    "rank": {
      "type": "phq",
      "levels": {
        "phq": {
          "min": 51
        }
      }
    }
  }
}
{
  "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"
        },
        "demand_type": {
            "industry": "restaurants"
        },
        "rank": {
            "type": "phq"
        }
    }
    EOF
    )

OpenAPI Spec

The OpenAPI spec for Beam API can be found here.

Guides

Below are some guides relevant to this API:

Last updated

Was this helpful?