Help us shape the future of Go! Take the 2026 Go Developer Survey

tiktok

package module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 12 Imported by: 0

README

TikTok clients for Crawlora

Official Crawlora client packages for the hosted TikTok API. Access 53 API endpoints covering video, user, and hashtag search; profiles and posts; comments; trends; Creative Center; and Top Ads data from JavaScript/TypeScript, Python, Go, Ruby, Java, and PHP. These clients call Crawlora's hosted API; they do not scrape TikTok locally. Requests use your Crawlora account and CRAWLORA_API_KEY; service usage follows your account billing plan. Crawlora is independent from and not affiliated with or endorsed by TikTok or its owners.

Language packages

For installation and runnable examples, use the README for your language. See the API endpoint and parameter reference for shared operation details.

Create an account at crawlora.net, open the Crawlora console to get an API key, or read the API documentation. Keep CRAWLORA_API_KEY out of source control.

API coverage and supported endpoints

The six language clients provide access to all 53 selected public TikTok API operations. Search or browse by endpoint path and operation ID below; the complete API reference adds parameters, enums, and response details.

Method Endpoint API operation Description
GET /tiktok/category tiktok-category List TikTok explore categories
GET /tiktok/comments tiktok-video-comments Retrieve TikTok video comments
GET /tiktok/creative-center/filters tiktok-creative-center-filters Retrieve TikTok Creative Center filter taxonomy
GET /tiktok/creative-center/hashtags tiktok-creative-center-hashtags Retrieve TikTok Creative Center trending hashtags
GET /tiktok/creative-center/top-content tiktok-creative-center-top-content Retrieve TikTok Creative Center top content
GET /tiktok/creative-center/videos tiktok-creative-center-videos Retrieve TikTok Creative Center trending videos
GET /tiktok/explore/{id} tiktok-explore Retrieve the TikTok explore feed for a category
GET /tiktok/hashtag/{name} tiktok-challenge Retrieve TikTok hashtag details
GET /tiktok/hashtags tiktok-challenge-list Retrieve TikTok hashtag posts
GET /tiktok/mobile/anchor/list tiktok-mobile-anchor-list Anchor catalogue used by the video composer
GET /tiktok/mobile/comment/replies tiktok-mobile-comment-replies Retrieve replies to a TikTok comment
GET /tiktok/mobile/comments tiktok-mobile-comments Retrieve comments for a TikTok video
GET /tiktok/mobile/feed tiktok-mobile-feed Retrieve the TikTok mobile For You feed
GET /tiktok/mobile/feed/post tiktok-mobile-feed-post Fetch the app's primary feed call (POST, protobuf) decoded without a schema
GET /tiktok/mobile/hashtag tiktok-mobile-hashtag Retrieve a TikTok hashtag
GET /tiktok/mobile/hashtag/posts tiktok-mobile-hashtag-posts Retrieve videos for a TikTok hashtag
GET /tiktok/mobile/hashtags tiktok-mobile-hashtags Search TikTok hashtags
GET /tiktok/mobile/live/effects tiktok-mobile-live-effects Retrieve TikTok LIVE effects
GET /tiktok/mobile/live/gifts tiktok-mobile-live-gifts Retrieve TikTok LIVE gifts
GET /tiktok/mobile/live/search tiktok-mobile-live-search Search TikTok LIVE streams
GET /tiktok/mobile/music/beats tiktok-mobile-music-beats Retrieve TikTok music beats
GET /tiktok/mobile/music/collections tiktok-mobile-music-collections Retrieve TikTok music collections
GET /tiktok/mobile/music/pick tiktok-mobile-music-pick Retrieve TikTok sound chart picks
GET /tiktok/mobile/music/posts tiktok-mobile-music-posts Retrieve videos for a TikTok sound
GET /tiktok/mobile/music/related tiktok-mobile-music-related Retrieve sounds related to a TikTok video
GET /tiktok/mobile/music/trending tiktok-mobile-music-trending Retrieve TikTok trending sounds
GET /tiktok/mobile/search tiktok-mobile-search Search TikTok videos on the mobile API
GET /tiktok/mobile/search/music tiktok-mobile-search-music Search TikTok sounds on the mobile API
GET /tiktok/mobile/search/place tiktok-mobile-search-place Search TikTok places
GET /tiktok/mobile/search/pre-info tiktok-mobile-search-pre-info Pre-search info token for a search session
GET /tiktok/mobile/search/sug tiktok-mobile-search-sug Retrieve TikTok search suggestions
GET /tiktok/mobile/search/tabs tiktok-mobile-search-tabs Search tabs available for a keyword
GET /tiktok/mobile/search/user tiktok-mobile-search-user Search TikTok users on the mobile API
GET /tiktok/mobile/trending/categories tiktok-mobile-trending-categories Retrieve TikTok trending categories
GET /tiktok/mobile/trending/effects tiktok-mobile-trending-effects Retrieve TikTok trending effects
GET /tiktok/popular-trend/country-industry-meta tiktok-popular-trend-country-industry-meta Retrieve TikTok popular-trend country and industry metadata
GET /tiktok/post/{id} tiktok-post Retrieve TikTok video details
GET /tiktok/posts tiktok-profile-post Retrieve posts from a TikTok profile
GET /tiktok/profile/{handler} tiktok-profile Retrieve a TikTok profile
GET /tiktok/search tiktok-search Search TikTok videos
GET /tiktok/search/hashtag tiktok-search-hashtag Search TikTok hashtags
GET /tiktok/search/user tiktok-search-user Search TikTok users
GET /tiktok/top-ads/analysis tiktok-top-ads-analysis Retrieve TikTok Top Ads interactive time analysis
GET /tiktok/top-ads/detail tiktok-top-ads-detail Retrieve TikTok Top Ads detail
GET /tiktok/top-ads/filters tiktok-top-ads-filters Retrieve TikTok Top Ads filters
GET /tiktok/top-ads/list tiktok-top-ads-list Retrieve TikTok Top Ads
GET /tiktok/top-ads/location-info tiktok-top-ads-location-info Retrieve TikTok Top Ads location info
GET /tiktok/top-ads/locations tiktok-top-ads-locations Retrieve TikTok Top Ads locations
GET /tiktok/top-ads/recommend tiktok-top-ads-recommend Retrieve TikTok Top Ads recommendations
GET /tiktok/top-ads/safety tiktok-top-ads-safety Retrieve TikTok Top Ads safety configuration
GET /tiktok/top-ads/spotlight tiktok-top-ads-spotlight Retrieve TikTok Top Ads Spotlight
GET /tiktok/top-ads/suggestions tiktok-top-ads-suggestions Retrieve TikTok Top Ads suggestions
GET /tiktok/trending tiktok-trending Retrieve TikTok trending posts

