Create an Analysis
Creating an Analysis is the first step in understand which types of events impact your demand.
Creating an Analysis is the first step in understanding which types of events impact your demand.
Authorizations
Body
namestring · min: 1RequiredExample:
Name of an analysis.
My Location Analysis 1external_idstring · min: 1OptionalExample:
External identifier associated with the Analysis (optional, user-defined).
{"external_id":"abc123"}labelstring[] · min: 1OptionalExample:
Comma-separated list of labels that can be used to search and filter analyses.
["label1","label2","label3"]Responses
201
Successful Response
application/json
422
Validation Error
application/json
post
/v1/beam/analysesPOST /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
)import requests
response = requests.post(
url="https://api.predicthq.com/v1/beam/analyses",
headers={
"Authorization": "Bearer $ACCESS_TOKEN",
"Accept": "application/json"
},
json={
"name": "Analysis 1",
"location": {
"geopoint": {
"lat": "-36.849761",
"lon": "174.7628903"
},
"radius": 1.2,
"unit": "km"
},
"demand_type": {
"industry": "restaurants"
},
"rank": {
"type": "phq"
}
}
)
print(response.json())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?