Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

mtokapi/tokapi-client

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PRs Welcome

The simple http client for TokApi tiktok mobile API

Installation

pip install tokapi-client

Usage

# For RapidAPI
api = TokApi('YOUR_RAPID_API_KEY')

# For api.tokapi.online
api = TokApi('YOUR_API_KEY_FROM_DASHBOARD', base_url="https://api.tokapi.online")

# Let's find some users by search query with pagination
keyword = 'nike'
offset = 0
for i in range(0, 3):
    result = api.search_user_by_keyword(keyword, offset=offset)
    data = result.json()

    for user in data['user_list']:
        info = user['user_info']
        print('Nickname: {}, region: {}'.format(info['nickname'],
                                                info['region']))

    offset = data['cursor']

Examples

You can find more complex usage examples in examples folder

Legal

This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by TikTok or any of its affiliates or subsidiaries. This is an independent and unofficial API. Use at your own risk.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.