- Use cases
- TikTok Shop research
TikTok Shop research
Search TikTok Shop, then read a product's price, sold count and reviews.
The job
Product research is search, then depth. Find what sells under a keyword, open the product, and read the reviews for what buyers complain about.
Endpoints
Failed requests and cached repeats cost 0 credits. Send max_age_days to accept a recent cached copy. See credits and caching.
| Endpoint | Returns | Cost |
|---|---|---|
| TikTok Shop product search | 1 credit | |
| TikTok Shop product details | 1 credit | |
| TikTok Shop product reviews | 1 credit | |
| TikTok Shop products of a shop | 1 credit |
Recipe
- Search a keyword.
- Open the products with the highest sold count.
- Read their reviews.
1import os2import requests34API = "https://api.socialscrape.dev"5HEADERS = {"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]}678def get(path, **params):9 res = requests.get(API + path, headers=HEADERS, params=params, timeout=60)10 res.raise_for_status()11 return res.json()["data"]1213# TikTok Shop product search14found = get("/v1/tiktok/shop/search", query="water bottle")15# TikTok Shop product details16product = get("/v1/tiktok/shop/product", url=found["items"][0]["url"])17# TikTok Shop product reviews18reviews = get("/v1/tiktok/shop/product/reviews", url=found["items"][0]["url"])1920for r in reviews["items"]:21 print(r["text"])1const API = "https://api.socialscrape.dev";2const headers = { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! };34async function get(path: string, params: Record<string, string | number | boolean>) {5 const query = new URLSearchParams(Object.entries(params).map(([k, v]) => [k, String(v)]));6 const res = await fetch(`${API}${path}?${query}`, { headers });7 if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);8 return (await res.json()).data;9}1011// TikTok Shop product search12const found = await get("/v1/tiktok/shop/search", { query: "water bottle" });13// TikTok Shop product details14const product = await get("/v1/tiktok/shop/product", { url: found.items[0].url });15// TikTok Shop product reviews16const reviews = await get("/v1/tiktok/shop/product/reviews", { url: found.items[0].url });1718for (const r of reviews.items) console.log(r.text);Calls use api.socialscrape.dev and return the shapes in the reference.
Good to know
TikTok decides how deep a search goes, and reviews come 5 a page.