TikTok/SQL Query
SQL Query
POST
https://api.shofo.ai/tiktok/sqlQuery our complete TikTok video database using SQL. Access millions of indexed videos with full metadata.
Pricing
Base cost: $0.0001 per row returned
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Required | SQL query to execute against the TikTok index |
limit | integer | Optional | Maximum rows to returnDefault: 100 |
Available Fields
The TikTok index contains the following fields that you can query:
| Field | Type | Description |
|---|---|---|
video_id | STRING | Unique video identifier |
author_unique_id | STRING | Creator username |
author_sec_uid | STRING | Creator secure user ID |
author_follower_count | INTEGER | Creator follower count at time of scrape |
create_time | INTEGER | Video creation timestamp (Unix) |
video_desc | STRING | Video caption/description |
hashtags | ARRAY<STRING> | List of hashtags used |
play_count | INTEGER | Total view count |
digg_count | INTEGER | Total likes |
comment_count | INTEGER | Total comments |
share_count | INTEGER | Total shares |
video_duration | INTEGER | Video duration in seconds |
music_title | STRING | Sound/music title |
music_author_name | STRING | Sound/music author |
Example Queries
Get top videos by likes
SELECT video_id, author_unique_id, video_desc, digg_count FROM videos ORDER BY digg_count DESC LIMIT 100
Find videos with specific hashtag
SELECT video_id, author_unique_id, play_count FROM videos WHERE 'fyp' IN UNNEST(hashtags) ORDER BY play_count DESC LIMIT 50
Get creator stats
SELECT author_unique_id, COUNT(*) as video_count, SUM(play_count) as total_views, AVG(digg_count) as avg_likes FROM videos GROUP BY author_unique_id ORDER BY total_views DESC LIMIT 20
Try It
POST
https://api.shofo.ai/tiktok/sql$0.0001
Send a request to see the response