Upload demand data
Upload historical demand data for an existing forecast model.
Uploads historical demand data for a forecast model. The model must exist and belong to the authenticated organization.
You can use any of the following content types:
application/json: A JSON object with ademandarray of{date, demand}objects.text/csv: A CSV file with lowercase headersdate,demandand one row per data point.application/x-ndjson: Newline-delimited JSON where each line is a{date, demand}object.
The date field should be in YYYY-MM-DD format and demand must be a non-negative number.
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
The unique identifier of the forecast model.
Content type of the uploaded payload.
application/jsonPossible values: Successful Response
No content
Bad Request
Unauthorized
Payment Required
Forbidden
Not Found
POST /v1/forecasts/models/{model_id}/demand HTTP/1.1
Host: api.predicthq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 45
{
"demand": [
{
"demand": 1,
"date": "2026-01-01"
}
]
}No content
OpenAPI spec
The OpenAPI spec for Forecasts API is available in the Forecasts API OpenAPI spec.
Guides
The following guides cover the Forecasts API:
Last updated
Was this helpful?