Developer Documentation

SwipeAgent API

SwipeAgent watches TikTok at scale — millions of videos, the creators behind them, and the products they sell, enriched with transcripts and AI understanding. The API gives your code and your AI tools the same research agent the app uses: ask it about videos, creators, products and your Radar. One key, three ways in — HTTP, MCP, and the CLI.

ⓘ
Create and manage keys at swipeagent.ai/dev (requires a SwipeAgent subscription).

Quickstart#

Ask your first question in one request — the agent researches and answers with structured findings.

curl
curl https://swipeagent.ai/api/v1/agent \
  -H "X-Api-Key: vb_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "What are the top trending TikTok Shop products this week?"}'

Authentication#

API and CLI requests authenticate with the X-Api-Key header; for MCP clients, see How each client connects below. Keys are shown once at creation — store them like passwords.

http
X-Api-Key: vb_live_your_key_here

Agent API#

POST /api/v1/agent — ask the research agent anything in natural language. It runs the same tool stack as in-app chat — video/product/creator search, trends, transcripts, AI video descriptions — and returns a synthesized answer with structured findings. Requests are stateless; for multi-turn conversations, send the prior exchange back as messages.

Request body

  • prompt — a single question (string). Provide exactly one of prompt or messages.
  • messages — conversation history: [{"role": "user" | "assistant", "content": "..."}]
  • source — optional content scope: all (default), shop (TikTok Shop), apps, physical, digital
  • stream — optional, true for live progress (below)

Example

curl
curl https://swipeagent.ai/api/v1/agent \
  -H "X-Api-Key: vb_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {"role": "user", "content": "Find UGC-style videos promoting language learning apps with strong hooks"}
    ],
    "source": "apps"
  }'

Response

json
{
  "answer": "Here are the strongest matches...",
  "findings": {
    "videos":   [ { "video_id": "...", "title": "...", "views": 123456, "creator": "..." } ],
    "products": [],
    "creators": []
  },
  "suggestions": ["Compare their hooks", "Track these creators"],
  "usage": {
    "credits_charged": 1.25,
    "input_tokens": 15230,
    "output_tokens": 2048,
    "tool_calls": 4
  }
}

Live progress

With "stream": true the answer comes as Server-Sent Events while the agent works: run (its run_id), a progress event for each step ({"message": "Searching videos", "found": {"videos": 12, "creators": 3}}), then result with the answer, findings, files and usage. The run keeps going if you disconnect, and a very long one ends the stream with running: either way, GET /api/v1/agent/runs/<run_id> answers with the result, or while it runs with what it is doing now, its latest steps and how much it has found. Polling is free.

curl
curl -N https://swipeagent.ai/api/v1/agent \
  -H "X-Api-Key: vb_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "breakout skincare videos this week", "stream": true}'

Direct tools#

Besides the agent, your own agent can call 10 of SwipeAgent's research tools directly and do the thinking itself: the same read-only tools the in-app agent uses, over MCP (listed beside ask_swipeagent) and REST. They answer in seconds and cost a flat few credits a call.

  • findDirect — Finds lists of videos or creators from a plain-language request.
  • browse — Browse's videos, products and creators, with its filters and sorts.
  • productPage — One product: its numbers and the videos selling it.
  • creatorPage — One creator: their numbers and their videos.
  • getVideoDetails — One video in full, with its transcript when there is one.
  • similarVideos — Videos like a given one.
  • getRadarVideos — The videos on your Radar, with the Radar page's filters.
  • getRadarNew — What's new on your Radar.
  • getRadarCreators — The creators behind your Radar's videos.
  • getTopicSummary — How your tracked topics are doing.

No AI video descriptions are served: you get each video's own caption, numbers and links, and getVideoDetails adds its transcript when there is one.

REST

GET /api/v1/tools and POST /api/v1/tools/<name>. GET /api/v1/tools lists the tools your account can call, with each one's input. POST /api/v1/tools/<name> runs one: send your key in the X-Api-Key header and the tool's input as the JSON body. Every answer also reports today's usage: videos used, your daily limit and when it resets.

curl
curl https://swipeagent.ai/api/v1/tools/getVideoDetails \
  -H "X-Api-Key: vb_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"videoId": "7412345678901234567"}'

MCP

The same tools on https://swipeagent.ai/api/mcp, listed beside ask_swipeagent. Nothing changes in your client's setup.

CLI

The same tools as commands, from sa tools and sa tool <name> '<json>' to sa find "<request>": see the CLI.

