Skip to content
UGC API

Quickstart

This page takes you from zero to a published post. You need a UGC API account, one social account to post to, and a public video or image URL. Before your first real post, buy a pack in Dashboard → Billing (dry runs are free). Packs are one-time, from $10 for 1,000 posts, down to 0.68¢ a post with bigger packs, and credits never expire.

Updated

1. Create an API key

Sign in to the dashboard, buy a pack under Billing, and create a key. Keys look like ugc_live_... and are shown once, so copy it somewhere safe. All requests go to https://ugcapi.dev/v1 with the key as a Bearer token. See authentication.

2. Connect an account

bash
curl https://ugcapi.dev/v1/accounts/connect \
  -H "Authorization: Bearer ugc_live_..." \
  -H "Content-Type: application/json" \
  -d '{"platform": "tiktok", "external_id": "me"}'

The response is { "url": "..." }. Open the URL, log in on TikTok and approve. Then list your accounts to get the account ID:

bash
curl https://ugcapi.dev/v1/accounts -H "Authorization: Bearer ugc_live_..."

Each account has an id like acc_.... You post to these IDs.

3. Publish a post

curl

bash
curl https://ugcapi.dev/v1/posts \
  -H "Authorization: Bearer ugc_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "accounts": ["acc_123"],
    "format": "video",
    "media": ["https://cdn.example.com/clip.mp4"],
    "caption": "First post from the API #test"
  }'

JavaScript

javascript
const res = await fetch("https://ugcapi.dev/v1/posts", {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + process.env.UGCAPI_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    accounts: ["acc_123"],
    format: "video",
    media: ["https://cdn.example.com/clip.mp4"],
    caption: "First post from the API #test",
  }),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const post = await res.json();
console.log(post.id, post.status);

Python

python
import os, requests

res = requests.post(
    "https://ugcapi.dev/v1/posts",
    headers={"Authorization": "Bearer " + os.environ["UGCAPI_KEY"]},
    json={
        "accounts": ["acc_123"],
        "format": "video",
        "media": ["https://cdn.example.com/clip.mp4"],
        "caption": "First post from the API #test",
    },
)
res.raise_for_status()
post = res.json()
print(post["id"], post["status"])

Without scheduled_at, the post publishes right away. The response has the post id and a results array with one entry per account and placement.

4. Check the result

bash
curl https://ugcapi.dev/v1/posts/post_abc -H "Authorization: Bearer ugc_live_..."

Each result moves from scheduled to publishing to published (with a public url) or failed (with an error). For production, set up webhooks instead of polling.

Next steps

FAQ

Do I need to host my media?

No. Upload files with POST /v1/media and use the returned URL. You can also pass any public URL.

Are there free posts?

Yes. Every new workspace gets 10 free posts to try it. After that, pick a monthly plan with unlimited posts (Pro $39 for 10 accounts, Agency $79 for any number) or pay as you go with packs from $10 for 1,000 posts. To test without posting, add dry_run: true, which is free and needs no credits.

Is there a sandbox?

There is no separate sandbox. Add dry_run: true to check a request without posting; it is free and needs no credits. For a real end-to-end test, post to a test account and set privacy options where the platform allows.

Related