License

MIT. See LICENSE.

Documentation

Overview

Package tiktok is Crawlora's TikTok API client for 53 endpoints, covering video, user, and hashtag search; profiles and posts; comments; trends; Creative Center; and Top Ads data. API documentation: https://crawlora.net/docs?utm_source=pkg.go.dev&utm_medium=referral&utm_campaign=platform-clients&utm_content=tiktok-go-api-docs

Index

Examples

Constants

View Source
const (
	DefaultBaseURL = "https://api.crawlora.net/api/v1"
	Version        = "0.4.0"
)
View Source
const OperationCount = 53

OperationCount reports how many selected-platform operations this module exposes.

Variables

This section is empty.

Functions

func OperationIDs

func OperationIDs() []string

OperationIDs returns the selected operation IDs in stable sorted order.

Types

type Client

type Client struct {
	APIKey     string
	BaseURL    string
	Timeout    time.Duration
	HTTPClient *http.Client
}

Client calls only the operation IDs included in this platform module.

func NewClient

func NewClient(apiKey string) *Client

NewClient creates a client using the supplied API key, or CRAWLORA_API_KEY when empty.

func (*Client) Call

func (c *Client) Call(ctx context.Context, operationID string, params Params) (any, error)

Call executes a selected platform operation by operation ID.