Limits

  • Standard: 1,500 distinct videos a day. Ultra: 3,000 distinct videos a day.
  • That is one daily budget per paying account, shared by everyone on its team: the account whose plan and credits a call runs on (the owner of the workspace the call acts in), across all of its keys and workspaces. The owner's plan sets the limit, so a teammate working in an Ultra owner's workspace gets Ultra's budget.
  • A video anyone on the team already got today is free to read again.
  • Any one query reaches the top 100 results at most.
  • 30 calls a minute per person: each teammate has their own.
  • The day resets at midnight ET (New York time).
  • Once the day's videos are used up, ask_swipeagent (MCP) or POST /api/v1/agent (REST) keep working.

Credits

Credits per call: findDirect 5, every other tool 1. findDirect also uses a few model tokens, charged on top of its 5 credits.

Errors#

  • 400 — invalid body (the error message says what to fix)
  • 401 — missing or invalid API key
  • 402 — credit balance empty (top up in the app), or the account has no active plan
  • 410 — a retired endpoint (the data tools at /api/v1/data/<tool> and the older /api/v1/videos family); ask the agent instead
  • 429 — rate limited; retry after retry_after_s (also sent as a Retry-After header)

MCP Server#

Use SwipeAgent inside Claude, Cursor & friends. The MCP server exposes one research tool, ask_swipeagent, which runs the full SwipeAgent agent on your question (videos, breakouts, creators, products, your Radar) and returns a written answer plus structured findings, with get_result to collect longer runs. Streamable HTTP transport.

Longer research returns status: running and a run_id. Call get_result with that ID every 20–30 seconds until it completes; while it runs it says what the agent is doing, its latest steps and how many videos and creators it has found. Do not repeat the question to check progress. Before that, clients that show MCP progress notifications see each step live. Typical runs take 3–10 minutes. Polling is free. Completed runs are charged once; interrupted runs are not charged. Only you can read your results.

The direct tools are listed beside ask_swipeagent on the same server, under their own daily limits.

How each client connects
ClientHow it connects
Claude, ChatGPT, Claude Code and HermesSign in, no key
CursorInstall, then sign in, no key
The CLI and the REST APIAPI key in the x-api-key header

Server URL

url
https://swipeagent.ai/api/mcp

Claude Code

bash
claude mcp add --transport http swipeagent https://swipeagent.ai/api/mcp \
  --header "x-api-key: vb_live_your_key_here"

CLI#

SwipeAgent in your terminal: the direct tools as commands, and the agent with sa ask.

bash
npm i -g swipeagent
sa login vb_live_your_key_here
sa tools
sa browse videos --sort outlier --window week
sa video 7412345678901234567
sa find "male skincare creators who show their face"
sa ask "what's new on my Radar today?" --json
  • One command per tool: sa find "<request>", sa browse [videos|products|creators], sa product <id or link>, sa creator <@handle or link>, sa video <id or link>, sa similar <video id or link>, sa radar [topic], sa radar new, sa radar creators [topic], sa topics [topic].
  • sa tools and sa tool <name> '<json>': sa tools lists the tools your key can call, with their inputs (free). sa tool <name> '<json>' runs any of them with its input as JSON, as POST /api/v1/tools/<name> does; - reads the JSON from stdin, and --json prints the answer as it came.
  • The CLI's lookup commands call the direct tools, so they cost what the tools cost and share the same daily video budget: sa find 5 credits plus a few model tokens, every other tool command 1 credit a call; sa tools is free, and sa ask bills per question.
  • sa ask runs the SwipeAgent agent and spends credits; login, status and logout manage the key.
  • --json prints the raw response for scripts; exit codes tell failures apart (3 auth, 5 rate limited, 6 network, 7 out of credits, 8 the day's video budget is used up, 9 the direct tools aren't on for the account).
  • Env overrides: SWIPEAGENT_API_KEY, SWIPEAGENT_BASE_URL.

Usage & Fair Use#

  • Agent requests are metered in credits against your subscription (the usage block reports each request's cost). Your balance and per-key usage live at /dev.
  • Per-key rate limits sit far above human research pace; bulk extraction hits them quickly. Daily data budgets apply to how many distinct creators a key can sweep.
  • SwipeAgent answers the API, the MCP server and the CLI through its agent, plus the direct tools under their own limits. The former data endpoints (/api/v1/data/<tool>, /api/v1/videos, /products, …) and the MCP data tools are retired and answer 410; the same key works on everything documented here.

Support#

Questions or a use case the API doesn't cover? support@swipeagent.ai