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

tiktok

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 11 Imported by: 0

README

TikTok clients for Crawlora

Official Crawlora client packages for the hosted TikTok API. 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

The six clients provide access to 25 public API operations. See the API reference for supported operations, parameters, and response details.

License

MIT. See LICENSE.

Documentation

Overview

Package tiktok is a focused Go client for Crawlora's TikTok endpoints. 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.1.1"
)
View Source
const OperationCount = 25

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) CreativeCenterHashtags

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

CreativeCenterHashtags calls the tiktok-creative-center-hashtags 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) 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