Example
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
	w.Header().Set("Content-Type", "application/json")
	_, _ = w.Write([]byte(`{"ok":true}`))
}))
defer server.Close()

client := NewClient("your-crawlora-api-key")
client.BaseURL = server.URL + "/api/v1"
client.HTTPClient = server.Client()
result, err := client.Call(context.Background(), "tiktok-category", Params{})
if err != nil {
	panic(err)
}
fmt.Println(result.(map[string]any)["ok"])
Output:
true

func (*Client) Category

func (c *Client) Category(ctx context.Context, params Params) (any, error)

Category calls the tiktok-category operation.

func (*Client) Challenge

func (c *Client) Challenge(ctx context.Context, params Params) (any, error)

Challenge calls the tiktok-challenge operation.

func (*Client) ChallengeList

func (c *Client) ChallengeList(ctx context.Context, params Params) (any, error)

ChallengeList calls the tiktok-challenge-list operation.

func (*Client) Close

func (c *Client) Close() error

Close releases idle connections held by the configured HTTP transport.

func (*Client) CreativeCenterFilters added in v0.3.0

func (c *Client) CreativeCenterFilters(ctx context.Context, params Params) (any, error)

CreativeCenterFilters calls the tiktok-creative-center-filters operation.

func (*Client) CreativeCenterHashtags

func (c *Client) CreativeCenterHashtags(ctx context.Context, params Params) (any, error)

CreativeCenterHashtags calls the tiktok-creative-center-hashtags operation.

func (*Client) CreativeCenterTopContent added in v0.3.0

func (c *Client) CreativeCenterTopContent(ctx context.Context, params Params) (any, error)

CreativeCenterTopContent calls the tiktok-creative-center-top-content operation.

func (*Client) CreativeCenterVideos

func (c *Client) CreativeCenterVideos(ctx context.Context, params Params) (any, error)

CreativeCenterVideos calls the tiktok-creative-center-videos operation.

func (*Client) Explore

func (c *Client) Explore(ctx context.Context, params Params) (any, error)

Explore calls the tiktok-explore operation.

func (*Client) MobileAnchorList added in v0.4.0

func (c *Client) MobileAnchorList(ctx context.Context, params Params) (any, error)

MobileAnchorList calls the tiktok-mobile-anchor-list operation.

func (*Client) MobileCommentReplies added in v0.4.0

func (c *Client) MobileCommentReplies(ctx context.Context, params Params) (any, error)

MobileCommentReplies calls the tiktok-mobile-comment-replies operation.

func (*Client) MobileComments added in v0.4.0

func (c *Client) MobileComments(ctx context.Context, params Params) (any, error)

MobileComments calls the tiktok-mobile-comments operation.

func (*Client) MobileFeed added in v0.3.0

func (c *Client) MobileFeed(ctx context.Context, params Params) (any, error)

MobileFeed calls the tiktok-mobile-feed operation.

func (*Client) MobileFeedPost added in v0.4.0

func (c *Client) MobileFeedPost(ctx context.Context, params Params) (any, error)

MobileFeedPost calls the tiktok-mobile-feed-post operation.

func (*Client) MobileHashtag added in v0.4.0

func (c *Client) MobileHashtag(ctx context.Context, params Params) (any, error)

MobileHashtag calls the tiktok-mobile-hashtag operation.

func (*Client) MobileHashtagPosts added in v0.4.0

func (c *Client) MobileHashtagPosts(ctx context.Context, params Params) (any, error)

MobileHashtagPosts calls the tiktok-mobile-hashtag-posts operation.

