Skip to main content

Comments

Retrieve comments from social media posts and send private replies to commenters.


Get Post Comments

Retrieve all comments on a specific post. Accepts either a numeric media ID or a full post URL.

Endpoint

GET /api/uploadposts/comments

Headers

NameValueDescription
AuthorizationApikey your-api-key-hereYour API key for authentication

Query Parameters

NameTypeRequiredDescription
platformStringYesThe platform to retrieve comments from (e.g., "instagram").
userStringYesProfile username (as configured in Upload-Post).
post_idStringYes*Numeric media ID. Use post_id or post_url (one is required).
post_urlStringYes*Full post URL (e.g., https://www.instagram.com/p/ABC123/). Alternative to post_id.

Example Requests

By post URL:

curl 'https://api.upload-post.com/api/uploadposts/comments?platform=instagram&user=my-profile&post_url=https://www.instagram.com/p/ABC123/' \
-H 'Authorization: Apikey your-api-key-here'

By media ID:

curl 'https://api.upload-post.com/api/uploadposts/comments?platform=instagram&user=my-profile&post_id=17890455123456789' \
-H 'Authorization: Apikey your-api-key-here'

Responses

  • 200 OK
{
"success": true,
"comments": [
{
"id": "17858893269123456",
"text": "Great post!",
"timestamp": "2025-06-15T10:30:00+0000",
"user": {
"id": "17841400123456789",
"username": "commenter_user"
}
},
{
"id": "17858893269789012",
"text": "Love this content",
"timestamp": "2025-06-15T11:00:00+0000",
"user": {
"id": "17841400987654321",
"username": "another_user"
}
}
]
}
  • 400 Bad Request
{
"success": false,
"error": "Missing required query parameters: platform, user, and either post_id or post_url"
}
  • 400 Bad Request (invalid post URL)
{
"success": false,
"error": "Could not find media ID for the provided URL. Make sure the post belongs to the authenticated account."
}
  • 400 Bad Request (rate limited)
{
"success": false,
"error": "Rate limit exceeded. Please wait 10 minutes before trying again."
}
  • 500 Internal Server Error
{
"success": false,
"error": "An internal server error occurred."
}

Note: When using a post URL, the API automatically resolves the shortcode to a media ID by scanning the account's recent posts. The resolved IDs are cached for subsequent requests. The post must belong to the authenticated account.

Rate limiting: Each post can only be queried once every 10 minutes to avoid excessive API calls.


Reply to Comment (Private Reply)

Send a private reply (DM) to the author of a comment on your post. This sends a direct message to the commenter.

Endpoint

POST /api/uploadposts/comments/reply

Headers

NameValueDescription
AuthorizationApikey your-api-key-hereYour API key for authentication

Body Parameters (JSON)

NameTypeRequiredDescription
platformStringYesThe platform (e.g., "instagram").
userStringYesProfile username (as configured in Upload-Post).
comment_idStringYesThe ID of the comment to reply to (from Get Post Comments).
messageStringYesThe private reply message text.

Example Request

curl -X POST https://api.upload-post.com/api/uploadposts/comments/reply \
-H 'Authorization: Apikey your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{
"platform": "instagram",
"user": "my-profile",
"comment_id": "17858893269123456",
"message": "Thanks for your comment! Check your DMs for more info."
}'

Responses

  • 200 OK (reply sent successfully)
{
"success": true,
"recipient_id": "17841400123456789",
"message_id": "aWdGM...",
"message": "Private reply sent successfully"
}
  • 400 Bad Request (missing fields)
{
"success": false,
"error": "Missing required fields: platform, user, comment_id, message"
}
  • 429 Too Many Requests (daily DM limit exceeded)
{
"success": false,
"error": "Daily DM limit exceeded."
}
  • 500 Internal Server Error
{
"success": false,
"error": "An internal server error occurred."
}

Important Notes

  1. 7-day window for private replies: Some platforms only allow private replies to recent comments (e.g., Instagram requires comments less than 7 days old).

  2. Comment must be on your post: You can only reply to comments on posts owned by the authenticated account.

  3. Daily DM limits: Upload-Post enforces a configurable daily DM limit per user. Private replies count toward this limit. When exceeded, the API returns a 429 status code.

  4. Using comment data for DMs: Each comment includes the commenter's user ID. You can use this ID with the Direct Messages endpoint to send follow-up DMs directly.