Skip to main content

Overview

Comments allow users to discuss questions, share insights, and explain their reasoning. Comments can be public or private, can include forecasts, and support threading (replies).

List Comments

curl -X GET "https://www.metaculus.com/api/comments/?post=3530&limit=50" \
  -H "Authorization: Token YOUR_TOKEN"
GET /api/comments/ Retrieve comments with filtering options. Either post or author parameter is required.

Query Parameters

post
integer
Filter comments by post ID (required if author not provided)
author
integer
Filter comments by author user ID (required if post not provided)
is_private
boolean
default:"false"
Show private comments (for authenticated user only) or public comments
parent_isnull
boolean
Filter to only root comments (true) or only replies (false)
sort
string
Sort order: created_at (oldest first) or -created_at (newest first)
focus_comment_id
integer
Place a specific comment at the top of results
include_deleted
boolean
default:"false"
Include soft-deleted comments in results
use_root_comments_pagination
boolean
If true, pagination applies only to root comments, and all replies are included
limit
integer
default:"50"
Number of comments to return
offset
integer
default:"0"
Pagination offset

Response

total_count
integer
Total number of comments (including replies)
count
integer
Number of root comments only
next
string
URL for next page, or null
previous
string
URL for previous page, or null
results
array
Array of comment objects

Comment Object

id
integer
Unique comment identifier
author
object
Author information
id
integer
User ID
username
string
Username
is_bot
boolean
Whether the author is a bot
is_staff
boolean
Whether the author is Metaculus staff
parent_id
integer
ID of the comment being replied to, or null if root comment
root_id
integer
ID of the root comment in this thread
created_at
string (datetime)
When the comment was created
text_edited_at
string (datetime)
When the comment text was last edited
text
string
Comment content in markdown
on_post
integer
ID of the post this comment belongs to
on_post_data
object
Basic post information
id
integer
Post ID
title
string
Post title
included_forecast
object
Forecast data if user included their prediction with the comment
question
integer
Question ID
probability_yes
number
For binary questions: probability value
continuous_cdf
array
For continuous questions: CDF array
is_private
boolean
Whether this is a private comment
is_soft_deleted
boolean
Whether the comment has been deleted
is_pinned
boolean
Whether the comment is pinned by moderators
vote_score
integer
Total vote score (upvotes - downvotes)
user_vote
integer
Current user’s vote: 1 (upvote), -1 (downvote), or null
changed_my_mind
object
“Changed my mind” indicators
count
integer
Number of users who marked this comment as changing their mind
for_this_user
boolean
Whether current user marked this as changing their mind
mentioned_users
array
Users mentioned with @ in the comment
author_staff_permission
string
Author’s staff permission level on the post
key_factors
array
Key factors associated with this comment (advanced feature)

Create Comment

curl -X POST "https://www.metaculus.com/api/comments/create/" \
  -H "Authorization: Token YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "on_post": 3530,
    "text": "Great analysis! I agree with the reasoning.",
    "included_forecast": false,
    "is_private": false
  }'
POST /api/comments/create/ Create a new comment on a post.

Request Body

on_post
integer
required
The post ID to comment on
text
string
required
Comment text in markdown format. Can be empty if key_factors are provided.
is_private
boolean
default:"false"
Whether this is a private comment (visible only to you)
included_forecast
boolean
default:"false"
Include your most recent forecast on this question
parent
integer
ID of the comment to reply to (omit for root comments)
key_factors
array
Advanced: Key factors to attach to this comment

Response

Returns the created comment object.
Comment FormattingComments support markdown formatting:
  • Bold: **text**
  • Italic: *text*
  • Links: [text](url)
  • Lists: - item or 1. item
  • Code: `code`
  • Mentions: @username
  • LaTeX math: $equation$ or $$block$$

Edit Comment

curl -X PATCH "https://www.metaculus.com/api/comments/12345/edit/" \
  -H "Authorization: Token YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text": "Updated comment text"}'
PATCH /api/comments/{commentId}/edit/ Edit your own comment.

Path Parameters

commentId
integer
required
The comment ID to edit

Request Body

text
string
required
Updated comment text
You can only edit your own comments. The edit timestamp is tracked in text_edited_at.

Delete Comment

curl -X DELETE "https://www.metaculus.com/api/comments/12345/delete/" \
  -H "Authorization: Token YOUR_TOKEN"
DELETE /api/comments/{commentId}/delete/ Soft-delete your comment. The comment text is replaced with “deleted” but the comment remains visible.

Path Parameters

commentId
integer
required
The comment ID to delete

Vote on Comment

curl -X POST "https://www.metaculus.com/api/comments/12345/vote/" \
  -H "Authorization: Token YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"direction": 1}'
POST /api/comments/{commentId}/vote/ Vote on a comment.

Path Parameters

commentId
integer
required
The comment ID to vote on

Request Body

direction
integer
required
Vote direction:
  • 1: Upvote
  • -1: Downvote
  • 0: Remove vote

Report Comment

curl -X POST "https://www.metaculus.com/api/comments/12345/report/" \
  -H "Authorization: Token YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"reason": "Spam content"}'
POST /api/comments/{commentId}/report/ Report a comment for moderator review.

Path Parameters

commentId
integer
required
The comment ID to report

Request Body

reason
string
required
Reason for reporting

Example: Comment Thread

import requests

headers = {"Authorization": "Token YOUR_TOKEN"}

# Get all comments on a post
response = requests.get(
    "https://www.metaculus.com/api/comments/",
    headers=headers,
    params={"post": 3530, "limit": 100}
)

comments = response.json()["results"]

# Organize into threads
root_comments = [c for c in comments if c["parent_id"] is None]
replies = [c for c in comments if c["parent_id"] is not None]

print(f"Root comments: {len(root_comments)}")
print(f"Replies: {len(replies)}")

# Display thread structure
for root in root_comments:
    print(f"\n{root['author']['username']}: {root['text'][:50]}...")
    print(f"  Votes: {root['vote_score']}")
    
    # Find replies to this comment
    comment_replies = [r for r in replies if r["parent_id"] == root["id"]]
    for reply in comment_replies:
        print(f"  ↳ {reply['author']['username']}: {reply['text'][:50]}...")

Example: Comment with Forecast

import requests

headers = {"Authorization": "Token YOUR_TOKEN"}

# First, submit a forecast
requests.post(
    "https://www.metaculus.com/api/questions/forecast/",
    headers=headers,
    json=[{"question": 1, "probability_yes": 0.75}]
)

# Then create a comment that includes the forecast
response = requests.post(
    "https://www.metaculus.com/api/comments/create/",
    headers=headers,
    json={
        "on_post": 1,
        "text": "I predict 75% because recent data shows...",
        "included_forecast": True,
        "is_private": False
    }
)

comment = response.json()
print(f"Forecast included: {comment['included_forecast']}")

Build docs developers (and LLMs) love