- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
TikTok may return duplicates.
You send hashtag.
Part of the TikTok Scraper API: 24 TikTok endpoints on one key.
Request
Send your key in the x-api-key header.
1curl -G "https://api.socialscrape.dev/v1/tiktok/search/hashtag" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3 --data-urlencode 'hashtag=booktok'1import os2import requests34params = {5 "hashtag": "booktok",6}7res = requests.get(8 "https://api.socialscrape.dev/v1/tiktok/search/hashtag",9 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},10 params=params,11 timeout=60,12)13body = res.json()1415if body["ok"]:16 print(body["data"])17else:18 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/tiktok/search/hashtag");2url.search = new URLSearchParams({3 hashtag: "booktok",4}).toString();5const res = await fetch(url, {6 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },7});8const body = await res.json();910if (body.ok) {11 console.log(body.data);12} else {13 console.error(body.error.code, body.error.message);14}1{2 "nodes": [3 {4 "name": "SocialScrape TikTok videos by hashtag",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/tiktok/search/hashtag",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "hashtag",19 "value": "booktok"20 }21 ]22 },23 "sendHeaders": true,24 "headerParameters": {25 "parameters": [26 {27 "name": "x-api-key",28 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"29 }30 ]31 }32 }33 }34 ],35 "connections": {}36}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
hashtag | string | yes | Hashtag, with or without #. |
cursor | string | Opaque cursor from the previous page; pass it back unchanged. Also accepted as continuationToken, continuation_token, next_max_id, max_id, max_cursor, min_time, after, page_token, pageToken, paginationToken, next_page_id, page. | |
region | string | Two-letter country code (ISO 3166-1) for results that vary by country. Also accepted as country, geo. |
Every request also accepts trim, raw and max_age_days.
Response
Sample from a recorded response, shortened. Values are examples, not your data.
1{2 "ok": true,3 "credits_charged": 1,4 "credits_remaining": 4999,5 "cached": false,6 "cached_at": null,7 "request_id": "req_49afe33dffbc45a5543ead4e",8 "data": {9 "object": "list",10 "items": [11 {12 "object": "post",13 "platform": "tiktok",14 "id": "7223827494913215786",15 "url": "https://www.tiktok.com/@jenna_bushhager/video/7223827494913215786",16 "type": "video",17 "author": {18 "id": "6915876645917082629",19 "handle": "jenna_bushhager",20 "name": "Jenna Bush Hager",21 "url": "https://www.tiktok.com/@jenna_bushhager",22 "avatar_url": "https://p16-common-sign.tiktokcdn-us.com/tos-useast8-avt-0068-tx2/0707efff51851e19e5e88f36bd87a298~tplv-tiktokx-cropcenter:100:100.jpeg?dr=9640&refresh_token...",23 "verified": true24 },25 "title": null,26 "text": "#WorldBookDay is 4/23, and I've joined the #BookTok community to share our favorite books with you all! Duet to share your favorite read! #PassTheBook",27 "published_at": "2023-04-19T18:20:30Z",28 "duration_seconds": 82,29 "language": "en",30 "hashtags": [31 "worldbookday",32 "booktok",33 "passthebook"34 ],35 "mentions": null,36 "stats": {37 "views": 39200,38 "likes": 997,39 "comments": 34,40 "shares": 36,41 "saves": 134,42 "dislikes": null43 },44 "media": {45 "thumbnail_url": "https://p16-common-sign.tiktokcdn-us.com/tos-useast5-p-0068-tx/ce0ee016ff8a483e8271ed4b4faebb3a~tplv-tiktokx-origin.image?dr=9636&x-expires=1793498400&x-sign...",46 "video_url": "https://v16-webapp-prime.us.tiktok.com/video/tos/useast5/tos-useast5-pve-0068-tx/oYkCgfIAkEiPzzfwArwjfy27IJH4AwHIAhgRyG/?a=1988&bti=ODszNWYuMDE6&&bt=1083&ft=...",47 "audio_url": null,48 "image_urls": null,49 "width": 708,50 "height": 126251 },52 "song": {53 "id": "7223827501163006766",54 "title": "original sound",55 "artist": "Jenna Bush Hager",56 "url": "https://www.tiktok.com/music/original-sound-7223827501163006766"57 },58 "location": null,59 "is_pinned": null,60 "is_sponsored": false,61 "extra": {62 "ai_label_shown": true,63 "author_followers": 223900,64 "caption_languages": [65 "eng-US"66 ],67 "category_type": 120,68 "comments_disabled": false,69 "duet_enabled": true70 }71 },72 {73 "object": "post",74 "platform": "tiktok",75 "id": "7211513837298781483",76 "url": "https://www.tiktok.com/@oprahsbookclub/video/7211513837298781483",77 "type": "video",78 "author": {79 "id": "7194562071920690219",80 "handle": "oprahsbookclub",81 "name": "Oprah’s Book Club",82 "url": "https://www.tiktok.com/@oprahsbookclub",83 "avatar_url": "https://p19-common-sign.tiktokcdn-us.com/tos-useast8-avt-0068-tx2/944d9f8fe6d976884002d17e0a651363~tplv-tiktokx-cropcenter:100:100.jpeg?dr=9640&refresh_token...",84 "verified": true85 },86 "title": null,87 "text": "Drew Barrymore and Maria Shriver are now a part of Oprah’s Book Club! #booktok #hellobeautiful #fyp",88 "published_at": "2023-03-17T13:57:03Z",89 "duration_seconds": 22,90 "language": "en",91 "hashtags": [92 "booktok",93 "hellobeautiful",94 "fyp"95 ],96 "mentions": null,97 "stats": {98 "views": 556400,99 "likes": 32400,100 "comments": 490,101 "shares": 542,102 "saves": 1532,103 "dislikes": null104 },105 "media": {106 "thumbnail_url": "https://p19-common-sign.tiktokcdn-us.com/tos-useast5-p-0068-tx/5e637949d05948ca9dfce4bdf11cca0a_1679061424~tplv-tiktokx-dmt-logom:tos-useast5-i-0068-tx/4730a...",107 "video_url": "https://v16-webapp-prime.us.tiktok.com/video/tos/useast5/tos-useast5-ve-0068c001-tx/40ee8547970e4e68bca692a6504b5681/?a=1988&bti=ODszNWYuMDE6&&bt=2057&ft=4KJ...",108 "audio_url": null,109 "image_urls": null,110 "width": 720,111 "height": 1280112 },113 "song": {114 "id": "7211513809272507182",115 "title": "original sound",116 "artist": "Oprah’s Book Club",117 "url": "https://www.tiktok.com/music/original-sound-7211513809272507182"118 },119 "location": null,120 "is_pinned": null,121 "is_sponsored": false,122 "extra": {123 "ai_label_shown": true,124 "author_followers": 156900,125 "caption_languages": [126 "eng-US"127 ],128 "category_type": 101,129 "comments_disabled": false,130 "duet_enabled": true131 }132 }133 ],134 "cursor": null,135 "has_more": false,136 "parent": {137 "object": "collection",138 "platform": "tiktok",139 "id": "1622962893630470",140 "url": "https://www.tiktok.com/tag/BookTok",141 "kind": "topic",142 "title": "#BookTok",143 "description": "Calling all book creators! Share your favorite reads, recommendations, reviews, reactions, reading journeys, book hauls, literary insights, or creative takes...",144 "owner": null,145 "item_count": 88646803,146 "cover_url": null,147 "updated_at": null,148 "extra": {149 "is_commerce": false,150 "view_count": 562657233676151 }152 }153 },154 "cursor": null,155 "has_more": false156}Fields
A page of results. Each entry in items is a Post. cursor and has_more page through the rest.
A field the platform does not give is null, never made up. Extra platform details are in extra.
| Field | Type | Always | Notes |
|---|---|---|---|
object | "post" | ||
platform | Platform | yes | |
id | string | yes | |
url | string or null | ||
type | "video" or "short" or "reel" or "image" or "carousel" or "story" or "live" or "clip" or "text" or "link" or "tweet" or "pin" or "community_post" or "episode" or "unknown" | ||
author | Author or null | ||
title | string or null | ||
text | string or null | ||
published_at | string (ISO 8601 date-time) or null | ||
duration_seconds | number or null | ||
language | string or null | ||
hashtags | string[] or null | ||
mentions | string[] or null | ||
stats | Stats |
Show the other 6 fields
Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.
Questions
Which errors can it return?
invalid_params (do not retry), not_found (do not retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.
How do I get more than one page?
Send the same request with cursor set to the cursor you received, until has_more is false. Each page costs its own price. See pagination.
Is there an SDK call for it?
The Python client has client.tiktok.search_hashtag(...) and the TypeScript client client.tiktok.searchHashtag(). Both return the same envelope as the HTTP API. Install them from PyPI (socialscrape-sdk) or npm (socialscrape); plain HTTP works in any language.
Can an AI agent call it?
Yes. The MCP server, which you run on your own machine, reaches every built endpoint, with the same prices.