Documentation
¶
Overview ¶
Package tiktok is Crawlora's TikTok API client for 28 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) MobileFeed(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.3.0" )
const OperationCount = 28
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) MobileFeed ¶ added in v0.3.0
MobileFeed calls the tiktok-mobile-feed 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.