
from pathlib import Path Path("downloads").mkdir(exist_ok=True) # creates folder First we will use python to create a folder called downloads if it does not already exist. Now we have to actually save the videos from TikTok. from TikTokApi import TikTokApi import string import random did=''.join(random.choice(string.digits) for num in range(19)) verifyFp="verify_YOUR_VERIFYFP_HERE" api = TikTokApi.get_instance(custom_verifyFp=verifyFp, custom_did=did) print(api.trending()) We will now modify the previous python script so it can download trending TikTok’s. At the moment you can circumvent this by doing api = TikTokApi.get_instance(custom_verifyFp=verifyFp, use_test_endpoints=True however I cannot guarantee this will work in the future The verifyFp token seems to expire after around 2 hours or so and it may throttle your requests if you end up making too many under a single verifyFp. If the script does not do that visit TikTokApi’s GitHub page your issue most likely will be already solved in the closed issues section, just search for any errors you may be getting. Run your python script, hopefully it will output data in a python dictionary format. Type the following into your python script. We will be testing to make sure we are able to retrieve TikTok data from python.

Let’s create a new python file and call it whatever you would like.
