import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const forumPostListResponse of client.forumPosts.list({
experience_id: 'exp_xxxxxxxxxxxxxx',
})) {
console.log(forumPostListResponse.id);
}{
"data": [
{
"id": "<string>",
"title": "Weekly Market Analysis - February 2025",
"content": "## My Strategy\n\nHere are the key steps...",
"created_at": "2023-12-01T05:00:00.401Z",
"updated_at": "2023-12-01T05:00:00.401Z",
"is_edited": true,
"is_poster_admin": true,
"is_pinned": true,
"parent_id": "<string>",
"user": {
"id": "user_xxxxxxxxxxxxx",
"username": "johndoe42",
"name": "John Doe"
},
"attachments": [
{
"id": "<string>",
"filename": "document.pdf",
"content_type": "image/jpeg",
"url": "https://media.whop.com/abc123/optimized.jpg"
}
],
"view_count": 42,
"like_count": 42,
"comment_count": 42
}
],
"page_info": {
"end_cursor": "<string>",
"start_cursor": "<string>",
"has_next_page": true,
"has_previous_page": true
}
}Returns a paginated list of forum posts within a specific experience, with optional filtering by parent post or pinned status.
Required permissions:
forum:readimport Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const forumPostListResponse of client.forumPosts.list({
experience_id: 'exp_xxxxxxxxxxxxxx',
})) {
console.log(forumPostListResponse.id);
}{
"data": [
{
"id": "<string>",
"title": "Weekly Market Analysis - February 2025",
"content": "## My Strategy\n\nHere are the key steps...",
"created_at": "2023-12-01T05:00:00.401Z",
"updated_at": "2023-12-01T05:00:00.401Z",
"is_edited": true,
"is_poster_admin": true,
"is_pinned": true,
"parent_id": "<string>",
"user": {
"id": "user_xxxxxxxxxxxxx",
"username": "johndoe42",
"name": "John Doe"
},
"attachments": [
{
"id": "<string>",
"filename": "document.pdf",
"content_type": "image/jpeg",
"url": "https://media.whop.com/abc123/optimized.jpg"
}
],
"view_count": 42,
"like_count": 42,
"comment_count": 42
}
],
"page_info": {
"end_cursor": "<string>",
"start_cursor": "<string>",
"has_next_page": true,
"has_previous_page": true
}
}A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************
Returns the elements in the list that come after the specified cursor.
Returns the elements in the list that come before the specified cursor.
Returns the first n elements from the list.
42
Returns the last n elements from the list.
42
The unique identifier of the experience to list forum posts for.
"exp_xxxxxxxxxxxxxx"
The unique identifier of a parent post to list comments for. When set, returns replies to that post.
Whether to filter for only pinned posts. Set to true to return only pinned posts.
Was this page helpful?