Upload Demand Data

Upload your demand data as CSV, line-delimited JSON or JSON.

When providing data for a Beam Analysis, the minimum amount of data required is 6 months (180 data points), and the maximum is 1 year into the future (today + 365 days).

Beam can impute up to 20% of missing values, provided that the minimum data requirements are satisfied.

Uploading data replaces existing data for the same date. It's not currently possible to remove data for a particular date. The idea with this endpoint is that you're continuously adding new demand data over time.

Request

HTTP Request

POST https://api.predicthq.com/v1/beam/analyses//sink

Path Parameters

ParameterDescription

analysis_id

An existing Beam Analysis ID.

Request Headers

HeaderValue

Content-Type

Must be one of the following:

  • text/csv

  • application/x-ldjson

  • application/json

Request Body

You can upload the demand data for your analysis in any of the following formats:

The request body should contain comma-separated values that represent multiple data points with the column names (in lowercase) as date and demand, demonstrated by the example below:

date,demand
2023-01-01,12.235
2023-01-02,11.4
2023-01-03,12.14

The following request headers must be set:

HeaderValue

Content-Type

text/csv

Column Types:

ColumnDescription

date string required

ISO8601 Date format (YYYY-MM-DD) E.g., 2023-01-01

demand number required

Number value (float or integer, must be a positive number). Demand will typically be the demand you use in your demand forecast if you are forecasting. For example, it could be units sold, room bookings, or number of staff rostered on per day or any other unit. E.g., 12.235

Response

If successful, the HTTP response code will be 202 Accepted.

Examples

curl -X POST https://api.predicthq.com/v1/beam/analyses/$ANALYSIS_ID/sink \
     -H "Content-Type: text/csv" \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     --data @data.csv

Guides

Below are some guides relevant to this API:

Last updated

© 2024 PredictHQ Ltd