func (*Client) MobileHashtags added in v0.4.0

func (c *Client) MobileHashtags(ctx context.Context, params Params) (any, error)

MobileHashtags calls the tiktok-mobile-hashtags operation.

func (*Client) MobileLiveEffects added in v0.4.0

func (c *Client) MobileLiveEffects(ctx context.Context, params Params) (any, error)

MobileLiveEffects calls the tiktok-mobile-live-effects operation.

func (*Client) MobileLiveGifts added in v0.4.0

func (c *Client) MobileLiveGifts(ctx context.Context, params Params) (any, error)

MobileLiveGifts calls the tiktok-mobile-live-gifts operation.

func (*Client) MobileLiveSearch added in v0.4.0

func (c *Client) MobileLiveSearch(ctx context.Context, params Params) (any, error)

MobileLiveSearch calls the tiktok-mobile-live-search operation.

func (*Client) MobileMusicBeats added in v0.4.0

func (c *Client) MobileMusicBeats(ctx context.Context, params Params) (any, error)

MobileMusicBeats calls the tiktok-mobile-music-beats operation.

func (*Client) MobileMusicCollections added in v0.4.0

func (c *Client) MobileMusicCollections(ctx context.Context, params Params) (any, error)

MobileMusicCollections calls the tiktok-mobile-music-collections operation.

func (*Client) MobileMusicPick added in v0.4.0

func (c *Client) MobileMusicPick(ctx context.Context, params Params) (any, error)

MobileMusicPick calls the tiktok-mobile-music-pick operation.

func (*Client) MobileMusicPosts added in v0.4.0

func (c *Client) MobileMusicPosts(ctx context.Context, params Params) (any, error)

MobileMusicPosts calls the tiktok-mobile-music-posts operation.

func (*Client) MobileMusicRelated added in v0.4.0

func (c *Client) MobileMusicRelated(ctx context.Context, params Params) (any, error)

MobileMusicRelated calls the tiktok-mobile-music-related operation.

func (*Client) MobileMusicTrending added in v0.4.0

func (c *Client) MobileMusicTrending(ctx context.Context, params Params) (any, error)

MobileMusicTrending calls the tiktok-mobile-music-trending operation.

func (*Client) MobileSearch added in v0.4.0

func (c *Client) MobileSearch(ctx context.Context, params Params) (any, error)

MobileSearch calls the tiktok-mobile-search operation.

func (*Client) MobileSearchMusic added in v0.4.0

func (c *Client) MobileSearchMusic(ctx context.Context, params Params) (any, error)

MobileSearchMusic calls the tiktok-mobile-search-music operation.

func (*Client) MobileSearchPlace added in v0.4.0

func (c *Client) MobileSearchPlace(ctx context.Context, params Params) (any, error)

MobileSearchPlace calls the tiktok-mobile-search-place operation.

func (*Client) MobileSearchPreInfo added in v0.4.0

func (c *Client) MobileSearchPreInfo(ctx context.Context, params Params) (any, error)

MobileSearchPreInfo calls the tiktok-mobile-search-pre-info operation.

func (*Client) MobileSearchSug added in v0.4.0

func (c *Client) MobileSearchSug(ctx context.Context, params Params) (any, error)

MobileSearchSug calls the tiktok-mobile-search-sug operation.

func (*Client) MobileSearchTabs added in v0.4.0

func (c *Client) MobileSearchTabs(ctx context.Context, params Params) (any, error)

MobileSearchTabs calls the tiktok-mobile-search-tabs operation.

func (*Client) MobileSearchUser added in v0.4.0

func (c *Client) MobileSearchUser(ctx context.Context, params Params) (any, error)

MobileSearchUser calls the tiktok-mobile-search-user operation.

func (*Client) MobileTrendingCategories added in v0.4.0

func (c *Client) MobileTrendingCategories(ctx context.Context, params Params) (any, error)

