Skip to main content

crawlora-tiktok — TikTok API client for Python

Python client for Crawlora's hosted TikTok API. It exposes 90 API endpoints covering video, user, and hashtag search; profiles and posts; comments; trends; Creative Center; and Top Ads data. Requests go to Crawlora; the package does not run a browser or scrape TikTok locally. A Crawlora account and CRAWLORA_API_KEY are required, and API use is billed under your Crawlora account. Crawlora is independent from and not endorsed by TikTok or its owners.

Install

python -m pip install crawlora-tiktok

Get an API key

Create an account at crawlora.net, then open the Crawlora console for API-key setup. Set your key in the shell before running the client:

export CRAWLORA_API_KEY="your-crawlora-api-key"

Use

Save this example as example.py, then run python example.py after installing the package and setting your API key.

import os

from crawlora_tiktok import TikTokClient

api_key = os.environ.get("CRAWLORA_API_KEY")
if not api_key:
    raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")

with TikTokClient(api_key=api_key) as client:
    result_1 = client.search(keyword='science')
    print(result_1)
    result_2 = client.trending()
    print(result_2)

The package also exports Client as an alias for TikTokClient. Operation methods are available directly in snake_case and through the tiktok group. The async package client is AsyncTikTokClient; see the online endpoint and parameter reference and runnable example.

Async usage

The package also exports AsyncClient for asynchronous requests:

import asyncio
import os

from crawlora_tiktok import AsyncClient

async def main():
    api_key = os.environ.get("CRAWLORA_API_KEY")
    if not api_key:
        raise RuntimeError("Set CRAWLORA_API_KEY before running this example.")
    async with AsyncClient(api_key=api_key) as client:
        result_1 = await client.search(keyword='science')
        print(result_1)

asyncio.run(main())

See the runnable example for a complete usage example.

Supported TikTok API endpoints

