tiktok
client
Pure-Go best-effort read client for public TikTok content.
Pure-Go best-effort read client for public TikTok content.
A pure-Go, dependency-free, best-effort read client for public TikTok content, talking to TikTok's undocumented web JSON endpoints. The Go API is small and stable with an overridable base URL for network-free testing; the code builds correct requests and parses correct responses, but working end-to-end against live TikTok is not guaranteed.
TikTok does not publish or support a public web API. This client calls the same internal endpoints TikTok's own website uses, and TikTok actively defends them.
Requests often need a valid `msToken` and a signed parameter (`X-Bogus` / `_signature`) that this library does not compute; many reads additionally require a logged-in `sessionid` cookie. Expect anti-bot responses (403/429, or a 200 with an empty body) at any time.
Pure Go, standard library only. go get github.com/go-tiktok/tiktok
c := tiktok.New(
tiktok.WithMSToken("...msToken from a browser session..."),
tiktok.WithSessionID("...sessionid cookie for authed reads..."),
)
// secUid is TikTok's opaque per-user id; obtain it once from a profile
// page's embedded JSON, then pass it here.
feed, err := c.UserPosts(context.Background(), "MS4wLjABAAAA...", 20, "0")
if err != nil {
panic(err)
}
for _, v := range feed.Videos {
fmt.Printf("%s %d likes %s\n", v.Permalink, v.Likes, v.Description)
}
fmt.Printf("cursor=%s hasMore=%v\n", feed.Cursor, feed.HasMore)Everything that actually exists in the org today.
tiktok
clientPure-Go best-effort read client for public TikTok content.
brand
brandLogos, icons and social images for go-tiktok.