本文へ移動

TikTok Shop 商品検索 API (V1) ​

GET
APIの健康状態
正常 利用可能 限られた数 ほとんど利用できない データなし
健康状態を読み込んでいます...

選択された地域内のキーワードでTikTok Shop商品を検索します。オフセットとページトークンでのページングを使用します。地域別の商品を発見し、検索結果を続けて閲覧するために使用します。

パラメータ ​

名前 パラメーターの場所 タイプ 必須 デフォルト 説明
token query string はい - このAPIサービスの認証トークン。
keyword query string はい - 検索キーワード。
region query string いいえ US 商品検索の対象地域。


利用可能な値:

- US: アメリカ合衆国

- GB: イギリス

- FR: フランス

- SG: シンガポール

- MY: マレーシア

- PH: フィリピン

- TH: タイ

- VN: ベトナム

- ID: インドネシア
offset query integer いいえ 0 検索結果のオフセット。
pageToken query string いいえ - 次ページのページネーショントークン。

コードサンプル ​

bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/tiktok-shop/search-products/v1?token=YOUR_API_KEY&keyword=VALUE'
text
私はJustOneAPIの"商品検索 (V1)" APIを使用したいです。
基本URL: https://api.justoneapi.com.
APIパス: /api/tiktok-shop/search-products/v1?token=YOUR_API_KEY&keyword=VALUE
APIエンドポイント: BASE_URL + /api/tiktok-shop/search-products/v1?token=YOUR_API_KEY&keyword=VALUE
HTTPメソッド: GET
認証: "token"クエリパラメーターをURLに追加します。
OpenAPI定義: https://docs.justoneapi.com/openapi/tiktok-shop/product-search-v1-ja.json

パラメーター:
- token (query): このAPIサービスの認証トークン。 (必須)
- keyword (query): 検索キーワード。 (必須)
- region (query): 商品検索の対象地域。

利用可能な値:
- `US`: アメリカ合衆国
- `GB`: イギリス
- `FR`: フランス
- `SG`: シンガポール
- `MY`: マレーシア
- `PH`: フィリピン
- `TH`: タイ
- `VN`: ベトナム
- `ID`: インドネシア
- offset (query): 検索結果のオフセット。
- pageToken (query): 次ページのページネーショントークン。

返信形式:実際のContent-Typeに応じて、JSONまたはテキストを安全に処理する。

レスポンスの処理とエラーコード:
1. API の処理結果はレスポンス本文の「code」フィールドで判定します。code が 0 なら成功です。
2. 推奨タイムアウト:リクエストのタイムアウトは 120 秒に設定してください。120 秒が長すぎる場合でも、最低 60 秒を確保してください。一部のリクエストは、結果を受け取る前にタイムアウトすることがあります。
3. 処理結果コード:
   - 0: 成功
   - 100: 無効または停止中のトークン
   - 301: データの取得に失敗しました。再試行してください。
   - 302: 呼び出し頻度の上限を超えました
   - 303: 日次の利用上限を超えました
   - 400: パラメーターが無効です
   - 500: サーバー内部エラー
   - 600: アクセス権限がありません
   - 601: 残高不足
   - 602: トークンの予算上限に達しました
4. コード 601 はアカウントの共有残高不足を示します。コード 602 は使用中の API トークン固有の累積予算上限に達したことを示します。トークンに予算上限を設定しても、共有残高から資金が移動することはありません。

お手伝いください。私が好むプログラミング言語でこのAPIを呼び出し、レスポンスを処理するスクリプトを作成してください。
python
import requests

BASE_URL = "https://api.justoneapi.com"  # オープンAPIサーバーによって提供される

url = BASE_URL + "/api/tiktok-shop/search-products/v1?token=YOUR_API_KEY&keyword=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
    content_type = response.headers.get("content-type", "").lower()
    if "json" in content_type:
        try:
            print(response.json())
        except ValueError:
            print(response.text)
    elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
        print(response.text)
    else:
        with open("response.bin", "wb") as output:
            output.write(response.content)
        print(f"Saved {len(response.content)} bytes to response.bin")
js
const BASE_URL = "https://api.justoneapi.com"; // オープンAPIサーバーによって提供される
const url = BASE_URL + "/api/tiktok-shop/search-products/v1?token=YOUR_API_KEY&keyword=VALUE";

