Guides/LinkedIn / Python

Post to LinkedIn from Python

Personal-profile posting (text, images, PDF) without implementing LinkedIn's OAuth and Community Management APIs yourself.

~15 minPython 3.9+LinkedIn personal profile
Prerequisites

Step 1Install the SDK

The Python client mirrors the REST API. Company-page posting is a later Aether phase — this guide covers personal profiles.

pip install aether

Step 2Instantiate the client

Read the API key from the environment.

import os
import aether

client = aether.Aether(api_key=os.environ["AETHER_API_KEY"])

Step 3Connect a LinkedIn profile

Generate a Connect Link, open it in a browser, and store the profileId that comes back.

link = client.connect_links.create(
    platform="linkedin",
    redirect_url="https://yourapp.com/linkedin/connected",
)
print(link.url)

Step 4Post text, an image, or a PDF

media_urls can be images or PDF documents. LinkedIn personal profiles accept all three.

post = client.posts.create(
    text="Shipping the LinkedIn integration from Python.",
    profile_ids=["li_person456"],
    media_urls=["https://your-cdn.com/one-pager.pdf"],
)
print(post.data.status)

Step 5Schedule in a timezone you control

Pass scheduled_for as UTC ISO 8601. Convert from the user's local time in your app.

from datetime import datetime, timezone, timedelta

when = datetime.now(timezone.utc) + timedelta(hours=6)
client.posts.create(
    text="Queued for the US morning feed.",
    profile_ids=["li_person456"],
    scheduled_for=when.strftime("%Y-%m-%dT%H:%M:%SZ"),
)
What you've covered
  • pip install aether
  • Connect Link for LinkedIn OAuth
  • Text / image / PDF posts
  • Timezone-safe scheduling

Start building

Free API key — 3 connected accounts, all endpoints, no credit card.