TikTok API + python: get video metadata by ID (in json)

1.1k views Asked by At

Previously, I have been using this URL for retrieving the metadata of a public TikTok video:

https://www.tiktok.com/node/share/video/{handle}/{post_id}

This URL used to return an itemInfo dictionary with all the necessary data: video title and duration, author, etc.

Now, this no longer works and is throwing 403 errors. I have tried to register my app in TikTok for developers. There seems to be a dedicated endpoint to query video details (https://developers.tiktok.com/doc/tiktok-api-v2-video-query/), however I can't understand how to get an authorization code, which is in its turn required to get the access token. Do I have to implement the TikTok login for it first? This seems too redundant and difficult.

What is the simplest way to query video details from TikTok (I am using python)?

1

There are 1 answers

0
David C On

Yes, you need to add the Login Kit, and TikTok API Products to your app. Then you can go through the Login Kit oauth process and get an access token and use that to call https://open.tiktokapis.com/v2/video/list/ to list the videos. Be sure to "Submit for Review" after adding the other products or you will not be able to sign into the Login Kit.