Search Analyses

Search for an existing Analysis.

Request

HTTP Request

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

Query Parameters

ParameterDescription

status string

Comma separated list (<status1>,<status2>) used to filter Beam analyses by their status. Possible values:

  • active

  • deleted

E.g. ?status=active,deleted

readiness_status string

Comma separated list (<readiness_status1>,<readiness_status2>) used to filter Beam analyses by their readiness status. Possible values:

  • pending

  • failed

  • ready

E.g. ?status=pending,ready

group_id string

Comma separated list of Analysis Group ID. Analyses that belong to this group will be returned. E.g., ?group_id=H3ED1zxXqAY

demand_type.interval string

Allows to filter analyses by their detected demand type.

Possible values:

  • day - for daily analyses. Note that empty analyses are assumed to be daily

  • week - for weekly analyses

demand_type.industry string

Allows to filter analyses by one or more industries.

Possible values:

  • accommodation

  • cpg

  • tourism

  • marketing

  • parking

  • restaurants

  • retail

  • transportation

  • other

E.g. ?demand_type.industry=accommodation,tourism

external_id

string

Comma-separated list of External IDs. E.g., ?external_id=id1,id2

label

string

Comma-separated list of labels.

E.g. ?label=label1,label2,label3

sort string

Comma separated list (<sort1>,<sort2>) used to sort Beam analyses. Possible values:

  • name - Sort by name A-Z

  • -name - Sort by name Z-A

  • created - Sort by created date oldest to newest

  • -created - Sort by created date newest to oldest

  • updated - Sort by updated date earliest to latest

  • -updated - Sort by updated date latest to earliest

E.g. ?sort=name,created

limit number

Limits the length of the Beam analyses list returned. The default limit is 10. E.g. ?limit=20

offset number

Specifies starting offset of the Beam analyses list returned. The default offset is 0. E.g. ?offset=3

Response

Response Fields

FieldDescription

count number

Total number of results found.

analyses array

List of results where each item is an Analysis.

Please refer to the response fields section in Get an Analysis for the structure of each record.

Example response

Below is an example response:

{
    "count": 1,
    "analyses": [
        {
            "name": "Analysis 1",
            "location": {
                "geopoint": {
                    "lat": "-36.85088270000001",
                    "lon": "174.7644881"
                },
                "radius": 10,
                "unit": "km"
            },
            "rank": {
                "type": "phq",
                "levels": {
                    "phq": {
                        "min": 51
                    }
                }
            },
            "status": "draft",
            "create_dt": "2021-08-19T23:46:49.172401+00:00",
            "update_dt": "2021-08-20T00:20:19.770461+00:00",
            "user_id": "user_id",
            "access_type": "full",
            "processed_dt": "2021-08-19T23:50:53.456047+00:00",
            "readiness_status": "ready",
            "readiness_checks": {
                "date_range": {
                    "start": "2021-01-01",
                    "end": "2021-12-31"
                },
                "validation_response": {
                    "missing_data_percentage": 0.0,
                    "consecutive_nan": 0
                }
            },
            "demand_type": {
                "interval": "week",
                "week_start_day": "sunday"
            },
            "analysis_id": "analysis_id",
            "external_id": "external_id",
            "label": ["label1", "label2", "label3"]
        }
    ]
}

Examples

curl -X GET "https://api.predicthq.com/v1/beam/analyses?status=draft&sort=updated" \
     -H "Accept: application/json" \
     -H "Authorization: Bearer $ACCESS_TOKEN"

Guides

Below are some guides relevant to this API:

Last updated

© 2024 PredictHQ Ltd