const response = await fetch(url, {
  method: "GET",
  signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
  const contentType = (response.headers.get("content-type") || "").toLowerCase();
  const mediaType = contentType.split(";", 1)[0].trim();
  const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
  if (textual) {
    const responseText = new TextDecoder().decode(responseBytes);
    let data = responseText;
    if (contentType.includes("json")) {
      try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
    }
    console.log(data);
  } else {
    console.log(`Received ${responseBytes.byteLength} binary bytes`);
  }
}
java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static void main(String[] args) throws Exception {
        final String BASE_URL = "https://api.justoneapi.com"; // オープンAPIサーバーによって提供される
        final String url = BASE_URL + "/api/tiktok-shop/search-products/v1?token=YOUR_API_KEY&keyword=VALUE";

        HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
        HttpRequest.Builder builder = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .timeout(Duration.ofSeconds(120))
            .method("GET", HttpRequest.BodyPublishers.noBody());

        HttpRequest request = builder.build();

        HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
        System.out.println(response.statusCode());
        String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
        String mediaType = contentType.split(";", 2)[0].trim();
        if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
            System.out.println(new String(response.body(), StandardCharsets.UTF_8));
        } else {
            Files.write(Path.of("response.bin"), response.body());
            System.out.println("Saved " + response.body().length + " bytes to response.bin");
        }
    }
}
go
package main

import (
	"fmt"
	"io"
	"os"
	"strings"
	"net/http"
	"time"
)

const BASE_URL = "https://api.justoneapi.com" // オープンAPIサーバーによって提供される

func main() {
	client := &http.Client{Timeout: 120 * time.Second}
	url := BASE_URL + "/api/tiktok-shop/search-products/v1?token=YOUR_API_KEY&keyword=VALUE"
	req, _ := http.NewRequest("GET", url, nil)
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	fmt.Println(resp.StatusCode)
	bodyBytes, _ := io.ReadAll(resp.Body)
	contentType := strings.ToLower(resp.Header.Get("Content-Type"))
	mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
	if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
		fmt.Println(string(bodyBytes))
	} else {
		os.WriteFile("response.bin", bodyBytes, 0600)
		fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
	}
}
php
<?php
$BASE_URL = 'https://api.justoneapi.com'; // オープンAPIサーバーによって提供される
$url = $BASE_URL . '/api/tiktok-shop/search-products/v1?token=YOUR_API_KEY&keyword=VALUE';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
    echo $response;
} else {
    file_put_contents('response.bin', $response);
    echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}

レスポンスフィールド ​

成功したレスポンスのキーフィールド(code = 0)。

結果と続き9 項目

data

TikTok Shopの検索結果とその報告状況。

フィールド タイプ 説明
code integer TikTok Shopが報告する内部状態コード。
message string TikTok Shopが報告する内部状態メッセージ。
data object このページで返される商品、ショップ、検索メタデータ。
data.has_more boolean レスポンスにさらに多くの検索結果が報告されているかどうか。
data.load_more_params object 次の検索要求のために返される連続パラメーター。
data.load_more_params.offset integer 次のページのオフセット。同じキーワードと地域を使用して、オフセットとして渡す。
data.load_more_params.page_token string 検索を続けるために返される不透明なトークン。返されたオフセットと共に、変更せずにpageTokenとして渡す。
data.products array この検索ページで返される商品エントリ。
data.shops array 検索結果において別途返されるショップエントリ。
商品概要12 項目

data.data.products[]

検索結果の一つの商品。

フィールド タイプ 説明
product_id string TikTok Shopの商品識別子がテキストとして返される。
title string 商品リストのタイトルが返される。
rate_info object 製品の評価情報が利用可能な場合に返されるもの。
rate_info.score number 評価スコアが数値として報告される。
rate_info.review_count string レビュー数が表示テキストとして報告される。
sold_info object 商品の販売数情報が返される。
sold_info.sold_count integer 商品の販売数が報告される。
brand_info object 製品のブランド情報が利用可能な場合に返される。
brand_info.brand_name string 商品のブランド名が報告される。
seo_url object 商品ページのリンクメタデータが商品情報と共に返される。
seo_url.canonical_url string 商品の正規の商品ページURLが返される。
seo_url.slug string 正規リンクと共に商品ページのスラッグが返される。
商品価格25 項目

data.data.products[]

