Upload-Post SDK for Python
Official Python client for the Upload-Post API - Cross-platform social media upload.
Upload videos, photos, text posts, and documents to TikTok, Instagram, YouTube, LinkedIn, Facebook, Pinterest, Threads, Reddit, Bluesky, Discord, Telegram, X (Twitter), Slack, Mastodon, Nostr, Lemmy, Dev.to, Hashnode, WordPress, Whop, and Listmonk with a single API.
Installation
pip install upload-post
Quick Start
from upload_post import UploadPostClient
client = UploadPostClient("YOUR_API_KEY")
# Upload a video to multiple platforms
response = client.upload_video(
"video.mp4",
title="Check out this awesome video! 🎬",
user="my-profile",
platforms=["tiktok", "instagram", "youtube"]
)
print(response)
Timeouts and retries
Every request has a timeout: 60 seconds by default, and 10 minutes for uploads
and other requests that send or download a file (a synchronous upload waits on
the server before it answers, and a big video takes minutes to send). A
request that runs out raises UploadPostError with status_code None.
Change them in seconds (None or 0 = no limit):
client = UploadPostClient("YOUR_API_KEY", timeout=30, upload_timeout=1800)
A timed-out upload may still have reached the API. Give every upload an
idempotency_key (sent as the Idempotency-Key header) and reuse it when you
retry: the API returns the first upload instead of publishing it twice.
import uuid
key = str(uuid.uuid4()) # once, outside the retry loop
client.upload_video("video.mp4", title="Hi", user="my-profile",
platforms=["tiktok"], idempotency_key=key)
Features
- ✅ Video Upload - TikTok, Instagram, YouTube, LinkedIn, Facebook, Pinterest, Threads, Bluesky, Discord, Telegram, X, Mastodon, WordPress
- ✅ Photo Upload - TikTok, Instagram, LinkedIn, Facebook, Pinterest, Threads, Reddit, Bluesky, Discord, Telegram, X, Mastodon, Lemmy, WordPress
- ✅ Text Posts - X, LinkedIn, Facebook, Threads, Reddit, Bluesky, Discord, Telegram, Slack, Mastodon, Nostr, Lemmy, Dev.to, Hashnode, WordPress, Whop, Listmonk
- ✅ Document Upload - LinkedIn (PDF, PPT, PPTX, DOC, DOCX)
- ✅ Scheduling - Schedule posts for later
- ✅ Posting Queue - Add posts to your configured queue
- ✅ First Comments - Auto-post first comment after publishing
- ✅ Analytics - Get engagement metrics
- ✅ Audience - Who follows a profile, per platform
- ✅ Suggestions - Hashtags and searches to post about, per platform
- ✅ Comments - Read, reply, moderate; replies under a comment on TikTok, Threads, YouTube, Instagram, Facebook and LinkedIn
- ✅ Direct Messages - Instagram, WhatsApp (messaging only: WhatsApp does not publish posts), Bluesky and Telegram bot DMs
- ✅ AutoDM rules - Account-wide Instagram comment/story/keyword DMs
- ✅ Webhook deliveries - 7-day delivery log and redelivery
- ✅ Phone numbers - Buy a number for WhatsApp, SMS and calls (paid plans; no emergency calls)
- ✅ Full Type Hints
API Reference
Upload Video
response = client.upload_video(
"video.mp4",
title="My awesome video",
user="my-profile",
platforms=["tiktok", "instagram", "youtube"],
# Optional: Schedule for later
scheduled_date="2024-12-25T10:00:00Z",
timezone="Europe/Madrid",
# Optional: Add first comment
first_comment="Thanks for watching! 🙏",
# Optional: Platform-specific settings
disable_comment=False, # TikTok
media_type="REELS", # Instagram
privacyStatus="public", # YouTube
tags=["tutorial", "coding"], # YouTube
)
Upload Photos
# Upload single or multiple photos
response = client.upload_photos(
["photo1.jpg", "photo2.jpg", "https://example.com/photo3.jpg"],
title="Check out these photos! 📸",
user="my-profile",
platforms=["instagram", "facebook", "x"],
# Optional: Add to queue instead of posting immediately
add_to_queue=True,
# Platform-specific
media_type="IMAGE", # Instagram: IMAGE or STORIES
facebook_page_id="your-page-id",
)
Upload Text Posts
response = client.upload_text(
title="Just shipped a new feature! 🚀 Check it out at example.com",
user="my-profile",
platforms=["x", "linkedin", "threads"],
# Optional: Create a poll on X
poll_options=["Option A", "Option B", "Option C"],
poll_duration=1440, # 24 hours in minutes
# Optional: Post to a LinkedIn company page
target_linkedin_page_id="company-page-id",
)
Upload Documents (LinkedIn)
response = client.upload_document(
"presentation.pdf",
title="Q4 2024 Report",
user="my-profile",
description="Check out our latest quarterly results!",
visibility="PUBLIC",
target_linkedin_page_id="company-page-id", # Optional: post to company page
)
# Any file up to 50 MB to Telegram (or both, with platforms=["linkedin", "telegram"])
client.upload_document("archive.zip", title="Files", user="my-profile", platforms=["telegram"])
Upload fields added in 2.22.0
- Threads:
threads_gif_id (text posts, a GIPHY id), threads_spoiler_media
(images, videos, carousels), threads_text_spoilers ([{"offset", "length"}], up to
10) and threads_ghost_post (a temporary text post; list_threads_ghost_posts shows
when it expires).
- Facebook (text posts):
facebook_backdated_time (a past Unix time or ISO 8601
date) and facebook_backdated_time_granularity (year, month, day, hour, minute).
- X:
x_video_title, x_video_description, x_video_cta (visit_site,
watch_now, app_install), x_video_cta_url, x_video_cta_app_store_id,
x_video_cta_ipad_app_store_id, x_video_cta_play_store_id (videos); x_clip_post_id,
x_clip_start_seconds, x_clip_end_seconds (text posts: a clip of the video of
another post of the account).
- Instagram: a single video sent with
upload_photos is published as a Reel and
takes cover_url (a URL), thumb_offset, share_to_feed and audio_name;
user_tags also works on a video Story.
X reads and actions that need an X permission (bookmarks, lists, followers and following,
likers, reposts_of_me, hiding replies) only work with an X account connected or
reconnected on or after 2026-11-25; an older connection answers 403
x_reconnect_required (reconnect X to grant them).
client.upload_text(
title="Guess what is coming",
user="my-profile",
platforms=["threads"],
threads_ghost_post=True,
threads_text_spoilers=[{"offset": 6, "length": 4}],
)
Check Upload Status
For async uploads, check the status using the request_id:
status = client.get_status("request_id_from_upload")
print(status)
For scheduled or queued posts, check the status using the job_id:
status = client.get_job_status("job_id_from_scheduled_post")
print(status)
Get Upload History
history = client.get_history(page=1, limit=20)
print(history)
Scheduled Posts
# List all scheduled posts
scheduled = client.list_scheduled()
# Edit a scheduled post
client.edit_scheduled(
"job-id",
scheduled_date="2024-12-26T15:00:00Z",
timezone="America/New_York",
)
# Fix the text in place (only the platforms listed change)
client.edit_scheduled(
"job-id",
platform_content={"instagram": {"caption": "New Instagram caption"}},
)
# Change any other option by its API form name (None removes it), schedule the
# video natively on YouTube, or replace the Reels cover
client.edit_scheduled(
"job-id",
fields={"privacyStatus": "unlisted", "disable_comment": True},
youtube_publish_at="2026-11-01T09:00:00Z",
cover_image_base64="data:image/jpeg;base64,...", # or remove_cover=True
)
# Cancel a scheduled post
client.cancel_scheduled("job-id")
User Management
# List all profiles
users = client.list_users()
# Create a new profile (409 "Username already in use" if it exists,
# 403 PROFILE_LIMIT_REACHED at the plan's profile limit)
client.create_user("new-profile")
# Delete a profile
client.delete_user("old-profile")
# Generate JWT for platform integration (white-label)
jwt = client.generate_jwt(
"my-profile",
redirect_url="https://yourapp.com/callback",
platforms=["tiktok", "instagram"],
# Optional: force the connection page language for this profile.
# Supported: "en", "es", "de", "fr", "pt", "pl", "tr". When omitted, the page
# auto-detects the visitor's browser language and falls back to English.
language="es",
# Optional: override individual connection-page strings. Flat dict of i18n
# dot-path keys to strings. Max 100 entries, keys ^[a-zA-Z0-9_.]+$, values
# up to 300 chars. Echoed back in the "profile" object of validate_jwt.
ui_labels={
"connect.title": "Link your accounts",
"connect.subtitle": "Publish everywhere from one place",
},
)
Get Analytics
analytics = client.get_analytics(
"my-profile",
platforms=["instagram", "tiktok"],
)
print(analytics)
# Instagram returns two audience breakdowns with the same shape
# ("age", "gender", "country", "city"):
print(analytics["analytics"]["instagram"]["follower_demographics"])
print(analytics["analytics"]["instagram"]["engaged_audience_demographics"])
Post Analytics and TikTok drafts
# Every platform the upload went to, or just one of them
stats = client.get_post_analytics("REQUEST_ID")
tiktok = client.get_post_analytics("REQUEST_ID", platform="tiktok")
# Any post of the account by its native id (e.g. one returned by get_media)
client.get_post_analytics_by_platform_id("7412345678901234567", "tiktok", "my-profile")
A TikTok upload sent to drafts (post_mode="MEDIA_UPLOAD" or
tiktok_upload_to_draft=True) has no post until the creator publishes it from
the TikTok app. Call get_post_analytics(request_id) after that: Upload-Post
asks TikTok which post came from the draft, then returns its metrics and fills
in platform_post_id and post_url.
- While the draft is still in the inbox,
post_metrics_error says so. That
answer is reused for a while (about 5 minutes for a fresh upload, up to 6
hours for one several days old); after 30 days without a post Upload-Post
stops asking.
- TikTok only gives the post id once the post is public and moderated. A
draft published as private never gets per-post analytics.
- TikTok rows carry
original_publish_id (the upload's TikTok publish_id),
here and in get_cached_post_analytics. post_url is empty when the
account's @username is not known.
Cached Post Analytics
Replays per-post metrics already fetched, instead of calling the platforms again. Only contains posts previously fetched through a live per-post endpoint; there is no background refresh, so captured_at is the last time that post was read live. Not subject to the live
calls, so it is not subject to the live post-analytics rate limit
(100 requests / 5 minutes). Use it to page through a profile's post history.
cursor = None
while True:
page = client.get_cached_post_analytics(
"my-profile",
platform="youtube", # optional: instagram, tiktok, youtube, facebook, linkedin, threads, pinterest, reddit
limit=50, # default 50, max 200
since="2026-06-01", # defaults to 30 days ago
until="2026-07-01", # defaults to today
cursor=cursor,
)
for post in page["posts"]:
print(post["platform"], post["post_id"], post["metrics"])
cursor = page["next_cursor"]
if not cursor:
break
Get Media
Retrieve recent posts from a connected social account. Supported platforms:
instagram, tiktok, youtube, linkedin, facebook, x, threads,
pinterest, bluesky, reddit.
# Personal LinkedIn profile (default for non-org accounts):
media = client.get_media("linkedin", "my-profile")
# Force the personal profile of an account connected as an org admin:
media = client.get_media("linkedin", "my-profile", page_urn="me")
# Target a specific LinkedIn organization page:
media = client.get_media("linkedin", "my-profile", page_urn="12345")
The response carries a pagination object — {"limit": ..., "next_cursor": ..., "has_more": ...}, with next_cursor None and has_more False on the last
page:
cursor = None
while True:
page = client.get_media("instagram", "my-profile", limit=50, cursor=cursor)
print(len(page["media"]))
cursor = page["pagination"]["next_cursor"]
if not cursor:
break
limit defaults to 25 and is clamped to 1-100, with per-platform caps of 20 for
TikTok and 50 for YouTube. LinkedIn, Discord and Telegram do not support
cursors — they accept limit only, and passing a cursor returns HTTP 400.
Helper Methods
# Get Facebook pages for a profile
fb_pages = client.get_facebook_pages("my-profile")
# Get LinkedIn pages for a profile
li_pages = client.get_linkedin_pages("my-profile")
# Resolve any LinkedIn company Page to the urn + exact name a mention needs
org = client.resolve_linkedin_organization(
"my-profile", "https://www.linkedin.com/company/linkedin/"
)
print(org["urn"], org["name"], org["mention"]) # urn:li:organization:1337 LinkedIn @[LinkedIn](urn:li:organization:1337)
# Get Pinterest boards for a profile
boards = client.get_pinterest_boards("my-profile")
# TikTok: trending Commercial Music Library tracks
music = client.get_tiktok_trending_music(
"my-profile", genre="POP", country_code="ES", date_range="7DAY"
)
# TikTok: find a track by song or artist
found = client.search_tiktok_music("my-profile", q="bad bunny", country_code="ES")
# TikTok: search locations to tag
locations = client.get_tiktok_locations("my-profile", "Madrid")
Comments
The same methods cover every platform that has comments — Instagram, Facebook,
YouTube, LinkedIn and TikTok. There is no per-network method: the endpoint
answers one question and platform says who to ask.
# Read the comments on a post. TikTok has no post-URL lookup: pass the video id.
comments = client.get_post_comments(
user="my-profile",
platform="tiktok",
post_id="7412345678901234567",
limit=20,
)
# Read the replies hanging from one of them — same question, one more parameter
replies = client.get_post_comments(
user="my-profile",
platform="tiktok",
post_id="7412345678901234567",
comment_id="7412345678909999999",
)
# Same on Instagram, Facebook and LinkedIn (company Pages). On LinkedIn pass the
# comment_urn from the listing; a bare id is only looked up in the first 250.
replies = client.get_post_comments(
user="my-profile",
platform="linkedin",
post_id="urn:li:share:7500811262105264139",
comment_id="urn:li:comment:(urn:li:activity:7500811262105264139,7503818768586981376)",
)
# Comment on the post, or reply to a comment
client.create_comment(
user="my-profile",
platform="tiktok",
post_id="7412345678901234567",
message="Thanks for watching!",
)
client.create_comment(
user="my-profile",
platform="tiktok",
comment_id="7412345678909999999",
message="Glad you liked it",
)
# Delete one
client.delete_comment(
user="my-profile", platform="tiktok", comment_id="7412345678909999999"
)
You can also have the first comment posted for you right after publishing, with
first_comment for every platform or tiktok_first_comment for TikTok alone.
On TikTok all of this needs the comments capability, which the account grants
when it connects — see
What a TikTok connection can do.
Replies (comment_id) work on TikTok, Threads, YouTube, Instagram, Facebook and
LinkedIn (company Pages only); post_id is still required. X and Bluesky answer
platform_not_supported. Error codes you can branch on with
UploadPostError.error_code: