import requests import json url = "https://tiktok-download-video1.p.rapidapi.com/feedSearch" querystring = {"keywords":"VS code","count":"10","cursor":"0","region":"US","publish_time":"0","sort_type":"1"} headers = { "X-RapidAPI-Key": "YOUR_API_KEY", "X-RapidAPI-Host": "tiktok-download-video1.p.rapidapi.com" } response = requests.get(url, headers=headers, params=querystring) print(response.json()) with open("./record.json", "w") as f: json.dump(response.json(), f)