フィールド タイプ 説明
product_price_info object 商品リストと共に返される価格情報。
product_price_info.price_prefix string 返される価格の前に表示されるオプションテキスト。
product_price_info.sku_id string この価格に関連するSKUの識別子が報告される。
product_price_info.symbol_position integer 通貨記号の位置コードが報告される。
product_price_info.show_currency_space boolean 価格フォーマットに通貨スペースが必要かどうか。
product_price_info.currency_show_mode integer 価格と共に報告される通貨表示モードコード。
product_price_info.currency_name string 価格と共に報告される通貨識別子。
product_price_info.currency_symbol string 価格と共に報告される通貨記号。
product_price_info.sale_price_decimal string 割引価格が小数テキストとして返される。
product_price_info.sale_price_format string 割引価格のフォーマット表示テキスト。
product_price_info.single_product_price_format string 単一商品の価格のフォーマット表示テキスト。
product_price_info.single_product_price_decimal string 返される単一商品の価格が小数テキストとして返される。
product_price_info.sale_price_integer_part_format string 表示される割引価格の整数部分のフォーマット。
product_price_info.sale_price_decimal_part_format string 表示される割引価格の小数部分のフォーマット。
product_price_info.decimal_point_symbol string 価格フォーマットの小数区切り子が報告される。
product_price_info.promotion_deduction_details object 価格と共に返されるプロモーション割引情報。
product_price_info.promotion_deduction_details.seller_subtotal_deduction string プロモーションと共に報告される売り手の小計割引。
product_price_info.promotion_deduction_details.seller_subtotal_deduction_decimal string 売り手の小計割引額が小数テキストとして返される。
product_price_info.raw_origin_price_decimal string 元の価格が小数形式で報告されている金額。
product_price_info.raw_origin_price_format string 元の価格を表示する際のフォーマットされたテキスト。
product_price_info.origin_price_decimal string 提供された場合、元の価格が小数形式で返される金額。
product_price_info.origin_price_format string 報告された元の価格を表示する際のフォーマットされたテキスト。
product_price_info.discount_format string 割引価格を表示する際のフォーマットされたテキスト。
product_price_info.discount_decimal string 割引額が小数形式で返される金額。
product_price_info.reduce_price_format string 報告された価格減少を表示する際のフォーマットされたテキスト。
SKU価格27 項目

data.data.products[]

フィールド タイプ 説明
sku_info array この商品に対して返されるSKU価格エントリ。
sku_info[] object この商品に対する一つのSKU価格エントリ。
sku_info[].SkuId string 価格エントリに対して返されるSKU識別子。
sku_info[].PriceInfo object SKUに対して返される価格情報。
sku_info[].PriceInfo.sku_id string この価格に関連するSKUの識別子が報告される。
sku_info[].PriceInfo.symbol_position integer 通貨記号の位置コードが報告される。
sku_info[].PriceInfo.show_currency_space boolean 価格フォーマットに通貨スペースが必要かどうか。
sku_info[].PriceInfo.currency_show_mode integer 価格と共に報告される通貨表示モードコード。
sku_info[].PriceInfo.currency_name string 価格と共に報告される通貨識別子。
sku_info[].PriceInfo.currency_symbol string 価格と共に報告される通貨記号。
sku_info[].PriceInfo.sale_price_decimal string 割引価格が小数テキストとして返される。
sku_info[].PriceInfo.sale_price_format string 割引価格のフォーマット表示テキスト。
sku_info[].PriceInfo.single_product_price_format string 単一商品の価格のフォーマット表示テキスト。
sku_info[].PriceInfo.single_product_price_decimal string 返される単一商品の価格が小数テキストとして返される。
sku_info[].PriceInfo.sale_price_integer_part_format string 表示される割引価格の整数部分のフォーマット。
sku_info[].PriceInfo.sale_price_decimal_part_format string 表示される割引価格の小数部分のフォーマット。
sku_info[].PriceInfo.decimal_point_symbol string 価格フォーマットの小数区切り子が報告される。
sku_info[].PriceInfo.promotion_deduction_details object 価格と共に返されるプロモーション割引情報。
sku_info[].PriceInfo.promotion_deduction_details.seller_subtotal_deduction string プロモーションと共に報告される売り手の小計割引。
sku_info[].PriceInfo.promotion_deduction_details.seller_subtotal_deduction_decimal string 売り手の小計割引額が小数テキストとして返される。
sku_info[].PriceInfo.raw_origin_price_decimal string 元の価格が小数形式で報告されている金額。
sku_info[].PriceInfo.raw_origin_price_format string 元の価格を表示する際のフォーマットされたテキスト。
sku_info[].PriceInfo.origin_price_decimal string 提供された場合、元の価格が小数形式で返される金額。
sku_info[].PriceInfo.origin_price_format string 報告された元の価格を表示する際のフォーマットされたテキスト。
sku_info[].PriceInfo.discount_format string 割引価格を表示する際のフォーマットされたテキスト。
sku_info[].PriceInfo.discount_decimal string 割引額が小数形式で返される金額。
sku_info[].PriceInfo.reduce_price_format string 報告された価格減少を表示する際のフォーマットされたテキスト。
商品販売者22 項目

