Before you start
- Get an API keySign up for 100 free credits, no card. Keys start with
gs_live_. - Put it in the environmentEvery example reads it from
GROUNDSOCIAL_API_KEY:export GROUNDSOCIAL_API_KEY=gs_live_… - Set up PHP
php -m | grep curl # the curl extension ships with most PHP builds
Call TikTok Shop store products API from PHP
GET /v1/tiktok/shop/stores/{seller_id}/products. Save this as main.php and run php main.php. It reads the items in products and prints title and rate_info.score for each.
<?php
function groundsocial(string $path, array $params = []): array
{
$url = 'https://api.groundsocial.dev' . $path . ($params ? '?' . http_build_query($params) : '');
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('GROUNDSOCIAL_API_KEY')],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
]);
$raw = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$data = json_decode($raw, true);
if ($status !== 200) {
$e = $data['error'];
throw new RuntimeException($e['code'] . ': ' . ($e['hint'] ?? $e['message']));
}
return $data;
}
$data = groundsocial('/v1/tiktok/shop/stores/7495641947658095487/products', []);
foreach ($data['products'] as $item) {
echo $item['title'] ?? '', ' ', $item['rate_info']['score'] ?? '', PHP_EOL;
}The response
A real TikTok response to this call, recorded from the live source and shortened for display: arrays keep their first items and … marks every cut. The recorded page had 2 items in products. Live calls return current data in the same shape.
{
"products": [
{
"product_id": "1729488565791527807",
"title": "Silicone Multi-Layered Heavy Duty Shockproof Rugged Cellphone Case - Anti-Slip G…",
"product_price_info": {
"sku_id": "1729488574693806975",
"symbol_position": 1,
"show_currency_space": false,
"currency_show_mode": 1,
"currency_name": "USD",
"currency_symbol": "$",
"sale_price_decimal": "16.99",
"sale_price_format": "16.99",
"single_product_price_format": "16.99",
"single_product_price_decimal": "16.99",
"…": "6 more fields"
},
"rate_info": {
"score": 4.7,
"review_count": "11265"
},
"sold_info": {
"sold_count": 64958
},
"seller_info": {
"seller_id": "7495641947658095487",
"shop_name": "XG-Tech Wireless",
"shop_logo": {
"…": "4 fields"
}
},
"seo_url": {
"updated_at": "1768896500331",
"canonical_url": "https://shop.tiktok.com/us/pdp/iphone-shockproof-case-by-brand-name-heavy-duty-t…",
"slug": "iphone-shockproof-case-by-brand-name-heavy-duty-triple-layer-protection",
"type": 2,
"version": 2
},
"image": {
"height": 1500,
"width": 1371,
"uri": "tos-useast5-i-omjb5zjo8w-tx/a9974b9077b843bfa80d80a37275b0d8",
"url_list": [
"…"
]
},
"product_marketing_info": {
"placement_labels": {
"…": "3 fields"
},
"placement_labels_ui": {
"…": "1 fields"
}
},
"transparent_image": {
"height": 500,
"width": 500,
"uri": "tos-maliva-i-o3syd03w52-us/369d46418b43084392084fb42122e34c",
"url_list": [
"…"
]
}
},
"… 1 more"
],
"has_more": true,
"shop_info": {
"seller_id": "7495641947658095487",
"sold_count": 372919,
"on_sell_product_count": 62,
"review_count": 51965,
"global_seller_id": "7495641947658095487",
"global_sold_count": "372919",
"followers_count": "31896",
"video_count": "2183",
"enable_follow": true,
"official_creator_uid": "7349197366295954474",
"…": "18 more fields"
}
}Top-level fields
| Field | Type | Description |
|---|---|---|
products | TikTokShopProductCard[] | – |
has_more | boolean | – |
shop_info | object | The shop, on a store page. |
shops | object[] | Shops matching a search. |
Parameters
| Name | In | Type | Description |
|---|---|---|---|
seller_id (required) | path | string | Seller id or store URL. Example: 7495641947658095487. |
region | query | "US" | TikTok Shop market. US only for now (each market serves only visitors in it). One of US. |
Errors and retries
Every error is JSON with error.code (stable: branch on it), message, hint (what to do next), docs_url and retryable. A failed call is never charged. Retry only when retryable is true, after the Retry-After header.
try {
$data = groundsocial('/v1/tiktok/shop/stores/7495641947658095487/products', []);
} catch (RuntimeException $e) {
// "code: hint", e.g. "target_not_found: ..." (never charged).
fwrite(STDERR, $e->getMessage() . PHP_EOL);
exit(1);
}| Status | Meaning |
|---|---|
200 | The store’s products. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The account, video, comment, hashtag or sound does not exist on TikTok, or was removed. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | TikTok is temporarily unavailable. Retryable; nothing was charged. |
Every error code and what to do about it.
Pricing
| Cost | |
|---|---|
| Per call | 1 credit per call |
| 1,000 calls | $1.00 on the starter pack, $0.40 at volume |
| No key (MPP or x402) | $0.01 per call |
| Failed call | Refunded, never charged |
Every response has x-credits-charged and x-credits-remaining headers. Credits never expire. Packs and calculator.
From an AI agent (MCP)
The same call is the tiktok_shop_products tool on the hosted MCP server, so Claude, Cursor or any MCP client can make it without code. Add the server once:
claude mcp add --transport http groundsocial https://api.groundsocial.dev/mcpThen ask for it in words (“The products of a TikTok Shop store, best sellers first”), or call the tool directly:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "tiktok_shop_products",
"arguments": {
"seller_id": "7495641947658095487"
}
}
}MCP setup for Claude Desktop, Cursor, VS Code and ChatGPT.
Map a competitor’s catalogue
Read a store’s products and their sold_info weekly.
Keep going
- This call in Python, JavaScript, TypeScript, Go, cURL.
- TikTok Shop store products API reference: every field and status code.
- TikTok tutorials and all PHP tutorials.
- TikTok API: every endpoint and price.
- How to scrape TikTok user videos with PHP: A TikTok account’s videos, latest, most popular or oldest first (about 35 a page).
- How to scrape TikTok trending feed with PHP: The TikTok feed a new visitor in a region sees: about 30 popular videos.
- How to scrape TikTok liked videos with PHP: Videos a TikTok account liked, when its likes are public.
- How to scrape TikTok playlist videos with PHP: Videos in a TikTok playlist, 30 a page.
- How to scrape TikTok collection videos with PHP: Videos in a public TikTok collection, 30 a page.
- How to scrape TikTok profile with PHP: A public TikTok profile: bio, links, verification, follower, like and video counts.
Run it on your own data
One key for TikTok and 76 more platforms, over REST or MCP. Free credits on signup, no card.
TikTok is a trademark of ByteDance Ltd. We are not affiliated with or endorsed by TikTok or ByteDance.