検索結果の取得
curl --request GET \
--url https://api.example.com/endpointimport requests
url = "https://api.example.com/endpoint"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/endpoint', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/endpoint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/endpoint"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/endpoint")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/endpoint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body検索
検索結果の取得
ユーザー入力に基づいて即時検索結果または全文検索結果を取得するために Kameleoon Search サービスをクエリします。
GET
/
endpoint
検索結果の取得
curl --request GET \
--url https://api.example.com/endpointimport requests
url = "https://api.example.com/endpoint"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/endpoint', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/endpoint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/endpoint"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/endpoint")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/endpoint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyKameleoon Search サービスは 2 種類の検索を提供します。
- 即時検索(タイプアヘッド検索): ユーザーが検索クエリを入力するたびに結果を表示および更新します。
- 完全検索: ユーザーが検索クエリを送信した後に完全でフィルタリングされた検索結果を返します。
type パラメーターを使用します。
リクエスト
GET https://api.products.kameleoon.com/search
クエリパラメーター
これらのクエリパラメーターは完全検索と即時検索の両方に適用されます。追加のパラメーターは完全検索でのみ使用してください。| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
did | String | True | デバイス ID。KameleoonProducts_device_id クッキーからこの ID を取得します。このエンドポイントを呼び出す前に、バックエンドから取得してください。“Recently Viewed” や “Recommended for You” など、過去のデバイスデータに依存するフィルターまたはアルゴリズムを使用する場合にのみ did を提供します。 |
sid | String | True | 一時的なユーザーセッション ID。KameleoonProducts_session_code クッキーからこの ID を取得します。このエンドポイントを呼び出す前に、バックエンドから取得してください。“Recently Viewed” や “Recommended for You” など、過去のユーザーデータに依存するフィルターまたはアルゴリズムを使用する場合にのみ sid を提供します。 |
shop_id | String | True | ストアキー。Kameleoon アプリの Recommendations > Settings > Store settings で確認できます。必要に応じてカスタマーサクセスマネージャーにキーをお問い合わせください。 |
type | String | True | 検索タイプを指定します: instant_search または full_search。 |
search_query | String | True | 現在の検索クエリ。 |
locations | List | Optional | 場所 ID のカンマ区切りリスト。 |
追加のクエリパラメーター(完全検索のみ)
これらの追加パラメーターは完全検索リクエスト(type=full_search)で使用してください。
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
limit | Integer | Optional | API が返す結果の最大数。 |
offset | Integer | Optional | 結果のオフセット。 |
category_limit | Integer | Optional | サイドバーフィルターのカテゴリの最大数。 |
categories | List | Optional | フィルタリング用のカテゴリのカンマ区切りリスト。 |
extended | Integer or empty | Optional | 商品結果の拡張情報を追加します。サポートされる値: 1 または空。1 の場合、API はすべての商品情報を返します。空の場合、API は商品 ID のみを返します。Kameleoon は完全検索の場合これを 1 に設定することをお勧めします。 |
sort_by | String | Optional | ソートパラメーター。サポートされる値: popular、price、discount、sales_rate、date。 |
order | String | Optional | ソート方向: asc(昇順)または desc(降順)。デフォルトは desc です。 |
brands | List | Optional | フィルタリング用のブランドのカンマ区切りリスト。 |
filters | String | Optional | フィルターパラメーターを含むエスケープされた JSON 文字列。例: {"bluetooth":["yes"],"offers":["15% cashback"],"weight":["1.6"]} |
price_min | Integer | Optional | 最低価格。 |
price_max | Integer | Optional | 最高価格。 |
colors | Integer | Optional | 色のカンマ区切りリスト。 |
exclude | Integer | Optional | 検索結果から除外する商品 ID のカンマ区切りリスト。 |
レスポンス(即時検索)
| 名前 | 型 | 説明 |
|---|---|---|
search_query | string | 検索クエリ。 |
categories | array | カテゴリ情報。各オブジェクトには次のプロパティが含まれます:
|
filters | array | フィルター情報。各オブジェクトには次のプロパティが含まれます:
|
html | string | 商品ブロックの HTML コード。Kameleoon の個人アカウントでテンプレートをカスタマイズします。 |
price_range | object | 商品価格の最小値と最大値。次のプロパティが含まれます:
|
products | array | 商品情報。各オブジェクトには次のプロパティが含まれます:
|
search_query_redirects | array | リダイレクト情報。各オブジェクトには次のプロパティが含まれます:
|
products_total | number | 商品の合計数。 |
レスポンス(完全検索)
| 名前 | 型 | 説明 |
|---|---|---|
brands | array | ブランド情報。各オブジェクトには次のプロパティが含まれます:
|
categories | array | カテゴリ情報。各オブジェクトには次のプロパティが含まれます:
|
filters | array | フィルター情報。各オブジェクトには次のプロパティが含まれます:
|
html | string | 商品ブロックの HTML コード。Kameleoon の個人アカウントでテンプレートをカスタマイズします。 |
price_range | object | 商品価格の最小値と最大値。次のプロパティが含まれます:
|
products | array | 商品情報。各オブジェクトには次のプロパティが含まれます:
|
products_total | number | 商品の合計数。 |
search_query | string | 検索クエリ。 |
このページは役に立ちましたか?
⌘I