Get Post Comments
Retrieve comments for a specific social media post. This endpoint should be called after obtaining post IDs from the Social Posts Endpoint.
Endpoint
GET https://api.recoupable.com/api/post/commentsParameters
| Name | Type | Required | Description |
|---|---|---|---|
| post_id | string | Yes | The unique identifier of the post to fetch comments for |
| page | number | No | The page number to retrieve (default: 1) |
| limit | number | No | The number of records per page (default: 20, max: 100) |
Request Examples
cURL
curl -X GET "https://api.recoupable.com/api/post/comments?post_id=YOUR_POST_ID&page=1&limit=20" \
-H "Content-Type: application/json"Response Format
The API returns JSON responses. Here's an example success response:
{
"status": "success",
"comments": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"post_id": "123e4567-e89b-12d3-a456-426614174001",
"social_id": "123e4567-e89b-12d3-a456-426614174002",
"comment": "Great post! Looking forward to more content.",
"commented_at": "2024-04-01T14:30:00Z",
"username": "@superfan",
"avatar": "https://example.com/avatar1.jpg",
"profile_url": "https://twitter.com/superfan",
"post_url": "https://twitter.com/artistname/status/123456789",
"region": "US",
"bio": "Music lover and digital art collector",
"follower_count": 1234,
"following_count": 567
},
{
"id": "123e4567-e89b-12d3-a456-426614174003",
"post_id": "123e4567-e89b-12d3-a456-426614174001",
"social_id": "123e4567-e89b-12d3-a456-426614174004",
"comment": "This is amazing! 🔥",
"commented_at": "2024-04-01T15:15:00Z",
"username": "artcollector",
"avatar": "https://example.com/avatar2.jpg",
"profile_url": "https://instagram.com/artcollector",
"post_url": "https://twitter.com/artistname/status/123456789",
"region": "UK",
"bio": "Supporting emerging artists 🎨",
"follower_count": 5678,
"following_count": 432
}
],
"pagination": {
"total_count": 75,
"page": 1,
"limit": 20,
"total_pages": 4
}
}Response Properties
Response Object
| Property | Type | Description |
|---|---|---|
| status | string | Status of the request ("success" or "error") |
| comments | array | List of comments for the specified post |
| comments[].id | string | UUID of the comment record |
| comments[].post_id | string | UUID of the post this comment belongs to |
| comments[].social_id | string | UUID of the social profile that made the comment |
| comments[].comment | string | Text content of the comment |
| comments[].commented_at | string | ISO timestamp of when the comment was posted |
| comments[].username | string | Username of the commenter |
| comments[].avatar | string | null | URL to the commenter's avatar image |
| comments[].profile_url | string | URL to the commenter's profile |
| comments[].post_url | string | URL to the post where the comment was made |
| comments[].region | string | null | Geographic region of the commenter |
| comments[].bio | string | null | Commenter's biography or description |
| comments[].follower_count | number | null | Number of followers the commenter has |
| comments[].following_count | number | null | Number of accounts the commenter follows |
| pagination | object | Pagination metadata for the response |
| pagination.total_count | number | Total number of comments available |
| pagination.page | number | Current page number |
| pagination.limit | number | Number of comments per page |
| pagination.total_pages | number | Total number of pages available |
Workflow Guide
This endpoint is part of a workflow involving the Social Posts endpoint:
- First, call the Artist Socials endpoint with an
artist_account_idto retrieve social profiles - From the response, select the desired
social_idvalue - Use that
social_idto call the Social Posts endpoint - From the Social Posts response, select the
post_idfor the post you want comments for - Use that
post_idto call this Post Comments endpoint
Example workflow:
// Step 1: Get all social profiles for an artist
const socialsResponse = await getArtistSocials(
"10fd2b53-3fb8-4d75-bd23-f28520a3c7fc"
);
// Step 2: Select a social profile to get posts from
const socialId = socialsResponse.socials[0].social_id;
// Step 3: Get posts for the selected social profile
const postsResponse = await getSocialPosts(socialId, true);
// Step 4: Get comments for a specific post
const postId = postsResponse.posts[0].post_id;
const commentsResponse = await getPostComments(postId);
// Now you have comments for the specific post
console.log(`Comments for post:`, commentsResponse.comments);