data.data.products[]

フィールド タイプ 説明
seller_info object 製品と共に売り手情報が返される。
seller_info.seller_id string TikTok Shopの売り手識別子がテキストとして返される。
seller_info.shop_name string ショップの表示名が返される。
seller_info.store_blueV_label object ショップの青色検証バッジアートが報告される。
seller_info.store_blueV_label.label_image_light object ライトディスプレイの検証バッジアート。
seller_info.store_blueV_label.label_image_light.height integer 報告された画像の高さ。
seller_info.store_blueV_label.label_image_light.width integer 報告された画像の幅。
seller_info.store_blueV_label.label_image_light.uri string 画像情報と共に画像のURIが返される。
seller_info.store_blueV_label.label_image_light.url_list array 画像の利用可能なURLが返される。
seller_info.store_blueV_label.label_image_light.url_list[] string 画像の一つのURLが返される。
seller_info.store_blueV_label.label_image_dark object ダークディスプレイの検証バッジアート。
seller_info.store_blueV_label.label_image_dark.height integer 報告された画像の高さ。
seller_info.store_blueV_label.label_image_dark.width integer 報告された画像の幅。
seller_info.store_blueV_label.label_image_dark.uri string 画像情報と共に画像のURIが返される。
seller_info.store_blueV_label.label_image_dark.url_list array 画像の利用可能なURLが返される。
seller_info.store_blueV_label.label_image_dark.url_list[] string 画像の一つのURLが返される。
seller_info.shop_logo object ショップのロゴ画像情報。
seller_info.shop_logo.height integer 報告された画像の高さ。
seller_info.shop_logo.width integer 報告された画像の幅。
seller_info.shop_logo.uri string 画像情報と共に画像のURIが返される。
seller_info.shop_logo.url_list array 画像の利用可能なURLが返される。
seller_info.shop_logo.url_list[] string 画像の一つのURLが返される。
ショップ結果21 項目

data.data.shops[]

検索結果に含まれる一つのショップ。

フィールド タイプ 説明
seller_id string TikTok Shopの売り手識別子がテキストとして返される。
shop_name string ショップの表示名が返される。
store_blueV_label object ショップの青色検証バッジアートが報告される。
store_blueV_label.label_image_light object ライトディスプレイの検証バッジアート。
store_blueV_label.label_image_light.height integer 報告された画像の高さ。
store_blueV_label.label_image_light.width integer 報告された画像の幅。
store_blueV_label.label_image_light.uri string 画像情報と共に画像のURIが返される。
store_blueV_label.label_image_light.url_list array 画像の利用可能なURLが返される。
store_blueV_label.label_image_light.url_list[] string 画像の一つのURLが返される。
store_blueV_label.label_image_dark object ダークディスプレイの検証バッジアート。
store_blueV_label.label_image_dark.height integer 報告された画像の高さ。
store_blueV_label.label_image_dark.width integer 報告された画像の幅。
store_blueV_label.label_image_dark.uri string 画像情報と共に画像のURIが返される。
store_blueV_label.label_image_dark.url_list array 画像の利用可能なURLが返される。
store_blueV_label.label_image_dark.url_list[] string 画像の一つのURLが返される。
shop_logo object ショップのロゴ画像情報。
shop_logo.height integer 報告された画像の高さ。
shop_logo.width integer 報告された画像の幅。
shop_logo.uri string 画像情報と共に画像のURIが返される。
shop_logo.url_list array 画像の利用可能なURLが返される。
shop_logo.url_list[] string 画像の一つのURLが返される。
商品画像12 項目

data.data.products[]

フィールド タイプ 説明
image object 商品に対して返されるメイン画像情報。
image.height integer 報告された画像の高さ。
image.width integer 報告された画像の幅。
image.uri string 画像情報と共に画像のURIが返される。
image.url_list array 画像の利用可能なURLが返される。
image.url_list[] string 画像の一つのURLが返される。
transparent_image object 商品に対して返される透明画像情報。
transparent_image.height integer 報告された画像の高さ。
transparent_image.width integer 報告された画像の幅。
transparent_image.uri string 画像情報と共に画像のURIが返される。
transparent_image.url_list array 画像の利用可能なURLが返される。
transparent_image.url_list[] string 画像の一つのURLが返される。
マーケティングラベル11 項目

