For the complete documentation index, see llms.txt. This page is also available as Markdown.

Search events for a Saved Location

Search for events happening in an existing Saved Location.

Search Events for a Saved Location

get

Returns events that impact the specified Saved Location. Please refer to the Events API docs for the available query parameters in addition to those listed below.

Authorizations
AuthorizationstringRequired

Enter your PredictHQ API key. The Bearer prefix is added automatically.

When calling the API directly, send: Authorization: Bearer <YOUR_API_KEY> as documented at https://docs.predicthq.com/api/overview/authenticating

Path parameters
location_idstringRequired

An existing Saved Location ID.

Query parameters
date_range_typeconst: next_90dOptional

The type of date range for insight calculations. Currently only next_90d is supported.

offsetintegerOptional

Offset the results.

Default: 0
limitintegerOptional

Limit the number of results.

Default: 10
Responses
200

Successful Response

application/json

A paginated list of events impacting a Saved Location.

countintegerRequired

Total number of results found.

get/v1/saved-locations/{location_id}/insights/events
GET /v1/saved-locations/{location_id}/insights/events HTTP/1.1
Host: api.predicthq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "count": 1,
  "results": [
    {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ]
}

Examples

curl --location 'https://api.predicthq.com/v1/saved-locations/0b6ZrOnTdB2Y7k4zC_9qBg/insights/events?date_range_type=next_90d&category=public-holidays%2Csports&sort=start' \
--header 'Authorization: Bearer TOKEN'
import requests

url = "https://api.predicthq.com/v1/saved-locations/0b6ZrOnTdB2Y7k4zC_9qBg/insights/events?date_range_type=next_90d&category=public-holidays,sports&sort=start"

payload={}
headers = {
  'Authorization': 'Bearer TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

OpenAPI Spec

The OpenAPI spec for Saved Locations API can be found here.

Guides

Below are some guides relevant to this API:

Last updated

Was this helpful?