MobileTrendingCategories calls the tiktok-mobile-trending-categories operation.

func (*Client) MobileTrendingEffects added in v0.4.0

func (c *Client) MobileTrendingEffects(ctx context.Context, params Params) (any, error)

MobileTrendingEffects calls the tiktok-mobile-trending-effects operation.

func (*Client) PopularTrendCountryIndustryMeta

func (c *Client) PopularTrendCountryIndustryMeta(ctx context.Context, params Params) (any, error)

PopularTrendCountryIndustryMeta calls the tiktok-popular-trend-country-industry-meta operation.

func (*Client) Post

func (c *Client) Post(ctx context.Context, params Params) (any, error)

Post calls the tiktok-post operation.

func (*Client) Profile

func (c *Client) Profile(ctx context.Context, params Params) (any, error)

Profile calls the tiktok-profile operation.

func (*Client) ProfilePost

func (c *Client) ProfilePost(ctx context.Context, params Params) (any, error)

ProfilePost calls the tiktok-profile-post operation.

func (*Client) Search

func (c *Client) Search(ctx context.Context, params Params) (any, error)

Search calls the tiktok-search operation.

func (*Client) SearchHashtag

func (c *Client) SearchHashtag(ctx context.Context, params Params) (any, error)

SearchHashtag calls the tiktok-search-hashtag operation.

func (*Client) SearchUser

func (c *Client) SearchUser(ctx context.Context, params Params) (any, error)

SearchUser calls the tiktok-search-user operation.

func (*Client) TopAdsAnalysis

func (c *Client) TopAdsAnalysis(ctx context.Context, params Params) (any, error)

TopAdsAnalysis calls the tiktok-top-ads-analysis operation.

func (*Client) TopAdsDetail

func (c *Client) TopAdsDetail(ctx context.Context, params Params) (any, error)

TopAdsDetail calls the tiktok-top-ads-detail operation.

func (*Client) TopAdsFilters

func (c *Client) TopAdsFilters(ctx context.Context, params Params) (any, error)

TopAdsFilters calls the tiktok-top-ads-filters operation.

func (*Client) TopAdsList

func (c *Client) TopAdsList(ctx context.Context, params Params) (any, error)

TopAdsList calls the tiktok-top-ads-list operation.

func (*Client) TopAdsLocationInfo

func (c *Client) TopAdsLocationInfo(ctx context.Context, params Params) (any, error)

TopAdsLocationInfo calls the tiktok-top-ads-location-info operation.

func (*Client) TopAdsLocations

func (c *Client) TopAdsLocations(ctx context.Context, params Params) (any, error)

TopAdsLocations calls the tiktok-top-ads-locations operation.

func (*Client) TopAdsRecommend

func (c *Client) TopAdsRecommend(ctx context.Context, params Params) (any, error)

TopAdsRecommend calls the tiktok-top-ads-recommend operation.

func (*Client) TopAdsSafety

func (c *Client) TopAdsSafety(ctx context.Context, params Params) (any, error)

TopAdsSafety calls the tiktok-top-ads-safety operation.

func (*Client) TopAdsSpotlight

func (c *Client) TopAdsSpotlight(ctx context.Context, params Params) (any, error)

TopAdsSpotlight calls the tiktok-top-ads-spotlight operation.

func (*Client) TopAdsSuggestions

func (c *Client) TopAdsSuggestions(ctx context.Context, params Params) (any, error)

TopAdsSuggestions calls the tiktok-top-ads-suggestions operation.

func (*Client) Trending

func (c *Client) Trending(ctx context.Context, params Params) (any, error)

Trending calls the tiktok-trending operation.

func (*Client) VideoComments

func (c *Client) VideoComments(ctx context.Context, params Params) (any, error)

VideoComments calls the tiktok-video-comments operation.

type Params

type Params map[string]any

Params maps the exact OpenAPI parameter names expected by this platform client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL