Overview
Can be accessed using client.helix.predictions on an ApiClient instance.
Example
const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
const { data: predictions } = await api.helix.predictions.getPredictions('61369223');
Methods
cancelPrediction(broadcaster, id)
asyncCancels a prediction.
| Parameter | Type | Required | Default | Description | 
|---|---|---|---|---|
| broadcaster | UserIdResolvable | none | The broadcaster to cancel the prediction for.  | |
| id | string | none | The ID of the prediction to cancel.  | 
createPrediction(broadcaster, data)
asyncCreates a new prediction.
| Parameter | Type | Required | Default | Description | 
|---|---|---|---|---|
| broadcaster | UserIdResolvable | none | The broadcaster to create the prediction for.  | |
| data | HelixCreatePredictionData | none | ||
| data.autoLockAfter | number | none | The time after which the prediction will be automatically locked, in seconds from creation.  | |
| data.outcomes | Array<string> | none | The possible outcomes for the prediction.  | |
| data.title | string | none | The title of the prediction.  | 
getPredictionById(broadcaster, id)
asyncRetrieves a prediction by ID.
| Parameter | Type | Required | Default | Description | 
|---|---|---|---|---|
| broadcaster | UserIdResolvable | none | The broadcaster to retrieve the prediction for.  | |
| id | string | none | The ID of the prediction.  | 
getPredictions(broadcaster, pagination)
asyncRetrieves a list of predictions for the given broadcaster.
| Parameter | Type | Required | Default | Description | 
|---|---|---|---|---|
| broadcaster | UserIdResolvable | none | The broadcaster to retrieve predictions for.  | |
| pagination | HelixForwardPagination | none | ||
| pagination.after | string | none | A cursor to get the following page of.  | |
| pagination.limit | string | none | The number of results per page.  | 
getPredictionsByIds(broadcaster, ids)
asyncRetrieves predictions by IDs.
| Parameter | Type | Required | Default | Description | 
|---|---|---|---|---|
| broadcaster | UserIdResolvable | none | The broadcaster to retrieve the predictions for.  | |
| ids | Array<string> | none | The IDs of the predictions.  | 
getPredictionsPaginated(broadcaster)
Creates a paginator for predictions for the given broadcaster.
| Parameter | Type | Required | Default | Description | 
|---|---|---|---|---|
| broadcaster | UserIdResolvable | none | The broadcaster to retrieve predictions for.  | 
lockPrediction(broadcaster, id)
asyncLocks a prediction.
| Parameter | Type | Required | Default | Description | 
|---|---|---|---|---|
| broadcaster | UserIdResolvable | none | The broadcaster to lock the prediction for.  | |
| id | string | none | The ID of the prediction to lock.  | 
resolvePrediction(broadcaster, id, outcomeId)
asyncResolves a prediction.
| Parameter | Type | Required | Default | Description | 
|---|---|---|---|---|
| broadcaster | UserIdResolvable | none | The broadcaster to resolve the prediction for.  | |
| id | string | none | The ID of the prediction to resolve.  | |
| outcomeId | string | none | The ID of the winning outcome.  |