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
The question ID
Probability between 0 and 1 that the answer is “yes”
Optional: When to automatically withdraw this forecast
Multiple Choice Questions
The question ID
Object mapping option names to probabilities. Values must sum to 1.0.Example:
Optional: When to automatically withdraw this forecast
Continuous Questions (Numeric, Date, Discrete)
The question ID (must be the question ID, not the post ID)
Array of CDF values. Length depends on
inbound_outcome_count (default: 201 values for continuous, 11 for discrete with 10 outcomes).Important CDF Requirements:- Strictly Increasing: Each value must be at least 0.00005 (0.01/200) greater than the previous value
- Maximum Step: No step can increase by more than 0.2 (or scaled based on outcome count)
- 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
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
Forecasts submitted successfully
Question is not open for forecasting
Reason why forecasting is not allowed
Continuous CDF Guidelines
Generating Valid CDFsCreating a valid CDF can be tricky. Here are the key steps:
- Check question scaling: Look at
question.scalingto getrange_min,range_max,zero_point, and boundary settings - Determine your percentiles: Identify key percentiles of your belief (e.g., 5th, 25th, 50th, 75th, 95th)
- Generate the CDF: Linearly interpolate between your percentiles
- Standardize: Add a small uniform component to ensure monotonicity
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
The question ID to withdraw from
Response
Forecast(s) withdrawn successfully
Invalid request format
Example: Withdraw from Multiple Questions
Important Notes
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.
