Retail, scripted

How a jewelry and watch retailer automates social media with Python

A jewelry and luxury watch retailer in Southeast Asia, posting with Python scripts against the API.

By , founder of posterly ·

How they postPython scriptsREST API
550+
Posts published
5
Networks
7,000+
API calls from scripts

The challenge

A retailer with a large product catalogue has more to post about than anyone can keep up with by hand. The general problem is getting product content out to Instagram, Facebook, TikTok, YouTube and Google Business on a schedule, driven by data that already exists, without anyone retyping it.

How they set it up

To build something similar, start with the API reference for the request shapes, and the ecommerce page for the posting side of a retail brand.

1

Connect the five networks

Instagram, Facebook, TikTok, YouTube and Google Business are connected to posterly so scripts can target any of them.

2

Write Python against the API

Python scripts call the posterly API to upload media and create scheduled posts.

3

Let the scripts do the repetitive work

The scripts have made 7,000+ API calls so far. That is the kind of repetitive work nobody wants to do through a browser.

4

Review in the dashboard

The scheduled posts show up in the calendar, so someone can still spot-check what is going out.

What you need

  • Your social accounts connected to posterly, and the account IDs for each one from GET /api/v1/accounts.
  • An API key from Dashboard, API and MCP, plus the paid API and MCP add-on. The pricing page lists the current prices.
  • Python 3 with the requests library, or any other HTTP client. The API docs include a ready-made Python example to start from.
  • A source for your content: a spreadsheet, a CSV export or a product feed with a caption, an image address and a publish time for each row.

Set up the same workflow yourself

These steps are written for you. They are general how-to guidance, not a record of what this customer did.

  1. 1

    Export your catalogue

    Export it to a CSV with one row per post: a row ID, the caption, the image URL and the time you want it to go out.

  2. 2

    Look up account IDs once

    Call GET /api/v1/accounts and keep the ID for each network in a small settings file, so the script never has to guess which account a post belongs to.

  3. 3

    Bring the media into posterly

    POST /api/v1/media/upload-from-url copies a public image into posterly storage and returns a URL to use in the post. Videos and other large files use a signed upload instead.

  4. 4

    Validate, then create

    Send each row to POST /api/v1/posts with dry_run set to true first, then without it. Print what comes back so you can see exactly what was scheduled.

  5. 5

    Make reruns safe

    Send an Idempotency-Key built from the row ID. Running the script twice then returns the original posts instead of creating duplicates.

  6. 6

    Listen for failures

    Register a webhook for post.failed, or list posts with the failed status after each run, so a bad post does not go unnoticed.

What it can look like

Illustrations written for this page, checked against the API and MCP docs. They are not the customer's own prompts or code.

Example, not the customer's ownExample script
import csv
import requests

BASE_URL = "https://www.poster.ly/api/v1"
HEADERS = {"Authorization": "Bearer pst_live_YOUR_API_KEY"}
ACCOUNT_ID = "YOUR_ACCOUNT_ID"

with open("posts.csv", newline="") as f:
    for row in csv.DictReader(f):
        media = requests.post(
            f"{BASE_URL}/media/upload-from-url",
            headers=HEADERS,
            json={"url": row["image_url"], "filename": f"{row['id']}.jpg"},
        ).json()
        if "url" not in media:
            print("Media failed for", row["id"], media)
            continue

        body = {
            "account_id": ACCOUNT_ID,
            "caption": row["caption"],
            "media_urls": [media["url"]],
            "scheduled_at": row["scheduled_at"],
        }

        check = requests.post(
            f"{BASE_URL}/posts", headers=HEADERS, json={**body, "dry_run": True}
        ).json()
        if not check.get("valid"):
            print("Skipped", row["id"], check)
            continue

        post = requests.post(
            f"{BASE_URL}/posts",
            headers={**HEADERS, "Idempotency-Key": f"catalogue-{row['id']}"},
            json=body,
        ).json()["post"]
        print(row["id"], post["status"], post["scheduled_at"])

Written for this page, following the Python example in the API docs. Add error handling and pauses between calls, and read the key from an environment variable, before you run anything like it on a real catalogue.

Things to watch out for

  • Create requests are rate limited per key and per plan. Pause between calls or use the batch endpoint, and read the 429 message, which says when the limit resets.
  • Test on a few rows first. A dry run creates nothing, so you can check a whole file safely before the real run.
  • Third-party image URLs are copied into posterly storage when the post is created, so a short-lived link must still work at that moment.
  • Each network has its own media rules, and posterly checks them when you create the post. A post that could never publish is rejected with a 400 instead of failing later, so log those errors.
  • Keep the API key out of the script. Read it from an environment variable so it never ends up in version control.

What you can copy

You do not need a big engineering team to automate social media. If your products already live in a spreadsheet or a catalogue, a short Python script plus the posterly API can turn that data into scheduled posts on Instagram, Facebook, TikTok, YouTube and Google Business.

Platforms in this story

Related

Set up the same workflow

Start a free 7-day trial, connect your accounts and schedule your first posts today.

Card-backed 7-day trial. Cancel anytime.

FAQ

Common questions

Shared anonymously from real posterly account activity. Figures as of November 2026.