Skip to main content

Overview

The Forecasts endpoints allow you to submit predictions on questions and withdraw existing forecasts. All forecasts are submitted as arrays to support single questions, groups of questions, and conditional questions in a unified interface.
Before submitting forecasts, retrieve the question details from /api/posts/{postId}/ or /api/questions/{questionId}/ to understand the question type, bounds, and current status.

Submit Forecasts

POST /api/questions/forecast/ Submit one or more forecasts. The request body must always be an array, even for single questions.

Request Body

The request body is an array of forecast objects. The structure depends on the question type:

Binary Questions

integer
required
The question ID
number
required
Probability between 0 and 1 that the answer is “yes”
string (datetime)
Optional: When to automatically withdraw this forecast

Multiple Choice Questions

integer
required
The question ID
object
required
Object mapping option names to probabilities. Values must sum to 1.0.Example:
string (datetime)
Optional: When to automatically withdraw this forecast

Continuous Questions (Numeric, Date, Discrete)

integer
required
The question ID (must be the question ID, not the post ID)
array
required
Array of CDF values. Length depends on inbound_outcome_count (default: 201 values for continuous, 11 for discrete with 10 outcomes).Important CDF Requirements:
  1. Strictly Increasing: Each value must be at least 0.00005 (0.01/200) greater than the previous value
  2. Maximum Step: No step can increase by more than 0.2 (or scaled based on outcome count)
  3. Boundary Conditions:
    • Closed lower bound: First value must be 0.0
    • Open lower bound: First value must be ≥ 0.001
    • Closed upper bound: Last value must be 1.0
    • Open upper bound: Last value must be ≤ 0.999
See the OpenAPI spec documentation for helper functions to generate valid CDFs.
string (datetime)
Optional: When to automatically withdraw this forecast

Conditional Questions

For conditional questions, submit forecasts for both the “if yes” and “if no” scenarios:

Group of Questions

For groups, submit a forecast for each question in the group:

Response

Empty object
Forecasts submitted successfully
object
Invalid request format or validation error
string
Error description
object
Question is not open for forecasting
string
Reason why forecasting is not allowed

Continuous CDF Guidelines

Generating Valid CDFsCreating a valid CDF can be tricky. Here are the key steps:
  1. Check question scaling: Look at question.scaling to get range_min, range_max, zero_point, and boundary settings
  2. Determine your percentiles: Identify key percentiles of your belief (e.g., 5th, 25th, 50th, 75th, 95th)
  3. Generate the CDF: Linearly interpolate between your percentiles
  4. Standardize: Add a small uniform component to ensure monotonicity
See the OpenAPI spec for complete Python helper functions.

Example: Binary Forecast

Example: Numeric Forecast

Example: Discrete Forecast (10 outcomes)


Withdraw Forecasts

POST /api/questions/withdraw/ Withdraw your current forecast(s) from one or more questions. This removes your prediction from the community aggregation going forward.

Request Body

integer
required
The question ID to withdraw from

Response

Empty object
Forecast(s) withdrawn successfully
object
Invalid request format

Example: Withdraw from Multiple Questions


Important Notes

Forecast Validation
  • Questions must be in open status
  • Current time must be between open_time and scheduled_close_time
  • You must have forecaster permission on the question’s post
  • CDFs must be strictly monotonic and respect boundary conditions
Automatic WithdrawalsYou can set an end_time on forecasts to have them automatically withdrawn. This is useful for:
  • Testing temporary predictions
  • Setting expiring forecasts that represent near-term beliefs
  • Implementing time-based forecast strategies
Question IDs vs Post IDsAlways use the question ID in forecast submissions, not the post ID. For posts with single questions, these IDs are often the same, but for groups and conditionals, they differ. Get question IDs from the post details endpoint.