The Metaculus AI API generates probabilistic forecasts for forecasting questions.
Forecasts are asynchronous: you submit a task,
receive a task id, then wait for it to finish. You can wait
in one of two ways — poll the task endpoint, or stream progress over
Server-Sent Events (SSE).
Base URL:
https://ai.metaculus.com/api/v1
API reference: browse the endpoints in the API reference, or fetch the raw OpenAPI schema.
Submit a question object to the forecast endpoint, with
a forecast_effort, and receive probability estimates.
Build the question object yourself, or send only its
title and type and we draft the rest — see A question with only a title.
Every request must include your API key in the
Authorization header:
Authorization: token YOUR_API_KEY
Contact Metaculus to obtain an API key.
| Response | Cause |
|---|---|
401 Unauthorized |
Missing or invalid API key |
403 Forbidden |
API key does not have access to this API |
Forecasts are paid for in credits. Contact Metaculus to add credits to your account.
GET /balance/GET https://ai.metaculus.com/api/v1/balance/
Example request
curl -s "https://ai.metaculus.com/api/v1/balance/" \
-H "Authorization: token YOUR_API_KEY"Response 200 OK
{
"credits_remaining": 12
}credits_remaining already excludes the credits held for
your running forecasts, so it is what you can spend right now.
Forecast results carry credits_used, in the GET response
and the stream’s terminal event:
credits_used |
Meaning |
|---|---|
null |
The forecast has not ended yet. It stays null on a
forecast that wasn’t billed in credits, such as one submitted before
credits existed |
0 |
Nothing was charged, because the forecast failed or was interrupted |
| The price | The forecast was charged this many credits |
POST /forecast/ returns 402 when
credits_remaining is below the price of the requested
forecast_effort. Nothing is queued, and you can resubmit
once a running forecast has ended or credits have been added.
A forecast task follows this pattern:
202 Accepted with a task id.status reaches a terminal value, or/stream/ endpoint to
receive progress events over SSE until the task finishes.| Status | Meaning |
|---|---|
pending |
Queued, not yet started |
running |
In progress |
completed |
Finished successfully — result is set |
failed |
Finished with an error — error is set |
cancelled |
Stopped before completion |
While a task is in progress, both result and
error are null.
A failed task’s error.message names only the kind of
error, for example run failed (RuntimeError).
Poll the GET endpoint every few seconds. Tasks typically complete within a few minutes, but may take longer for complex questions. We recommend a timeout of at least 20 minutes.
Each task has a matching /stream/ endpoint that returns
a text/event-stream. Open it after submitting a task to
receive live progress and the final result on one connection, without
polling:
GET https://ai.metaculus.com/api/v1/forecast/{id}/stream/
Each message is a standard SSE event with an event: name
and a JSON data: payload. Comment lines beginning with
: are heartbeat pings and can be ignored.
Progress events report high-level milestones as the
task runs. The event name is the milestone kind; the
data payload carries its details. run_label
names what sent it: forecaster is any of the forecasters
(they all share it), consolidation the step that writes the
final explanation.
event |
Meaning |
|---|---|
tool_call |
A forecaster started a web search (tool_call_id and
input params, which vary between searches) |
sources |
The sources a web search returned, paired with its
tool_call by tool_call_id. Empty if it found
nothing |
tool_error |
A web search failed (tool_call_id, and
error, a fixed message) |
key_factor |
A key factor of the final ranked set (title,
description, strength, direction,
run_label consolidation), with its 0-based
position, an id (a UUID) and meta
(see key_factors in the response) |
summary |
60–100 words of Markdown explaining the final forecast
(summary, run_label
consolidation). It links the key factors it relies on as
[text](#key-factor-<id>), using the consolidation
key_factor events’ id |
disagreement |
Only when the forecasters meaningfully disagree: at most 60 words of
plain text on where and why their forecasts or readings of an important
driver part ways (disagreement, run_label
consolidation). Not sent when they broadly agree |
drafted_question |
Only for a question with no description,
resolution_criteria or fine_print: the text we
drafted for it (resolution_criteria,
fine_print, description,
run_label draft). Sent once, before the
forecasters start |
Terminal event — the stream emits one final event
named after the terminal status (completed,
failed, or cancelled), then closes. Its
data payload is the same object returned by the GET
endpoint:
event: completed
data: {"id": "550e8400-...", "status": "completed", "result": { }, "forecast_effort": "medium", ...}
If you connect while the task is running, you receive events from
that moment on, and earlier ones are not replayed. The finished task
still holds what they led to, such as sources,
key_factors, summary and
drafted_question.
If you connect after the task has already finished, you receive just the terminal event and the stream closes immediately.
Request bodies are strict: an unknown field, including one inside
question or scaling, is refused with a
422 that names it.
Generate probabilistic forecasts for a structured question.
POST /forecast/POST https://ai.metaculus.com/api/v1/forecast/
Request body
| Field | Type | Required | Description |
|---|---|---|---|
question |
object | yes | Structured question — see below |
forecast_effort |
string | yes | How much work goes into the forecast: low,
medium, high or xhigh — see
below |
Forecast effort
forecast_effort |
Description |
|---|---|
low |
Fastest and cheapest. Good for screening options or filling large tables. |
medium |
More forecasters, stronger models. For routine work and modelling. |
high |
More forecasters, strongest models. For important decisions. |
xhigh |
The most forecasters, strongest models, thinking the longest. For critical calls, when you can’t afford to miss a factor. Slow. |
At every level, the forecasters run on models from different
providers and research independently, their forecasts are combined into
pmf, and the task ends with ranked key factors, a
summary and a disagreement note.
A forecast’s models are set by its forecast_effort.
At every level the forecasters can search Metaculus for related questions and their community predictions.
Each level has a price in credits, and a forecast your account can’t
cover is refused with a 402 — see Credits.
The question object
| Field | Type | Description |
|---|---|---|
title |
string | Question title |
type |
string | One of: binary, multiple_choice,
numeric, discrete, date |
resolution_criteria |
string | How the question resolves |
fine_print |
string | Additional resolution details |
description |
string | Background context |
open_time |
datetime | When forecasting on the question opens. With
scheduled_close_time, tells the forecasters the forecasting
window |
scheduled_close_time |
datetime | When forecasting on the question closes |
scheduled_resolve_time |
datetime | Expected resolution time |
options |
string[] | Answer choices (for multiple_choice questions) |
scaling |
object | Bounds and scaling (for numeric / discrete
/ date questions) |
unit |
string | The unit of the answer, for example % |
A question with only a title
If you send none of description,
resolution_criteria and fine_print, we draft
all three first, and every forecaster forecasts the drafted question.
Your title, type, options,
scaling and dates stay as you sent them. The draft has to
pin down what your title leaves open, such as a deadline, and that can
change the forecast a lot, so it’s worth reading.
You can read it in three places:
drafted_question event on the stream, as soon as
it’s written;input.question of the finished task, which then holds
the question as it was forecast: what you sent, plus the draft. While
the task runs, or if it fails, input.question is what you
sent;result.drafted_question of the finished task, which
shows which text we wrote.If drafting fails, the question is forecast from its title alone and
result.draft_fallback_reason is set.
The scaling object
| Field | Type | Required | Description |
|---|---|---|---|
range_min |
number or ISO 8601 date/datetime string | yes | Lower bound of the forecast range |
range_max |
number or ISO 8601 date/datetime string | yes | Upper bound of the forecast range |
zero_point |
number or ISO 8601 date/datetime string | no | Anchor for logarithmic scaling; omit for linear scaling |
nominal_min |
number or ISO 8601 date/datetime string | no | Display label for the lower bound |
nominal_max |
number or ISO 8601 date/datetime string | no | Display label for the upper bound |
open_lower_bound |
boolean | yes | Whether the question can resolve below range_min |
open_upper_bound |
boolean | yes | Whether the question can resolve above range_max |
inbound_outcome_count |
integer | no | Number of in-bound buckets the forecast distribution is split into. Defaults to 200 |
inbound_outcome_count is the count of outcomes falling
strictly between the underflow bucket (below range_min) and
the overflow bucket (above range_max), so a returned
pmf for a continuous question has
inbound_outcome_count + 2 entries. The default of
200 suits numeric / date
questions. For discrete questions, always set it to the
number of distinct outcomes — with range_min /
range_max set half a step outside the first and last
outcome, that is round((max - min) / step) + 1, where
min / max are the outcome values themselves.
It must be between 1 and 201; a request outside that range fails
validation with a 422, and a discrete question with more
outcomes should be posed as a numeric question instead.
For numeric / discrete questions, these
bounds are just regular numbers. For date questions, bounds
are stored and returned as Unix epoch seconds (not
milliseconds) — a plain number is always a valid datetime value here. As
a convenience, on date questions only, you can pass an ISO
8601 date/datetime string instead (e.g. "2026-08-01" or
"2026-08-01T00:00:00Z") and it will be converted to epoch
seconds automatically; a timezone-naive string is treated as UTC. ISO
strings are not accepted for numeric /
discrete questions — those bounds must be numbers.
Example request
Each tab shows a request with only the fields its question type
needs, and the forecast fields of its finished task’s
result. The numbers come from real forecasts, and yours
will differ. These requests send no resolution_criteria, so
we draft the question’s details first: see A question with only
a title.
A yes or no question. It needs no options or
scaling.
curl -s -X POST "https://ai.metaculus.com/api/v1/forecast/" \
-H "Authorization: token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": {
"title": "Will SpaceX land humans on Mars before 2035?",
"type": "binary"
},
"forecast_effort": "medium"
}'pmf is [P(no), P(yes)]:
{
"pmf": [0.91, 0.09],
"human_readable_forecast": { "yes": 0.09 }
}One answer out of a list. options is required.
curl -s -X POST "https://ai.metaculus.com/api/v1/forecast/" \
-H "Authorization: token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": {
"title": "Which country will win the 2030 FIFA World Cup?",
"type": "multiple_choice",
"options": ["Argentina", "Brazil", "France", "Spain", "Another country"]
},
"forecast_effort": "medium"
}'pmf has one probability per option, in the order of
options:
{
"pmf": [0.07, 0.08, 0.12, 0.18, 0.55],
"human_readable_forecast": {
"Argentina": 0.07,
"Brazil": 0.08,
"France": 0.12,
"Spain": 0.18,
"Another country": 0.55
}
}A value on a continuous range. scaling is required, and
inbound_outcome_count is left at its default of 200. Both
bounds are open here because the rate could end up outside the
range.
curl -s -X POST "https://ai.metaculus.com/api/v1/forecast/" \
-H "Authorization: token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": {
"title": "What will the US unemployment rate be in December 2027?",
"type": "numeric",
"scaling": {
"range_min": 2,
"range_max": 10,
"open_lower_bound": true,
"open_upper_bound": true
}
},
"forecast_effort": "medium"
}'pmf has inbound_outcome_count + 2 entries:
below range_min, the 200 buckets, then above
range_max. human_readable_forecast gives the
percentiles in the question’s units, and p50 is the
median:
{
"pmf": [0.0021, "... 202 values in all ...", 0.002],
"human_readable_forecast": {
"p05": 3.50290485,
"p50": 4.24873999,
"p95": 6.01199298,
"...": "13 percentiles in all, from p01 to p99"
}
}A date on a continuous range. scaling is required, and
its bounds can be ISO 8601 strings. The upper bound is open here because
the event could happen after range_max, and the lower bound
is closed because it can’t happen before range_min.
curl -s -X POST "https://ai.metaculus.com/api/v1/forecast/" \
-H "Authorization: token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": {
"title": "When will the first crewed Moon landing since Apollo happen?",
"type": "date",
"scaling": {
"range_min": "2027-01-01",
"range_max": "2040-01-01",
"open_lower_bound": false,
"open_upper_bound": true
}
},
"forecast_effort": "medium"
}'pmf has inbound_outcome_count + 2 entries,
as on a numeric question. human_readable_forecast gives the
percentiles as dates, and p50 is the median.
input.question.scaling returns the bounds as Unix epoch
seconds:
{
"pmf": [0.0, "... 202 values in all ...", 0.0225],
"human_readable_forecast": {
"p05": "2028-03-29T01:44:30",
"p50": "2030-01-28T04:38:00",
"p95": "2035-12-09T23:38:20",
"...": "13 percentiles in all, from p01 to p99"
}
}A count or other value with a fixed step. scaling is
required. The outcomes here run from 0 to 20 in steps of 1, so the
bounds sit half a step outside them. inbound_outcome_count
has to match the number of outcomes, here 21, because its default of 200
would be wrong for this question. The upper bound is open because the
count could go above 20.
curl -s -X POST "https://ai.metaculus.com/api/v1/forecast/" \
-H "Authorization: token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": {
"title": "How many Atlantic hurricanes will form in 2027?",
"type": "discrete",
"scaling": {
"range_min": -0.5,
"range_max": 20.5,
"open_lower_bound": false,
"open_upper_bound": true,
"inbound_outcome_count": 21
}
},
"forecast_effort": "medium"
}'pmf has inbound_outcome_count + 2 entries:
below range_min, one per outcome, then above
range_max. Percentiles are interpolated, so they can fall
between outcomes:
{
"pmf": [0.0, "... 23 values in all ...", 0.0158],
"human_readable_forecast": {
"p05": 2.55099562,
"p50": 7.17508142,
"p95": 13.67559931,
"...": "13 percentiles in all, from p01 to p99"
}
}Response 202 Accepted
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"status": "pending",
"forecast_effort": "medium"
}GET /forecast/{id}/GET https://ai.metaculus.com/api/v1/forecast/{id}/
Response 200 OK
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"status": "completed",
"result": { },
"error": null,
"input": { "question": { } },
"created_at": "2026-07-07T12:00:00Z",
"completed_at": "2026-07-07T12:08:00Z",
"forecast_effort": "medium"
}The response also carries credits_used, what the
forecast used — see What a forecast
used.
On success, result contains:
{
"pmf": [0.91, 0.09],
"human_readable_forecast": { "yes": 0.09 },
"rationale": null,
"sources": { "S1": "https://example.com/launch-timelines" },
"related_questions": [
{
"post_id": 12345,
"title": "Will Starship reach orbit before 2027?",
"url": "https://www.metaculus.com/questions/12345/",
"post": {
"id": 12345,
"title": "Will Starship reach orbit before 2027?",
"short_title": "Starship orbit 2027",
"slug": "will-starship-reach-orbit-before-2027",
"status": "open",
"resolution": null,
"nr_forecasters": 412,
"open_time": "2026-01-01T00:00:00Z",
"scheduled_close_time": "2026-12-31T00:00:00Z",
"scheduled_resolve_time": "2027-01-01T00:00:00Z",
"question": {
"id": 67890,
"type": "binary",
"default_aggregation_method": "recency_weighted",
"aggregations": {
"recency_weighted": {
"latest": {
"start_time": 1735689600.0,
"end_time": null,
"forecaster_count": 412,
"centers": [0.78],
"interval_lower_bounds": [0.7],
"interval_upper_bounds": [0.85],
"forecast_values": [0.22, 0.78]
},
"history": ["..."]
}
},
"...": "remaining question fields as metaculus.com serializes them"
}
}
}
],
"summary": "...",
"disagreement": "",
"key_factors": [ ],
"consolidation_fallback_reason": null,
"drafted_question": null,
"draft_fallback_reason": null
}The shape of pmf and
human_readable_forecast depends on the question type: see
the tabs under Example request.
| Field | Description |
|---|---|
pmf |
The final forecast as a probability distribution: the forecasters’ distributions combined into one |
human_readable_forecast |
The final forecast in readable form: {"yes": p} on a
binary question, {option: p} on a multiple choice one, and
percentiles p01 to p99 on a continuous one,
where p50 is the median |
rationale |
The reasoning behind the forecast when one forecaster’s forecast is
the final one and there is no summary to read: if
consolidation failed and only one forecaster succeeded. Its
[S1]-style citations are keys of sources.
Otherwise null |
sources |
The web sources found while researching the forecast, each URL once,
as a map from a citation marker (S1) to its URL.
summary and key_factors don’t cite them |
related_questions |
The Metaculus questions the forecasters judged directly relevant,
deduplicated by post_id. Each object carries the question’s
post payload as metaculus.com serializes it (see below). []
means nothing was flagged |
summary |
60–100 words of Markdown explaining the final forecast, the
important parts in bold. It links the key factors it relies on as
[text](#key-factor-<id>), <id>
being a key_factors entry’s id.
"" if consolidation failed |
disagreement |
At most 60 words of plain text (no Markdown) on where and why the
forecasters meaningfully disagree: forecasts far apart, or opposite
readings of an important driver. "" when they broadly agree
or when consolidation failed |
key_factors |
At most five key factors, most influential first, each with
id (a UUID, which the summary’s links use),
title (at most 15 words), description,
strength (low / medium /
high), direction (up /
down / uncertain; up makes YES
more likely, or pushes a value higher or a date later) and
meta. meta is an object of extra information
about the factor, or null when there is none; more keys may
be added, so ignore those you don’t know. Today its one key is
outcomes, set on multiple_choice questions:
the option the factor affects most, as a list with a single
{option, direction}, option being one of the
question’s options and direction
up (more likely) or down (less likely). The
other options move the opposite way implicitly, so they are not listed.
The list is empty in the rare case the option could not be matched to
the question’s. meta is null on other question
types and when consolidation failed |
consolidation_fallback_reason |
Set only when consolidation failed; key_factors then
holds the forecasters’ own key factors, deduplicated by title, and the
forecast has no summary |
drafted_question |
For a question sent with only a title, the text we drafted for it:
resolution_criteria, fine_print and
description. input.question holds the same
text merged with what you sent (see A
question with only a title). Otherwise null, or absent
on tasks that finished before drafting existed |
draft_fallback_reason |
Set only when drafting failed; the question was then forecast from
its title alone. Otherwise null, or absent on tasks that
finished before drafting existed |
Each related question object:
| Field | Description |
|---|---|
post_id |
The id in the question’s URL (/questions/{post_id}/);
deduplication keys on it |
title / url |
Convenience copies of the post’s title and canonical URL |
post |
The post payload exactly as metaculus.com’s public API serializes it
(GET /api/posts/{post_id}/ with with_cp=true),
trimmed to the fields a question card renders: id,
title, short_title, slug,
status, resolution,
nr_forecasters, the open/close/resolve times, and the full
question, group_of_questions, or
conditional object — community predictions included |
The post object is a passthrough, not a bespoke schema,
so it can be rendered with the same types and logic the open-source Metaculus
site uses for its question cards. In short: branch on
post.question.type (or the presence of
group_of_questions / conditional) for the
layout, and read the community prediction from
question.aggregations[question.default_aggregation_method]
— latest holds the headline snapshot (centers,
interval_lower_bounds / interval_upper_bounds,
and forecast_values, the full distribution a continuous
chart is drawn from), and history holds the timeline a
sparkline is drawn from. Continuous (numeric /
date / discrete) aggregation values are in the
question’s internal 0–1 coordinates; unscale
them through question.scaling, whose date
bounds are Unix epoch seconds.
GET /forecast/{id}/stream/The task’s progress over SSE, ending with the GET response — see Streaming.
Below is a minimal Python client that submits a forecast and waits for the result.
import json
import time
import httpx
BASE_URL = "https://ai.metaculus.com/api/v1"
API_KEY = "YOUR_API_KEY"
client = httpx.Client(
base_url=BASE_URL,
headers={"Authorization": f"token {API_KEY}"},
timeout=30,
)
def submit(path: str, body: dict) -> str:
resp = client.post(path, json=body)
resp.raise_for_status()
return resp.json()["id"]Pick one of the two helpers below. Streaming (SSE) surfaces progress as the task runs; polling is simpler if you only need the final result.
def wait_stream(path_template: str, task_id: str) -> dict:
"""Wait on the SSE stream until terminal status; return the result payload."""
with client.stream("GET", path_template.format(id=task_id)) as resp:
resp.raise_for_status()
event = None
for line in resp.iter_lines():
if not line or line.startswith(":"): # blank line or heartbeat ping
continue
if line.startswith("event:"):
event = line.split(":", 1)[1].strip()
continue
if not line.startswith("data:"):
continue
payload = json.loads(line.split(":", 1)[1].strip())
print(f" [{task_id}] event={event}")
if event == "completed":
return payload["result"]
if event in ("failed", "cancelled"):
raise RuntimeError(f"task {event}: {payload.get('error')}")
raise RuntimeError(f"stream ended before task {task_id} finished")POLL_INTERVAL_S = 5
POLL_TIMEOUT_S = 20 * 60
def poll(path_template: str, task_id: str) -> dict:
deadline = time.monotonic() + POLL_TIMEOUT_S
while True:
resp = client.get(path_template.format(id=task_id))
resp.raise_for_status()
task = resp.json()
status = task["status"]
if status == "completed":
return task["result"]
if status in ("failed", "cancelled"):
raise RuntimeError(f"task {status}: {task['error']}")
if time.monotonic() > deadline:
raise TimeoutError(f"task {task_id} still {status} after 20 minutes")
time.sleep(POLL_INTERVAL_S)question = {
"title": "Will SpaceX land humans on Mars before 2035?",
"type": "binary",
}
forecast_id = submit("/forecast/", {"question": question, "forecast_effort": "medium"})
forecast = wait_stream("/forecast/{id}/stream/", forecast_id)
print(forecast["pmf"]) # e.g. [0.91, 0.09] for a binary questionTo poll instead of stream, swap
wait_stream("/forecast/{id}/stream/", ...) for
poll("/forecast/{id}/", ...). For another question type,
use the question from its tab under Example request.
| Code | When |
|---|---|
202 |
Task accepted (POST) |
200 |
Task status or balance returned (GET) |
400 |
Invalid request |
401 |
Missing or invalid API key |
402 |
Not enough credits for the requested forecast_effort —
see Credits |
403 |
API key does not have access |
404 |
Task not found |
422 |
Invalid request body; the response names each field at fault |
A 404 on GET means the task id does not exist, belongs
to a different account, or is not a forecast.