Search Analyses

Search for an existing Analysis.

Request

HTTP Request

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

Query Parameters

ParameterDescription

status string optional

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

  • draft

  • active

  • deleted

E.g. ?status=draft,active

readiness_status string optional

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

sort string optional

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

demand_type.interval string optional

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

/limit number optional

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

offset number optional

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"
        }
    ]
}

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