Tik-Tok-Feed

FREEMIUM
От Văn Anh | Обновлено לפני 22 ימים | Social
Популярность

9.7 / 10

Задержка

5,173ms

Уровень обслуживания

100%

Health Check

100%

Назад ко всем обсуждениям

How to achieve paging in the API?

Rapid account: Mridulgautam
mridulgautam
לפני שנה

Tried passing various values in the max parameter, But it always returned 20 results.
Want to know how to get results after first 20 records and achieve pagination with the same. Prompt reply will be appreciated.

Rapid account: Mridulgautam
mridulgautam Commented לפני שנה

Hello, Please do update on the maxcursor thing in “Challenge-feed”. While passing the value of maxcursor in max parameter. I am getting the same value as of before which I got without passing it

Rapid account: Mridulgautam
mridulgautam Commented לפני שנה

Yes it is working for “user-feed” but it’s not working for “challenge-feed” . It is returning maxCursor and passing it in parameter we’re getting the same result.

Rapid account: Ad KT 36
AdKT36 Commented לפני שנה

the return data will look like this

{"status": "0", "detail": "107955", "items":  [...] ,"hasMore": 1, "minCursor": 1670353804000, "maxCursor": 1667664126000}

replace max parameter in url with value of maxCursor:

import requests

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

querystring = {"search":"tiktok","type":"user-feed","max":"1667664126000"} #replace it here

headers = {
	"X-RapidAPI-Key": "",
	"X-RapidAPI-Host": "tik-tok-feed.p.rapidapi.com"
}

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

print(response.text)

Присоединяйтесь к обсуждению – добавьте комментарий ниже:

Войдите / Зарегистрируйтесь, чтобы публиковать новые комментарии