# tiktok-trends
TikTok Data API Access comprehensive TikTok data through a unified API. Track viral trends, analyze creators, monitor hashtags, and extract engagement metrics for social media intelligence. Quick Start import requests response = requests.post( "https://api.heybossai.com/v1/run", headers={"Authorization": f"Bearer {API_KEY}"}, json={ "model": "ensembledata/tt-hashtag-posts", "inputs": {"name": "python"} } ) posts = response.json() for post in posts.get("results", [])[:5]: print(f"@{post['author']['unique_id']}: {post['desc'][:50]}...") print(f" Likes: {post['statistics']['digg_count']:,}") Available Endpoints Content Discovery EndpointDescriptionUse Casett-hashtag-postsGet posts by hashtagTrack trending topicstt-hashtag-recentRecent posts by hashtag with time filterMonitor recent activitytt-keyword-searchSearch posts by keywordContent researchtt-keyword-full-searchFull keyword search with filtersAdvanced content discovery User Analytics EndpointDescriptionUse Casett-user-infoUser profile by usernameCreator researchtt-user-info-secuidUser profile by secUidAlternative lookuptt-user-postsUser's posts historyContent analysistt-user-posts-secuidUser's posts by secUidAlternative lookuptt-user-searchSearch for usersFind creatorstt-user-followersGet user followersAudience analysistt-user-followingsGet user followingsNetwork analysistt-user-likedUser's liked postsInterest mapping Post Analytics EndpointDescriptionUse Casett-post-infoSingle post detailsDeep dive analysistt-post-info-multiMultiple posts infoBatch analysistt-post-commentsPost commentsSentiment analysistt-comment-repliesComment repliesEngagement depth Music & Sound EndpointDescriptionUse Casett-music-searchSearch for music/soundsViral sound discoverytt-music-postsPosts using specific musicSound trend trackingtt-music-detailsMusic metadataSound analytics Live Streams EndpointDescriptionUse Casett-lives-searchSearch live streamsLive content monitoring
Example: Track Trending Hashtag
import requests from datetime import datetime def track_hashtag(hashtag: str, days: int = 7): """Track recent posts for a hashtag.""" response = requests.post( "https://api.heybossai.com/v1/run", headers={"Authorization": f"Bearer {API_KEY}"}, json={ "model": "ensembledata/tt-hashtag-recent", "inputs": { "name": hashtag, "days": days } } ) data = response.json() posts = data.get("results", [])
# Analyze engagement
total_views = sum(p["statistics"]["play_count"] for p in posts) total_likes = sum(p["statistics"]["digg_count"] for p in posts) print(f"#{hashtag} - Last {days} days:") print(f" Posts: {len(posts):,}") print(f" Total Views: {total_views:,}") print(f" Total Likes: {total_likes:,}") return posts
# Track AI content
track_hashtag("artificialintelligence", 7)
Example: Analyze Creator Profile
import requests def analyze_creator(username: str): """Get comprehensive creator analytics."""
# Get profile info
profile = requests.post( "https://api.heybossai.com/v1/run", headers={"Authorization": f"Bearer {API_KEY}"}, json={ "model": "ensembledata/tt-user-info", "inputs": {"username": username} } ).json() user = profile.get("results", [{}])[0]
# Get recent posts
posts = requests.post( "https://api.heybossai.com/v1/run", headers={"Authorization": f"Bearer {API_KEY}"}, json={ "model": "ensembledata/tt-user-posts", "inputs": { "username": username, "depth": 2 } } ).json() recent_posts = posts.get("results", []) print(f"Creator: @{user.get('unique_id')}") print(f" Followers: {user.get('follower_count', 0):,}") print(f" Following: {user.get('following_count', 0):,}") print(f" Total Likes: {user.get('heart_count', 0):,}") print(f" Videos: {user.get('video_count', 0):,}") if recent_posts: avg_views = sum(p["statistics"]["play_count"] for p in recent_posts) / len(recent_posts) avg_likes = sum(p["statistics"]["digg_count"] for p in recent_posts) / len(recent_posts) print(f" Avg Views (recent): {avg_views:,.0f}") print(f" Avg Likes (recent): {avg_likes:,.0f}") analyze_creator("tiktok")
Example: Find Viral Sounds
import requests def find_viral_sounds(keyword: str): """Find trending sounds by keyword.""" response = requests.post( "https://api.heybossai.com/v1/run", headers={"Authorization": f"Bearer {API_KEY}"}, json={ "model": "ensembledata/tt-music-search", "inputs": {"name": keyword} } ) sounds = response.json().get("results", []) print(f"Trending sounds for '{keyword}':") for sound in sounds[:10]: print(f" {sound['title']} by {sound['author']}") print(f" Used in {sound['user_count']:,} videos") return sounds find_viral_sounds("trending")
Example: Monitor Post Comments
import requests def analyze_comments(post_id: str): """Analyze comments on a post.""" response = requests.post( "https://api.heybossai.com/v1/run", headers={"Authorization": f"Bearer {API_KEY}"}, json={ "model": "ensembledata/tt-post-comments", "inputs": {"aweme_id": post_id} } ) comments = response.json().get("results", [])
# Basic sentiment keywords
positive = ["love", "amazing", "great", "best", "perfect"] negative = ["hate", "bad", "worst", "terrible"] pos_count = sum(1 for c in comments if any(w in c["text"].lower() for w in positive)) neg_count = sum(1 for c in comments if any(w in c["text"].lower() for w in negative)) print(f"Post {post_id} Comments Analysis:") print(f" Total Comments: {len(comments)}") print(f" Positive mentions: {pos_count}") print(f" Negative mentions: {neg_count}") print(f" Top comment: {comments[0]['text'][:100] if comments else 'N/A'}...") analyze_comments("7123456789012345678") Response Format All endpoints return data in this structure: { "results": [ { "aweme_id": "7123456789", "desc": "Post caption...", "create_time": 1678901234, "author": { "uid": "123456", "unique_id": "username", "nickname": "Display Name" }, "statistics": { "digg_count": 1000000, "comment_count": 5000, "share_count": 2000, "play_count": 10000000 } } ] } Pricing Endpoint TypePrice per RequestUser info/search$0.0035Hashtag posts$0.0035Post info/comments$0.0035Music search$0.0035 Use Cases Social Listening: Monitor brand mentions and sentiment Competitor Analysis: Track competitor content performance Trend Detection: Identify viral content early Influencer Research: Analyze creator metrics before partnerships Content Strategy: Find successful content patterns Music Marketing: Track sound/music usage and trends
Join 80,000+ one-person companies automating with AI