How to Scrape Tiktok Keyword Search Results
This tutorial shows how to use Tiktok Keyword Search Results API to scrape and crawl structured Tiktok data in real-time.
Query TikTok's content library by any keyword and get back ranked videos, creator profiles, and trending topic data all in a single API call.
Access Tiktok Data in 3 Steps
Start crawling Tiktok keyword search data. Follow these steps to extract social media data in minutes.
Create Your Account
Go to our registration page and make an account. It's free, no credit card, and you get credits right away to play around with.
Verify Your Email Address
You'll get a verification email, click the link in it. Once that's done, you can grab your API token from the dashboard.
Make Your First API Call
Copy the code snippet below, swap in your API key, and run it. You'll get Tiktok data back as JSON within a few seconds.
Code Sample
Here's a JavaScript example to get you going. Swap out the token and you're good, works the same way in any language that can make HTTP requests. Start collecting keyword search data via our REST API!
| 1 | const root = 'https://ensembledata.com/apis' |
| 2 | const endpoint = '/tt/keyword/search' |
| 3 | const params = { |
| 4 | "name": "tesla", |
| 5 | "cursor": 0, |
| 6 | "period": "1", |
| 7 | "sorting": "0", |
| 8 | "country": "us", |
| 9 | "match_exactly": false, |
| 10 | "get_author_stats": false, |
| 11 | "token": "YOUR-TOKEN-HERE" |
| 12 | } |
| 13 | |
| 14 | const queryString = new URLSearchParams(params).toString(); |
| 15 | const url = `${root}${endpoint}?${queryString}`; |
| 16 | |
| 17 | await fetch(url) |
| 18 | .then(response => response.json()) |
| 19 | .then(data => console.log(data)) |
| 20 | .catch(error => console.error(error)); |
| 21 |
Parameters
Example Response
Explore the fields returned by this endpoint. Click a row to expand nested objects and arrays, hover a value to copy it, or use "Expand all" to see everything at once.