List the public playlists of a TikTok creator with the API
Playlists of a TikTok account. Complete code for GET /v1/tiktok/users/{user}/playlists in six languages and both official SDKs, each tested against the documented response.
Short answer. GET /v1/tiktok/users/{user}/playlists returns a public account's playlists: id, name, video_count, cover_url and url for each.
Facts checked 2 December 2026. Prices change: follow the links before you decide.
Why call it
- Creator analytics: see how a creator groups content into series and how many videos each one holds.
- Agencies and media kits: list a creator's recurring formats from the playlist names.
- Creator-search tools: show a creator's series with direct links.
The request
GET https://api.handlehaul.com/v1/tiktok/users/{user}/playlists with your key in the X-Api-Key header. Playlists of a TikTok account. Playlists of a TikTok account. 1 credit a page. Docs: https://api.handlehaul.com/docs/tiktok-posts-api
| Parameter | In | Description |
|---|---|---|
user required | path | TikTok handle (with or without @), numeric user id, or secUid. All digits = an id; write "@12345" for an all-digit handle. On list routes a handle we have to look up costs 1 extra credit (meta.lookup_credits); an id or secUid never does. |
cursor | query | next_cursor from the previous page (opaque, sealed). |
fresh | query | true skips the cache (full price). |
raw | query | true returns TikTok's raw JSON in data instead of our fields (same price). |
Code in 6 languages
Each sample is a complete program: it reads the key from HANDLEHAUL_API_KEY, waits and retries when the API answers 429 (using Retry-After), stops with the error code on anything else, and follows pagination.next_cursor for up to 3 pages. The SDK versions do the retries for you.
tiktok-playlists.sh
# Playlists of a TikTok account. --retry waits out a 429 using its Retry-After header;
# --fail exits with code 22 on any other error (drop it to read the error JSON).
# Next page: add --data-urlencode "cursor=<pagination.next_cursor>" (stop when it is null).
curl -sS --fail --retry 3 "https://api.handlehaul.com/v1/tiktok/users/mila.studio/playlists" \
-H "X-Api-Key: $HANDLEHAUL_API_KEY"
tiktok_playlists.pyInstall: pip install requestsRun: python tiktok_playlists.py
# Playlists of a TikTok account: GET /v1/tiktok/users/{user}/playlists
# pip install requests
import os
import time
import requests
API = "https://api.handlehaul.com/v1"
HEADERS = {"X-Api-Key": os.environ["HANDLEHAUL_API_KEY"]}
def get(path, params=None):
"""GET one endpoint. Waits and retries on 429 (Retry-After); stops on any other error."""
for attempt in range(5):
r = requests.get(API + path, headers=HEADERS, params=params, timeout=60)
if r.status_code == 429:
time.sleep(float(r.headers.get("Retry-After") or 2 ** attempt))
continue
body = r.json()
if not r.ok:
err = body.get("error", {})
raise SystemExit(f"{r.status_code} {err.get('code')}: {err.get('message')}")
return body
raise SystemExit("Still rate limited after 5 tries")
params = {}
credits = 0
for page in range(3): # each page is one call; stop when you have enough
body = get("/tiktok/users/mila.studio/playlists", params)
credits += body["meta"]["credits_charged"]
for row in body["data"]:
print(row["name"], row["video_count"], row["url"])
if not body["pagination"]["has_more"]:
break
params["cursor"] = body["pagination"]["next_cursor"]
print("credits used:", credits)
tiktok_playlists_sdk.pyInstall: pip install handlehaulRun: python tiktok_playlists_sdk.py
# Playlists of a TikTok account: GET /v1/tiktok/users/{user}/playlists
# pip install handlehaul
from handlehaul import HandleHaul, HandleHaulError
hh = HandleHaul() # reads HANDLEHAUL_API_KEY; retries 429 using Retry-After
try:
credits = 0
for page in hh.tiktok.playlists.pages("mila.studio", max_pages=3): # each page is one call
credits += page.meta["credits_charged"]
for row in page.data:
print(row["name"], row["video_count"], row["url"])
print("credits used:", credits)
except HandleHaulError as e:
raise SystemExit(f"{e.status} {e.code}: {e.message}")
tiktok-playlists.mjsRun: node tiktok-playlists.mjs
// Playlists of a TikTok account: GET /v1/tiktok/users/{user}/playlists
// Node.js 18+ (built-in fetch, no packages). Save as tiktok-playlists.mjs: top-level await needs .mjs.
const API = "https://api.handlehaul.com/v1";
const KEY = process.env.HANDLEHAUL_API_KEY;
// GET one endpoint. Waits and retries on 429 (Retry-After); throws on any other error.
async function get(path, params = {}) {
const url = new URL(API + path);
for (const [k, v] of Object.entries(params)) url.searchParams.set(k, v);
for (let attempt = 0; attempt < 5; attempt++) {
const res = await fetch(url, { headers: { "X-Api-Key": KEY } });
if (res.status === 429) {
const wait = Number(res.headers.get("retry-after")) || 2 ** attempt;
await new Promise((resolve) => setTimeout(resolve, wait * 1000));
continue;
}
const body = await res.json();
if (!res.ok) throw new Error(`${res.status} ${body.error?.code}: ${body.error?.message}`);
return body;
}
throw new Error("Still rate limited after 5 tries");
}
const params = {};
let credits = 0;
for (let page = 0; page < 3; page++) { // each page is one call; stop when you have enough
const body = await get("/tiktok/users/mila.studio/playlists", params);
credits += body.meta.credits_charged;
for (const row of body.data) console.log(row.name, row.video_count, row.url);
if (!body.pagination.has_more) break;
params.cursor = body.pagination.next_cursor;
}
console.log("credits used:", credits);
tiktok-playlists-sdk.mjsInstall: npm install handlehaulRun: node tiktok-playlists-sdk.mjs
// Playlists of a TikTok account: GET /v1/tiktok/users/{user}/playlists
// npm install handlehaul (save as tiktok-playlists-sdk.mjs)
import { HandleHaul, HandleHaulError } from "handlehaul";
const hh = new HandleHaul(); // reads HANDLEHAUL_API_KEY; retries 429 using Retry-After
try {
let credits = 0;
for await (const page of hh.tiktok.playlists.pages("mila.studio", { maxPages: 3 })) { // each page is one call
credits += page.meta.credits_charged;
for (const row of page.data) console.log(row.name, row.video_count, row.url);
}
console.log("credits used:", credits);
} catch (e) {
if (!(e instanceof HandleHaulError)) throw e;
console.error(`${e.status} ${e.code}: ${e.message}`);
process.exit(1);
}
tiktok-playlists.phpRun: php tiktok-playlists.php
<?php
// Playlists of a TikTok account: GET /v1/tiktok/users/{user}/playlists
// PHP 8 with the curl extension. Run: php tiktok-playlists.php
const API = "https://api.handlehaul.com/v1";
// GET one endpoint. Waits and retries on 429 (Retry-After); throws on any other error.
function get(string $path, array $params = []): array
{
$url = API . $path . ($params ? "?" . http_build_query($params) : "");
for ($attempt = 0; $attempt < 5; $attempt++) {
$retryAfter = 0;
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
CURLOPT_HTTPHEADER => ["X-Api-Key: " . getenv("HANDLEHAUL_API_KEY")],
CURLOPT_HEADERFUNCTION => function ($ch, $line) use (&$retryAfter) {
if (stripos($line, "retry-after:") === 0) {
$retryAfter = (float) trim(substr($line, 12));
}
return strlen($line);
},
]);
$raw = curl_exec($ch);
if ($raw === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status === 429) {
usleep((int) (($retryAfter ?: 2 ** $attempt) * 1000000));
continue;
}
$body = json_decode($raw, true);
if ($status >= 400) {
throw new RuntimeException("$status {$body["error"]["code"]}: {$body["error"]["message"]}");
}
return $body;
}
throw new RuntimeException("Still rate limited after 5 tries");
}
// Print values on one line (strings as they are, everything else as JSON).
function show(...$values): void
{
echo implode(" ", array_map(fn($v) => is_string($v) ? $v : json_encode($v), $values)), "\n";
}
$params = [];
$credits = 0;
for ($page = 0; $page < 3; $page++) { // each page is one call; stop when you have enough
$body = get("/tiktok/users/mila.studio/playlists", $params);
$credits += $body["meta"]["credits_charged"];
foreach ($body["data"] as $row) {
show($row["name"], $row["video_count"], $row["url"]);
}
if (!$body["pagination"]["has_more"]) {
break;
}
$params["cursor"] = $body["pagination"]["next_cursor"];
}
show("credits used:", $credits);
tiktok_playlists.goRun: go run tiktok_playlists.go
// Playlists of a TikTok account: GET /v1/tiktok/users/{user}/playlists
// Go 1.18+, standard library only. Run: go run tiktok_playlists.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"net/url"
"os"
"strconv"
"time"
)
const api = "https://api.handlehaul.com/v1"
var client = &http.Client{Timeout: 60 * time.Second}
type listResponse struct {
Data []map[string]any `json:"data"`
Pagination struct {
NextCursor *string `json:"next_cursor"`
HasMore bool `json:"has_more"`
} `json:"pagination"`
Meta struct {
CreditsCharged float64 `json:"credits_charged"`
} `json:"meta"`
}
type apiError struct {
Error struct {
Code string `json:"code"`
Message string `json:"message"`
} `json:"error"`
}
// get calls one endpoint and decodes the answer into out. It waits and retries on 429
// (Retry-After) and returns an error for any other failure.
func get(path string, params url.Values, out any) error {
u := api + path
if len(params) > 0 {
u += "?" + params.Encode()
}
for attempt := 0; attempt < 5; attempt++ {
req, err := http.NewRequest(http.MethodGet, u, nil)
if err != nil {
return err
}
req.Header.Set("X-Api-Key", os.Getenv("HANDLEHAUL_API_KEY"))
res, err := client.Do(req)
if err != nil {
return err
}
raw, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
return err
}
if res.StatusCode == http.StatusTooManyRequests {
wait, _ := strconv.ParseFloat(res.Header.Get("Retry-After"), 64)
if wait <= 0 {
wait = float64(int(1) << attempt)
}
time.Sleep(time.Duration(wait * float64(time.Second)))
continue
}
if res.StatusCode >= 400 {
var e apiError
_ = json.Unmarshal(raw, &e)
return fmt.Errorf("%d %s: %s", res.StatusCode, e.Error.Code, e.Error.Message)
}
dec := json.NewDecoder(bytes.NewReader(raw))
dec.UseNumber() // keeps big ids and counts exact
return dec.Decode(out)
}
return fmt.Errorf("still rate limited after 5 tries")
}
// field reads a nested value, e.g. field(row, "counts", "views"); nil when it is missing.
func field(m map[string]any, keys ...string) any {
var v any = m
for _, k := range keys {
obj, ok := v.(map[string]any)
if !ok {
return nil
}
v = obj[k]
}
return v
}
func main() {
params := url.Values{}
credits := 0.0
for page := 0; page < 3; page++ { // each page is one call; stop when you have enough
var body listResponse
if err := get("/tiktok/users/mila.studio/playlists", params, &body); err != nil {
log.Fatal(err)
}
credits += body.Meta.CreditsCharged
for _, row := range body.Data {
fmt.Println(field(row, "name"), field(row, "video_count"), field(row, "url"))
}
if !body.Pagination.HasMore || body.Pagination.NextCursor == nil {
break
}
params.Set("cursor", *body.Pagination.NextCursor)
}
fmt.Println("credits used:", credits)
}
tiktok-playlists.rbRun: ruby tiktok-playlists.rb
# Playlists of a TikTok account: GET /v1/tiktok/users/{user}/playlists
# Ruby 3, standard library only. Run: ruby tiktok-playlists.rb
require "json"
require "net/http"
require "uri"
API = "https://api.handlehaul.com/v1"
# GET one endpoint. Waits and retries on 429 (Retry-After); stops on any other error.
def get(path, params = {})
uri = URI(API + path)
uri.query = URI.encode_www_form(params) unless params.empty?
5.times do |attempt|
req = Net::HTTP::Get.new(uri)
req["X-Api-Key"] = ENV.fetch("HANDLEHAUL_API_KEY")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https", read_timeout: 60) do |http|
http.request(req)
end
if res.code == "429"
sleep((res["Retry-After"] || 2**attempt).to_f)
next
end
body = JSON.parse(res.body)
abort "#{res.code} #{body.dig("error", "code")}: #{body.dig("error", "message")}" unless res.is_a?(Net::HTTPSuccess)
return body
end
abort "Still rate limited after 5 tries"
end
params = {}
credits = 0
3.times do # each page is one call; stop when you have enough
body = get("/tiktok/users/mila.studio/playlists", params)
credits += body["meta"]["credits_charged"]
body["data"].each do |row|
puts [row["name"], row["video_count"], row["url"]].join(" ")
end
break unless body["pagination"]["has_more"]
params["cursor"] = body["pagination"]["next_cursor"]
end
puts "credits used: #{credits}"
Response
A list in data, with pagination.next_cursor and has_more, and meta with what the call cost. Example values; tiktokplaylist shape from the openapi schema; example values, from the API docs. Lists are cut to two rows here.
{
"data": [
{
"id": "7280000000000000101",
"name": "Studio tips",
"video_count": 24,
"cover_url": "https://p16-sign.tiktokcdn-us.com/…/playlist/7280000000000000101.jpeg",
"url": "https://www.tiktok.com/@mila.studio/playlist/Studio-tips-7280000000000000101"
}
],
"pagination": {
"next_cursor": null,
"has_more": false,
"page_size": 1
},
"meta": {
"request_id": "req_…",
"cached": false,
"cache_age_seconds": 0,
"credits_charged": 1,
"credits_remaining": 26943
}
}
Cost, cache and limits
- 1 credit per page. At $1.40 to $0.80 per 1,000 calls; the samples stop after 3 pages, so one run costs 3 credits at most (plus a lookup credit, below). Cache hits, failed calls and
429answers are free;meta.credits_chargedsays what each call cost. - Lookup credit. A handle we have not looked up in the last 7 days adds 1 lookup credit (
meta.lookup_credits). Asec_uidor numericidfrom any result skips it, and later pages never pay it. - Cache. Identical calls that arrive while an answer is cached are served from it. Add
fresh=trueto force a live call (billed). - Speed. Over your plan's requests-per-second limit the API answers
429 rate_limitedwithRetry-After; the samples wait that long and retry. - Private accounts. Public data only: a private account answers
403 private_account, and that call is free. - Testing. A
kd_test_key returns sample data in this exact shape at no cost, so you can run the code before you spend anything.
Things to know
- Only public playlists are listed.
- Each playlist gives its
video_count, not the videos themselves. Use/postsfor the account's videos. raw=truereturns TikTok's own JSON indataat the same price, if you need more than these five fields.
Next steps
- TikTok posts API: videos and photo posts of a TikTok account, newest first.
- TikTok profile API: tikTok profile: bio, verified and private flags, follower, following, like and video counts.
- API reference: every field and error code.
- All TikTok API tutorials, or no code at all with n8n, Make, Zapier and Google Sheets.
TikTok playlists API: questions
Can I get the videos inside a TikTok playlist?
id, name, video_count, cover and url. For the videos, page through /v1/tiktok/users/{user}/posts.Are private TikTok playlists included?
private_account.Run it on real data
One key for Instagram and TikTok. $1.40 to $0.80 per 1,000 calls; failed calls and cache hits are free.
Want to test first? Sandbox keys are free and unlimited, with sample data in the live schema.