data.data.products[]

フィールド タイプ 説明
product_marketing_info object 商品に関連するマーケティング表示情報。
product_marketing_info.placement_labels_ui object 商品マーケティングラベルの表示グループ。
product_marketing_info.placement_labels_ui.ui_list array 表示用の商品マーケティングラベルグループ。
product_marketing_info.placement_labels_ui.ui_list[] object 結果に含まれる一つのマーケティングラベルグループ。
product_marketing_info.placement_labels_ui.ui_list[].placement integer マーケティングラベルグループに対して報告される配置コード。
product_marketing_info.placement_labels_ui.ui_list[].labels array この表示グループに対して返されるマーケティングラベル。
product_marketing_info.placement_labels_ui.ui_list[].labels[] object 表示グループ内の一つのマーケティングラベル。
product_marketing_info.placement_labels_ui.ui_list[].labels[].meta object マーケティングラベルに対して返されるメタデータ。
product_marketing_info.placement_labels_ui.ui_list[].labels[].meta.label_type string マーケティングラベルに対して報告されるタイプラベル。
product_marketing_info.placement_labels_ui.ui_list[].labels[].lom object マーケティングラベルに対して返される表示内容。
product_marketing_info.placement_labels_ui.ui_list[].labels[].lom.value string マーケティングラベルに対して返される表示値。
フィルターセクション22 項目

data.data

フィールド タイプ 説明
filter_sections array 検索結果に提供されるフィルターセクション。
filter_sections[] object 検索結果に含まれる一つのフィルターセクション。
filter_sections[].id string フィルター欄の識別子。
filter_sections[].title string フィルター欄の表示タイトル。
filter_sections[].filterGroupType integer フィルターセクションに対して報告されるタイプコード。
filter_sections[].type string フィルターセクションに対して報告されるタイプラベル。
filter_sections[].options object 表示ラベルによってキー化されたフィルターオプション識別子。
filter_sections[].options.{key} string 表示ラベルのフィルターオプション識別子、キーとして使用されます。
filter_sections[].hasAllOption boolean セクションが全オプション選択としてマークされているかどうか。
filter_sections[].isColorSection boolean セクションが色フィルターとしてマークされているかどうか。
filter_sections[].optionGroups array このセクション内のフィルターオプションのグループ(提供されている場合)。
filter_sections[].optionGroups[] object フィルターオプションの一つのグループ。
filter_sections[].optionGroups[].title string フィルターオプショングループの表示タイトル。
filter_sections[].optionGroups[].options object 表示ラベルによってキー化されたフィルターオプション識別子。
filter_sections[].optionGroups[].options.{key} string 表示ラベルのフィルターオプション識別子、キーとして使用されます。
filter_sections[].optionGroups[].hasAllOption boolean オプショングループが全オプション選択としてマークされているかどうか。
filter_sections[].isPriceRange boolean セクションが価格範囲フィルターとしてマークされているかどうか。
filter_sections[].showCustomPriceInput boolean 価格フィルターがカスタム入力を表示するようにマークされているかどうか。
filter_sections[].priceRangeInputInfo object 価格範囲フィルターの表示範囲と通貨。
filter_sections[].priceRangeInputInfo.minDisplay string 表示テキストとして返される最低価格の範囲。
filter_sections[].priceRangeInputInfo.maxDisplay string 表示テキストとして返される最高価格の範囲。
filter_sections[].priceRangeInputInfo.currency string 価格範囲フィルターで返される通貨。
クイックフィルター6 項目

data.data

フィールド タイプ 説明
filter_quick_options array 利用可能な場合、応答に報告されるクイックフィルターオプション。
filter_quick_options[] object クイックフィルターオプションの一つ。
filter_quick_options[].displayName string クイックフィルターオプションの表示名。
filter_quick_options[].sectionTitle string クイックオプションに関連するセクションの表示タイトル。
filter_quick_options[].filterOptionId string クイックフィルターオプションの識別子。
filter_quick_options[].filterGroupType integer クイックオプションに関して報告されるフィルターグループのタイプコード。

レスポンス例 ​

レスポンスのサンプルを読み込んでいます...