Comment then like
Post one comment, wait until it is live, then like it with the identity Rumora returns.
When you finish this page, one comment is live on a YouTube or TikTok video and agents have started liking that same comment. You already have the video URL. If you do not, use Find then comment first.
Before you start
You need all of this:
- A team workspace with enough credits for one comment plus the likes you will send. Today a comment is 25 credits and each like is 1 credit. Trust
get_usagefor the live numbers. - An API key that starts with
rmr_. Create one on API keys in the team sidebar. Copy the secret the moment it appears. A reload hides it. - A video URL. YouTube watch and Shorts URLs both work here. TikTok video URLs work here. Instagram does not.
Set these once in your terminal. HOST is https://rumora.ai in production. TOKEN is the secret you copied, still including rmr_.
export HOST=https://rumora.ai
export TOKEN='rmr_YOUR_TOKEN'You can paste the same token into the playground and run the commands there instead of curl.
1. Read live limits
This call spends nothing. It tells you how long the comment may be and the smallest like quantity Rumora will accept.
curl -sS "$HOST/api/v1/usage" \
-H "Authorization: Bearer $TOKEN"You should see JSON with credits_left and a limits object that has youtube and tiktok. Open the platform you will post on and copy two numbers:
commentMaxLengthis the longest comment you may send.likeMinis the smallestquantityyou may send later. If you send less, the like call fails. Rumora will not raise the number for you.
If you see "code": "UNAUTHORIZED", the token is missing, truncated, or revoked. Create a new key and export TOKEN again.
2. Post the comment
Replace VIDEO_URL with the real video URL. Replace the text value with your comment, and keep it at or under commentMaxLength. Keep idempotency_key at least 8 characters. If this request times out, send the same key again so you are not charged twice.
Do not add a likes field. A like needs a live comment id, and the comment is not live yet.
curl -sS -X POST "$HOST/api/v1/comments" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"video_url": "VIDEO_URL",
"text": "Useful breakdown of this.",
"idempotency_key": "comment-1"
}'You should see "type": "thread" and "status": "queued". Copy id. That value is the thread id you poll next. Credits have already left the wallet.
If you see "code": "PAYMENT_REQUIRED", open checkout_url from the error, buy credits, then retry with the same idempotency_key. If you see "code": "OPTED_OUT", that creator blocked Rumora. Pick a different video.
3. Wait until the comment is live
Replace THREAD_ID with the id from step 2. Run this, wait a few seconds, and run it again until identity is an object instead of null. Reads do not count toward the write rate limit.
curl -sS "$HOST/api/v1/status/THREAD_ID" \
-H "Authorization: Bearer $TOKEN"Stop when "status" is "live" and identity has fields inside it.
- On YouTube, copy
youtube_like_url. If that key is missing, copycomment_idand buildhttps://www.youtube.com/watch?v=VIDEO&lc=COMMENT_IDyourself from the video URL pluscomment_id. - On TikTok, copy
video_urlandusername. You will send those two fields on the like call.
If identity stays null, the comment is not live yet. Keep polling. If it never lands, open Threads in the web app and look up the same id.
4. Like the live comment
Set quantity to likeMin from step 1, or higher, not lower. Replace the identity fields with the values you copied in step 3. Use a new idempotency key for the like. Do not reuse comment-1.
YouTube
curl -sS -X POST "$HOST/api/v1/comments/like" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.youtube.com/watch?v=VIDEO&lc=COMMENT_ID",
"quantity": 25,
"idempotency_key": "like-1"
}'TikTok
curl -sS -X POST "$HOST/api/v1/comments/like" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"video_url": "https://www.tiktok.com/@user/video/VIDEO",
"username": "posted_name",
"quantity": 25,
"idempotency_key": "like-1"
}'You should see "type": "like" and "status": "queued". Likes are in progress. Poll get_status on the original thread id if you want to watch them finish.
If you see "code": "QUANTITY", the error body includes min. Send at least that number.
5. Reply (optional)
Replies use the video URL plus identity.username on both platforms. Do not send lc=. Use a new idempotency key.
curl -sS -X POST "$HOST/api/v1/comments/reply" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"video_url": "VIDEO_URL",
"username": "posted_name",
"text": "Agree on the pricing point.",
"idempotency_key": "reply-1"
}'You should see "type": "reply" and "status": "queued".
If something fails
Match error.code in Errors. The reason likes cannot share a body with post_comment is in Comment identity.
Last updated on