Tik-Tok-Feed

FREEMIUM
By Văn Anh | Updated 7 days ago | Social
Popularity

9.7 / 10

Latency

5,726ms

Service Level

100%

Health Check

100%

Back to All Tutorials (1)

How to use the API

CODE PYTHON
get video info

import requests

url = "https://tik-tok-feed.p.rapidapi.com/"

querystring = {
"search":"https://vt.tiktok.com/ZGJhyKbS7/", #video link
"type":"video" #do not remove this parameter
}


headers = {
    'x-rapidapi-key': "your-api-key",
    'x-rapidapi-host': "tik-tok-feed.p.rapidapi.com"
    }

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)

get user posts

import requests
count = 0
limit = 40
max = 0
setFlag = 0
while True:
		url = "https://tik-tok-feed.p.rapidapi.com/"

		querystring = {
		"search":"tiktok", #user name
		"type":"user-feed", #do not remove this parameter
		"max":max
		}

		headers = {
				'x-rapidapi-key': "your-api-key",
				'x-rapidapi-host': "tik-tok-feed.p.rapidapi.com"
				}
		response = requests.request("GET", url, headers=headers, params=querystring)
		res = response.json()
		for x in res['items']:
			print(x)
			count += 1
			if count == limit:
				setFlag = 1
				break
		if setFlag == 1:
			break
		max = res['maxCursor']

get posts by hashtag

import requests
count = 0
limit = 40
max = 0
setFlag = 0
while True:
	url = "https://tik-tok-feed.p.rapidapi.com/"

	querystring = {
	"search":"funny", #hashtag name
	"type":"challenge-feed", #do not remove this parameter
	"max":max
	}

	headers = {
			'x-rapidapi-key': "your-api-key",
			'x-rapidapi-host': "tik-tok-feed.p.rapidapi.com"
			}
	response = requests.request("GET", url, headers=headers, params=querystring)
	res = response.json()
	for x in res['items']:
		print(x)
		count += 1
		if count == limit:
			setFlag = 1
			break
	if setFlag == 1:
		break
	max = res['maxCursor']