Docs menu

TikTok Shop product search

Beta GET /v1/tiktok/shop/search

GET /v1/tiktok/shop/search

Products matching a search, each with price, rating, sold count and shop. Pages of 20 by cursor; TikTok decides how deep a query goes (past 40 results when it has them). US catalogue only.

  • Cost: 1 credit
  • Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
querystringyesSearch terms. Also accepted as keyword, q.

Every request also accepts:

  • cursor: the cursor from the previous page (Pagination).
  • region: two-letter country code for results that vary by country. Changing it restarts the cursor chain.
  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

curl
curl -G "https://api.socialscrape.io/v1/tiktok/shop/search" \
  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \
  --data-urlencode "query=water bottle" \
  --data-urlencode "region=US" \
  --data-urlencode "cursor=eyJxIjoid2F0ZXIgYm90dGxlIiwibyI6MjAsInB0IjoiMjAyNjEwMzAwMTUzNTgzOTBGN0E3ODNCMURFNzJGODNGNiJ9"
Python
import os
import requests

params = {
    "query": "water bottle",
    "region": "US",
    "cursor": "eyJxIjoid2F0ZXIgYm90dGxlIiwibyI6MjAsInB0IjoiMjAyNjEwMzAwMTUzNTgzOTBGN0E3ODNCMURFNzJGODNGNiJ9",
}
res = requests.get(
    "https://api.socialscrape.io/v1/tiktok/shop/search",
    headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
    params=params,
)
body = res.json()

if body["ok"]:
    print(body["data"])
else:
    print(body["error"]["code"], body["error"]["message"])
TypeScript
const url = new URL("https://api.socialscrape.io/v1/tiktok/shop/search");
url.search = new URLSearchParams({
  "query": "water bottle",
  "region": "US",
  "cursor": "eyJxIjoid2F0ZXIgYm90dGxlIiwibyI6MjAsInB0IjoiMjAyNjEwMzAwMTUzNTgzOTBGN0E3ODNCMURFNzJGODNGNiJ9"
}).toString();
const res = await fetch(url, {
  headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();

if (body.ok) {
  console.log(body.data);
} else {
  console.error(body.error.code, body.error.message);
}
n8n
{
  "nodes": [
    {
      "name": "SocialScrape TikTok Shop product search",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "method": "GET",
        "url": "https://api.socialscrape.io/v1/tiktok/shop/search",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "query",
              "value": "water bottle"
            },
            {
              "name": "region",
              "value": "US"
            },
            {
              "name": "cursor",
              "value": "eyJxIjoid2F0ZXIgYm90dGxlIiwibyI6MjAsInB0IjoiMjAyNjEwMzAwMTUzNTgzOTBGN0E3ODNCMURFNzJGODNGNiJ9"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
            }
          ]
        }
      }
    }
  ],
  "connections": {}
}

Example response#

This is a sample from a recorded response, lists and long text are shortened. Status 200.

{
  "ok": true,
  "credits_charged": 1,
  "credits_remaining": 4999,
  "cached": false,
  "cached_at": null,
  "request_id": "req_94b33d5e742bf593d03e2930",
  "data": {
    "object": "list",
    "items": [
      {
        "object": "product",
        "platform": "tiktok",
        "id": "1731932327542428280",
        "url": "https://www.tiktok.com/shop/pdp/wicked-bubble-broomstick-hydration-pearlescent-pink-shimmer/1731932327542428280",
        "title": "Wicked",
        "description": null,
        "price": {
          "amount": 46.98,
          "currency": "USD",
          "original_amount": null,
          "display": "$46.98"
        },
        "seller": {
          "id": "7495318983844203128",
          "handle": null,
          "name": "Owala",
          "url": null,
          "avatar_url": "https://p16-oec-general-useast5.ttcdn-us.com/tos-useast5-i-omjb5zjo8w-tx/d4da4b135fa745508c3ca9549b2e8920~tplv-fhlh96nyum-resize-png:300:300.png?dr=12184&t=555f072d&ps=933b5bde&shp=905da467&shcp=d9d491bf&idc=useast5&from=2422056039",
          "verified": null
        },
        "rating": 4.8,
        "review_count": 1251,
        "sold_count": 15491,
        "image_urls": [
          "https://p16-oec-general-useast5.ttcdn-us.com/tos-useast5-i-omjb5zjo8w-tx/d302dcb0442349afa3f89f3241e72a63~tplv-fhlh96nyum-crop-webp:1080:1080.webp?dr=12190&t=555f072d&ps=933b5bde&shp=8dbd94bf&shcp=a6e80448&idc=useast5&from=2378011839"
        ],
        "category": null,
        "in_stock": null,
        "location": null,
        "published_at": null,
        "extra": {
          "brand": "Owala",
          "sku_id": "1731932327605015160"
        }
      },
      {
        "object": "product",
        "platform": "tiktok",
        "id": "1729403902741811222",
        "url": "https://www.tiktok.com/shop/pdp/water-bottle-sol-and-selene-stainless-steel-bpa-free-3-x-10-4/1729403902741811222",
        "title": "Water Bottle Water Bottle",
        "description": null,
        "price": {
          "amount": 14.99,
          "currency": "USD",
          "original_amount": null,
          "display": "$14.99"
        },
        "seller": {
          "id": "7495197880337991702",
          "handle": null,
          "name": "Sol and Selene",
          "url": null,
          "avatar_url": "https://p16-oec-general-useast5.ttcdn-us.com/tos-useast5-i-omjb5zjo8w-tx/owbkODtGUen2pzGDbK8SjIAUDyA8QjCfZNASOD~tplv-fhlh96nyum-resize-png:300:300.png?dr=12184&t=555f072d&ps=933b5bde&shp=905da467&shcp=d9d491bf&idc=useast5&from=2422056039",
          "verified": null
        },
        "rating": 4.8,
        "review_count": 4,
        "sold_count": 40,
        "image_urls": [
          "https://p16-oec-general-useast5.ttcdn-us.com/tos-useast5-i-omjb5zjo8w-tx/40c6aab88cc7403aab5475380ae3194b~tplv-fhlh96nyum-crop-webp:2000:2000.webp?dr=12190&t=555f072d&ps=933b5bde&shp=8dbd94bf&shcp=a6e80448&idc=useast5&from=2378011839"
        ],
        "category": null,
        "in_stock": null,
        "location": null,
        "published_at": null,
        "extra": {
          "brand": "Sol and Selene",
          "labels": [
            "Free shipping"
          ],
          "sku_id": "1729403902741876758"
        }
      }
    ],
    "cursor": null,
    "has_more": false,
    "parent": null
  },
  "cursor": null,
  "has_more": false
}

Response#

A list of Product objects in data.items, with data.cursor and data.has_more.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
not_found404noThe platform says this profile, post or item does not exist.

Every request can also fail with the account and platform errors listed on the Errors page.