This package exposes every route below through direct snake_case methods and the tiktok group. See the endpoint and parameter reference for complete input 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/collection/detail tiktok-mobile-collection-detail Get TikTok collection detail on the mobile API
GET /tiktok/mobile/collection/list tiktok-mobile-collection-list List TikTok collections on the mobile API
GET /tiktok/mobile/collection/videos tiktok-mobile-collection-videos Get videos in a TikTok collection on the mobile API
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/offline tiktok-mobile-feed-offline Fetch the app's cached-pull offline feed (protobuf) decoded without a schema
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/hashtags tiktok-mobile-live-hashtags LIVE category/game reference catalogue (hashtags, live-studio/voice/third-party tags, game tags)
GET /tiktok/mobile/live/room tiktok-mobile-live-room LIVE room detail: status, viewers, owner, stream URLs, cover
GET /tiktok/mobile/live/room-by-user tiktok-mobile-live-room-by-user LIVE room by user: the room a user is currently streaming
GET /tiktok/mobile/live/search tiktok-mobile-live-search Search TikTok LIVE streams
GET /tiktok/mobile/live/tabs tiktok-mobile-live-tabs Fetch the LIVE tab catalogue
GET /tiktok/mobile/music/beats tiktok-mobile-music-beats Retrieve TikTok music beats
GET /tiktok/mobile/music/chart tiktok-mobile-music-chart List a regional TikTok sound chart
GET /tiktok/mobile/music/choices tiktok-mobile-music-choices Recommended sounds for video creation
GET /tiktok/mobile/music/collection-list tiktok-mobile-music-collection-list Music collection list (paged browse)
GET /tiktok/mobile/music/collections tiktok-mobile-music-collections Retrieve TikTok music collections
GET /tiktok/mobile/music/detail tiktok-mobile-music-detail Retrieve one TikTok sound
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/mv/videos tiktok-mobile-mv-videos MV channel feed: the app's music-video tab, paged
GET /tiktok/mobile/place/detail tiktok-mobile-place-detail Place (POI) detail from the mobile app's Places surface
GET /tiktok/mobile/place/info tiktok-mobile-place-info Compact place (POI) record: address, coordinates, rating, hours, counters
GET /tiktok/mobile/place/media tiktok-mobile-place-media List a TikTok place's mixed media
GET /tiktok/mobile/place/photos tiktok-mobile-place-photos Place photo album with per-photo attribution
GET /tiktok/mobile/place/reviews tiktok-mobile-place-reviews List a TikTok place's reviews
GET /tiktok/mobile/place/videos tiktok-mobile-place-videos Videos posted at one place (paged)
GET /tiktok/mobile/playlist/detail tiktok-mobile-playlist-detail Retrieve one TikTok playlist
GET /tiktok/mobile/playlist/list tiktok-mobile-playlist-list List a creator's TikTok playlists
GET /tiktok/mobile/playlist/videos tiktok-mobile-playlist-videos List a playlist's videos
GET /tiktok/mobile/search tiktok-mobile-search Search TikTok videos on the mobile API
GET /tiktok/mobile/search/effects tiktok-mobile-search-effects Search TikTok effects/stickers by keyword
GET /tiktok/mobile/search/hashtags tiktok-mobile-search-hashtags Hashtag suggestions for a keyword (hashtag typeahead)
GET /tiktok/mobile/search/music tiktok-mobile-search-music Search TikTok sounds on the mobile API
GET /tiktok/mobile/search/photos tiktok-mobile-search-photos Search the mobile app's photo-post tab
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/stream tiktok-mobile-search-stream Run the app's primary (streaming) general search
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/search/videos tiktok-mobile-search-videos Search TikTok videos on the mobile API (video tab)
GET /tiktok/mobile/translation/description tiktok-mobile-translation-description Translate one TikTok video caption
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/mobile/user/followers tiktok-mobile-user-followers Retrieve the followers of a TikTok creator
GET /tiktok/mobile/user/following tiktok-mobile-user-following Retrieve the accounts a TikTok creator follows
GET /tiktok/mobile/user/original-effects tiktok-mobile-user-original-effects List a creator's original TikTok effects
GET /tiktok/mobile/user/original-music tiktok-mobile-user-original-music List a creator's original TikTok sounds
GET /tiktok/mobile/user/posts tiktok-mobile-user-posts Retrieve the videos posted by a TikTok creator
GET /tiktok/mobile/user/profile tiktok-mobile-user-profile Retrieve a TikTok creator profile
GET /tiktok/mobile/user/recommendations tiktok-mobile-user-recommendations Recommended creators on the mobile app's Following page
GET /tiktok/mobile/video/detail tiktok-mobile-video-detail Retrieve one TikTok video
GET /tiktok/mobile/video/subtitles tiktok-mobile-video-subtitles Video captions translated into a target language
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

Configuration

Pass your key through api_key or read CRAWLORA_API_KEY from the environment. Keep credentials out of source control and logs. Requests go to Crawlora's hosted API.

Metadata

Release files for crawlora-tiktok 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crawlora-tiktok 0.5.0
File Size Uploaded Provenance Actions
crawlora_tiktok-0.5.0.tar.gz 58.8 kB Without provenance Details for crawlora_tiktok-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crawlora-tiktok 0.5.0
File Interpreter ABI Platform Actions
crawlora_tiktok-0.5.0-py3-none-any.whl Python 3 none any Details for crawlora_tiktok-0.5.0-py3-none-any.whl

Total release size: 116.4 kB

Release files / crawlora_tiktok-0.5.0.tar.gz

Download URL crawlora_tiktok-0.5.0.tar.gz
Size 58.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d19adf1beea0ffdefd2c70c95632a1ccf2215202efce60def1e7e8e8ba5805b4
BLAKE2b-256 checksum
How to use checksums
3666ba811456c63fab9fd54508cb0f08e521f417a67733464da49a4cda5f3e98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / crawlora_tiktok-0.5.0-py3-none-any.whl

Download URL crawlora_tiktok-0.5.0-py3-none-any.whl
Size 57.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d75bc3a9b745b01808515ada7023159ca73c3516183782ffdf36a7a8fae25372
BLAKE2b-256 checksum
How to use checksums
3ec30aa0d462ab64b2284068ca9145f0c5f7602f848f0e2d6239cbe2ce056ca9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for crawlora-tiktok 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page