DEV Community

Trix Cyrus
Trix Cyrus

Posted on • Edited on

How to Automate Social Media Posting with Python

Author: Trix Cyrus

Managing multiple social media platforms programmatically is complex. Each platform has its own API, authentication flow, rate limits, media requirements, and SDKs. Building and maintaining integrations for Twitter, Instagram, LinkedIn, TikTok, YouTube, and others can quickly become difficult to scale.

Late solves this problem by providing a unified API and official SDKs that allow developers to automate posting, scheduling, analytics, inbox management, and media uploads across 13 major social media platforms using a single integration.

This guide covers how Late works and how to use its SDKs — with a focus on the Node.js SDK, along with Python and REST API support.

Documentation: https://docs.getlate.dev


Supported Platforms

Late supports automation across the following 13 platforms:

  • Twitter / X
  • Instagram
  • Facebook
  • LinkedIn
  • TikTok
  • YouTube
  • Pinterest
  • Reddit
  • Bluesky
  • Threads
  • Google Business Profile
  • Telegram
  • Snapchat

Supported content types include:

  • Text posts
  • Images
  • Videos
  • Threads
  • Stories
  • Reels
  • Shorts
  • Carousels
  • Documents

This allows full automation across modern social platforms.


Core Architecture

Late uses a simple and scalable architecture based on three main concepts:

Profiles
Containers that group your social accounts (for example: personal brand, company, or client).

Accounts
Connected social media accounts inside profiles.

Posts
Content that can be:

  • Published immediately
  • Scheduled
  • Drafted
  • Cross-posted to multiple platforms

Base API URL:

https://getlate.dev/api/v1
Enter fullscreen mode Exit fullscreen mode

Official SDK Support

Late provides official SDKs for multiple programming languages:

  • Node.js (Recommended)
  • Python
  • Go
  • Ruby
  • Java
  • PHP
  • .NET
  • Rust

Node.js SDK repository:
https://github.com/getlate-dev/late-node


Method 1: Using Node.js SDK (Recommended)

The Node.js SDK is the most powerful and flexible way to integrate Late into backend systems, automation tools, and SaaS platforms.

Install dependencies:

npm install @getlate/sdk
Enter fullscreen mode Exit fullscreen mode

Example: Publish a post

import { Late } from "@getlate/sdk";

const late = new Late({
  apiKey: process.env.LATE_API_KEY
});

const post = await late.posts.create({
  content: "Automated post using Late Node.js SDK",
  platforms: [
    {
      platform: "twitter",
      accountId: "acc_xxx"
    },
    {
      platform: "linkedin",
      accountId: "acc_yyy"
    }
  ],
  publishNow: true
});

console.log("Post published:", post);
Enter fullscreen mode Exit fullscreen mode

Schedule Posts Using Node.js

await late.posts.create({
  content: "Scheduled post example",
  scheduledFor: "2026-02-10T10:00:00Z",
  platforms: [
    {
      platform: "instagram",
      accountId: "acc_xxx"
    }
  ]
});
Enter fullscreen mode Exit fullscreen mode

Upload Media Using Node.js

const media = await late.media.upload("video.mp4");

await late.posts.create({
  content: "Video post example",
  mediaUrls: [media.publicUrl],
  platforms: [
    {
      platform: "youtube",
      accountId: "acc_xxx"
    }
  ],
  publishNow: true
});
Enter fullscreen mode Exit fullscreen mode

Method 2: Using Python SDK

Install Python SDK:

pip install late-sdk
Enter fullscreen mode Exit fullscreen mode

Example:

from late import Late

late = Late(api_key="YOUR_API_KEY")

post = late.posts.create(
    content="Automated post using Python SDK",
    platforms=[
        {"platform": "twitter", "accountId": "acc_xxx"}
    ],
    publish_now=True
)

print(post)
Enter fullscreen mode Exit fullscreen mode

Method 3: Using REST API (Works with Any Language)

Example using curl:

curl -X POST https://getlate.dev/api/v1/posts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Automated post using REST API",
    "publishNow": true,
    "platforms": [
      {
        "platform": "linkedin",
        "accountId": "acc_xxx"
      }
    ]
  }'
Enter fullscreen mode Exit fullscreen mode

This works with:

  • Go
  • Java
  • PHP
  • Rust
  • C#
  • Python
  • Node.js
  • Any backend system

Cross-Posting to Multiple Platforms

Example:

await late.posts.create({
  content: "Cross-posting example",
  publishNow: true,
  platforms: [
    { platform: "twitter", accountId: "acc_xxx" },
    { platform: "linkedin", accountId: "acc_yyy" },
    { platform: "facebook", accountId: "acc_zzz" }
  ]
});
Enter fullscreen mode Exit fullscreen mode

Late handles publishing automatically.


Analytics and Monitoring

Retrieve analytics:

const analytics = await late.analytics.get({
  period: "30d"
});

console.log(analytics);
Enter fullscreen mode Exit fullscreen mode

Track performance across platforms from one API.


Inbox and Interaction Management

Late also provides unified inbox features:

  • Read messages
  • Reply to comments
  • Manage reviews
  • Respond to conversations

Supported platforms include:

  • Facebook
  • Instagram
  • Twitter / X
  • Reddit
  • Telegram
  • Google Business

Additional Features

Late provides:

  • Post scheduling
  • Draft posts
  • Queue automation
  • Media upload
  • Unified analytics
  • Team collaboration
  • Account management

Pricing Overview

Plans include:

  • Free plan available
  • Paid plans for developers, creators, and enterprises
  • Full API access on all plans
  • Support for all 13 platforms

Use Cases

Late is ideal for:

  • SaaS platforms
  • Automation tools
  • Marketing platforms
  • AI automation systems
  • Content scheduling systems
  • Developer tools

Why Use Late Instead of Individual APIs?

Traditional approach:

  • Multiple SDKs
  • Complex integrations
  • Higher maintenance

Unified Late API approach:

  • Single integration
  • Faster development
  • Easier scaling
  • Cleaner architecture

Conclusion

Late provides a powerful unified API and SDK ecosystem that allows developers to automate posting, scheduling, analytics, and inbox management across 13 major social media platforms.

With official SDKs for Node.js, Python, Go, Java, PHP, .NET, Ruby, and Rust, Late can be integrated into virtually any system or automation workflow.

Documentation: https://docs.getlate.dev
Node.js SDK: https://github.com/getlate-dev/late-node


~TrixSec

Top comments (3)

Collapse
 
qianl15 profile image
Qian Li

Useful tutorial! I wonder how to post scheduled posts? The code here posts a single post to those platforms, but what if you want to schedule a post every day?

Collapse
 
trixsec profile image
Trix Cyrus

check out

Collapse
 
trixsec profile image
Trix Cyrus

Sure I'll post it today, stay tuned