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 ¶
- Constants
- func OperationIDs() []string
- type Client
- func (c *Client) Call(ctx context.Context, operationID string, params Params) (any, error)
- func (c *Client) Category(ctx context.Context, params Params) (any, error)
- func (c *Client) Challenge(ctx context.Context, params Params) (any, error)
- func (c *Client) ChallengeList(ctx context.Context, params Params) (any, error)
- func (c *Client) Close() error
- func (c *Client) CreativeCenterFilters(ctx context.Context, params Params) (any, error)
- func (c *Client) CreativeCenterHashtags(ctx context.Context, params Params) (any, error)
- func (c *Client) CreativeCenterTopContent(ctx context.Context, params Params) (any, error)
- func (c *Client) CreativeCenterVideos(ctx context.Context, params Params) (any, error)
- func (c *Client) Explore(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileAnchorList(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileCommentReplies(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileComments(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileFeed(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileFeedPost(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileHashtag(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileHashtagPosts(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileHashtags(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileLiveEffects(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileLiveGifts(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileLiveSearch(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileMusicBeats(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileMusicCollections(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileMusicPick(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileMusicPosts(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileMusicRelated(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileMusicTrending(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileSearch(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileSearchMusic(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileSearchPlace(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileSearchPreInfo(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileSearchSug(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileSearchTabs(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileSearchUser(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileTrendingCategories(ctx context.Context, params Params) (any, error)
- func (c *Client) MobileTrendingEffects(ctx context.Context, params Params) (any, error)
- func (c *Client) PopularTrendCountryIndustryMeta(ctx context.Context, params Params) (any, error)
- func (c *Client) Post(ctx context.Context, params Params) (any, error)
- func (c *Client) Profile(ctx context.Context, params Params) (any, error)
- func (c *Client) ProfilePost(ctx context.Context, params Params) (any, error)
- func (c *Client) Search(ctx context.Context, params Params) (any, error)
- func (c *Client) SearchHashtag(ctx context.Context, params Params) (any, error)
- func (c *Client) SearchUser(ctx context.Context, params Params) (any, error)
- func (c *Client) TopAdsAnalysis(ctx context.Context, params Params) (any, error)
- func (c *Client) TopAdsDetail(ctx context.Context, params Params) (any, error)
- func (c *Client) TopAdsFilters(ctx context.Context, params Params) (any, error)
- func (c *Client) TopAdsList(ctx context.Context, params Params) (any, error)
- func (c *Client) TopAdsLocationInfo(ctx context.Context, params Params) (any, error)
- func (c *Client) TopAdsLocations(ctx context.Context, params Params) (any, error)
- func (c *Client) TopAdsRecommend(ctx context.Context, params Params) (any, error)
- func (c *Client) TopAdsSafety(ctx context.Context, params Params) (any, error)
- func (c *Client) TopAdsSpotlight(ctx context.Context, params Params) (any, error)
- func (c *Client) TopAdsSuggestions(ctx context.Context, params Params) (any, error)
- func (c *Client) Trending(ctx context.Context, params Params) (any, error)
- func (c *Client) VideoComments(ctx context.Context, params Params) (any, error)
- type Params
Examples ¶
Constants ¶
const ( DefaultBaseURL = "https://api.crawlora.net/api/v1" Version = "0.4.0" )
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 ¶
Client calls only the operation IDs included in this platform module.
func NewClient ¶
NewClient creates a client using the supplied API key, or CRAWLORA_API_KEY when empty.
func (*Client) Call ¶
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) ChallengeList ¶
ChallengeList calls the tiktok-challenge-list operation.
func (*Client) CreativeCenterFilters ¶ added in v0.3.0
CreativeCenterFilters calls the tiktok-creative-center-filters operation.
func (*Client) CreativeCenterHashtags ¶
CreativeCenterHashtags calls the tiktok-creative-center-hashtags operation.
func (*Client) CreativeCenterTopContent ¶ added in v0.3.0
CreativeCenterTopContent calls the tiktok-creative-center-top-content operation.
func (*Client) CreativeCenterVideos ¶
CreativeCenterVideos calls the tiktok-creative-center-videos operation.
func (*Client) MobileAnchorList ¶ added in v0.4.0
MobileAnchorList calls the tiktok-mobile-anchor-list operation.
func (*Client) MobileCommentReplies ¶ added in v0.4.0
MobileCommentReplies calls the tiktok-mobile-comment-replies operation.
func (*Client) MobileComments ¶ added in v0.4.0
MobileComments calls the tiktok-mobile-comments operation.
func (*Client) MobileFeed ¶ added in v0.3.0
MobileFeed calls the tiktok-mobile-feed operation.
func (*Client) MobileFeedPost ¶ added in v0.4.0
MobileFeedPost calls the tiktok-mobile-feed-post operation.
func (*Client) MobileHashtag ¶ added in v0.4.0
MobileHashtag calls the tiktok-mobile-hashtag operation.
func (*Client) MobileHashtagPosts ¶ added in v0.4.0
MobileHashtagPosts calls the tiktok-mobile-hashtag-posts operation.
func (*Client) MobileHashtags ¶ added in v0.4.0
MobileHashtags calls the tiktok-mobile-hashtags operation.
func (*Client) MobileLiveEffects ¶ added in v0.4.0
MobileLiveEffects calls the tiktok-mobile-live-effects operation.
func (*Client) MobileLiveGifts ¶ added in v0.4.0
MobileLiveGifts calls the tiktok-mobile-live-gifts operation.
func (*Client) MobileLiveSearch ¶ added in v0.4.0
MobileLiveSearch calls the tiktok-mobile-live-search operation.
func (*Client) MobileMusicBeats ¶ added in v0.4.0
MobileMusicBeats calls the tiktok-mobile-music-beats operation.
func (*Client) MobileMusicCollections ¶ added in v0.4.0
MobileMusicCollections calls the tiktok-mobile-music-collections operation.
func (*Client) MobileMusicPick ¶ added in v0.4.0
MobileMusicPick calls the tiktok-mobile-music-pick operation.
func (*Client) MobileMusicPosts ¶ added in v0.4.0
MobileMusicPosts calls the tiktok-mobile-music-posts operation.
func (*Client) MobileMusicRelated ¶ added in v0.4.0
MobileMusicRelated calls the tiktok-mobile-music-related operation.
func (*Client) MobileMusicTrending ¶ added in v0.4.0
MobileMusicTrending calls the tiktok-mobile-music-trending operation.
func (*Client) MobileSearch ¶ added in v0.4.0
MobileSearch calls the tiktok-mobile-search operation.
func (*Client) MobileSearchMusic ¶ added in v0.4.0
MobileSearchMusic calls the tiktok-mobile-search-music operation.
func (*Client) MobileSearchPlace ¶ added in v0.4.0
MobileSearchPlace calls the tiktok-mobile-search-place operation.
func (*Client) MobileSearchPreInfo ¶ added in v0.4.0
MobileSearchPreInfo calls the tiktok-mobile-search-pre-info operation.
func (*Client) MobileSearchSug ¶ added in v0.4.0
MobileSearchSug calls the tiktok-mobile-search-sug operation.
func (*Client) MobileSearchTabs ¶ added in v0.4.0
MobileSearchTabs calls the tiktok-mobile-search-tabs operation.
func (*Client) MobileSearchUser ¶ added in v0.4.0
MobileSearchUser calls the tiktok-mobile-search-user operation.
func (*Client) MobileTrendingCategories ¶ added in v0.4.0
MobileTrendingCategories calls the tiktok-mobile-trending-categories operation.
func (*Client) MobileTrendingEffects ¶ added in v0.4.0
MobileTrendingEffects calls the tiktok-mobile-trending-effects operation.
func (*Client) PopularTrendCountryIndustryMeta ¶
PopularTrendCountryIndustryMeta calls the tiktok-popular-trend-country-industry-meta operation.
func (*Client) ProfilePost ¶
ProfilePost calls the tiktok-profile-post operation.
func (*Client) SearchHashtag ¶
SearchHashtag calls the tiktok-search-hashtag operation.
func (*Client) SearchUser ¶
SearchUser calls the tiktok-search-user operation.
func (*Client) TopAdsAnalysis ¶
TopAdsAnalysis calls the tiktok-top-ads-analysis operation.
func (*Client) TopAdsDetail ¶
TopAdsDetail calls the tiktok-top-ads-detail operation.
func (*Client) TopAdsFilters ¶
TopAdsFilters calls the tiktok-top-ads-filters operation.
func (*Client) TopAdsList ¶
TopAdsList calls the tiktok-top-ads-list operation.
func (*Client) TopAdsLocationInfo ¶
TopAdsLocationInfo calls the tiktok-top-ads-location-info operation.
func (*Client) TopAdsLocations ¶
TopAdsLocations calls the tiktok-top-ads-locations operation.
func (*Client) TopAdsRecommend ¶
TopAdsRecommend calls the tiktok-top-ads-recommend operation.
func (*Client) TopAdsSafety ¶
TopAdsSafety calls the tiktok-top-ads-safety operation.
func (*Client) TopAdsSpotlight ¶
TopAdsSpotlight calls the tiktok-top-ads-spotlight operation.
func (*Client) TopAdsSuggestions ¶
TopAdsSuggestions calls the tiktok-top-ads-suggestions operation.