---
title: "Xianyu (GooFish) 商品検索 API (V1)"
description: "アクティビティ、最新性、販売者信用、価格、またはリスト作成日によって、Xianyu（GooFish）の中古リストをキーワードで検索します。活動、最新性、販売者信用、価格、またはリスト作成日によって転売商品を発見する際に使用します。"
lastUpdated: false
aiUsagePrompt: true
---

# Xianyu \(GooFish\) 商品検索 API \(V1\)

<ApiTester
  method="GET"
  :path='JSON.parse("\"/api/xianyu/search-item-list/v1\"")'
  :summary='JSON.parse("\"商品検索 (V1)\"")'
  openapiDefinitionUrl="https://docs.justoneapi.com/openapi/xianyu-goofish/product-search-v1-ja.json"
  openapiVersion="3.1.0"
  :parameters='JSON.parse("[{\"name\":\"token\",\"in\":\"query\",\"description\":\"このAPIサービスのアクセストークン。\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"keyword\",\"in\":\"query\",\"description\":\"検索キーワード。\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"page\",\"in\":\"query\",\"description\":\"ページングのページ番号。最初のページは1から始まる。\",\"required\":false,\"schema\":{\"type\":\"string\"}},{\"name\":\"sort\",\"in\":\"query\",\"description\":\"Xianyu検索結果の並べ替え順序。\\n\\n利用可能な値:\\n- `active`: アクティブな商品リストを先に表示\\n- `recent`: 最近の近くのまたは位置ベースの結果を先に表示\\n- `credit`: 販売者の信用を先に表示\\n- `price_asc`: 価格が低いものから先に表示\\n- `price_desc`: 価格が高いものから先に表示\\n- `price_drop`: 値下げされた商品リストを先に表示\\n- `newest`: 新しく掲載された商品を先に表示\",\"required\":false,\"schema\":{\"type\":\"string\",\"default\":\"active\",\"description\":\"Xianyu商品検索のソートタイプ\",\"enum\":[\"active\",\"recent\",\"credit\",\"price_asc\",\"price_desc\",\"price_drop\",\"newest\"]}}]")'
  :requestBody='JSON.parse("null")'
  :responses='JSON.parse("{\"200\":{\"description\":\"OK\",\"content\":{\"application/json\":{\"schema\":{\"if\":{\"properties\":{\"code\":{\"const\":0}},\"required\":[\"code\"]},\"then\":{\"properties\":{\"data\":{\"type\":\"object\",\"description\":\"シャニュの検索結果の一ページとページング情報。\",\"properties\":{\"resultList\":{\"type\":\"array\",\"description\":\"このページで返される結果カード。リストは空になることがあります。\",\"items\":{\"type\":\"object\",\"description\":\"検索結果の一つのカード。\",\"properties\":{\"type\":{\"type\":\"string\",\"description\":\"この検索結果に含まれるカードのタイプコード、テキスト形式で返される。\"},\"data\":{\"type\":\"object\",\"description\":\"結果カードに含まれるデータ。\",\"properties\":{\"item\":{\"type\":\"object\",\"description\":\"結果カードに含まれるリスト情報。\",\"properties\":{\"main\":{\"type\":\"object\",\"description\":\"主要なリストカードデータ。\",\"properties\":{\"exContent\":{\"type\":\"object\",\"description\":\"検索カードに表示されるリストと販売者詳細。\",\"properties\":{\"itemId\":{\"type\":\"string\",\"description\":\"シャニュのリストID、テキスト形式で返される。この値を使用して商品詳細でリストをクエリする。\"},\"title\":{\"type\":\"string\",\"description\":\"掲載情報の表示タイトル。\"},\"area\":{\"type\":\"string\",\"description\":\"リストに表示されるエリアラベル。\"},\"isAuction\":{\"type\":\"string\",\"description\":\"報告されたオークション指標、テキスト形式で返される。\"},\"picUrl\":{\"type\":\"string\",\"description\":\"リストカードに表示されるメイン画像のURL。\"},\"picWidth\":{\"type\":\"string\",\"description\":\"メイン画像の幅、ピクセル単位で報告される、テキスト形式で返される。\"},\"picHeight\":{\"type\":\"string\",\"description\":\"メイン画像の高さ、ピクセル単位で報告される、テキスト形式で返される。\"},\"showVideoIcon\":{\"type\":\"string\",\"description\":\"カード上にビデオアイコンを表示するためのテキストフラグ。\"},\"price\":{\"type\":\"array\",\"description\":\"表示順序で表示されるリスト価格の断片。テキストには記号や省略された金額が含まれることがあります。\",\"items\":{\"type\":\"object\",\"description\":\"表示される価格の一つの断片。\",\"properties\":{\"text\":{\"type\":\"string\",\"description\":\"この断片に対して表示されるテキスト。\"},\"type\":{\"type\":\"string\",\"description\":\"この価格断片に対して報告されるタイプコード、テキスト形式で返される。\"}}}},\"oriPrice\":{\"type\":\"string\",\"description\":\"提供時の元の価格表示テキスト。\"},\"userNickName\":{\"type\":\"string\",\"description\":\"提供時のリストの販売者ニックネーム。\"},\"userAvatarUrl\":{\"type\":\"string\",\"description\":\"カード上に表示される販売者のアバターURL。\"},\"userIdentityShow\":{\"type\":\"string\",\"description\":\"カード上に表示される販売者のアイデンティティラベルで、空の場合もあります。\"},\"userFishShopLabel\":{\"type\":\"object\",\"description\":\"リストカード上に表示される販売者ラベル。\",\"properties\":{\"tagList\":{\"type\":\"array\",\"description\":\"カードに付属する販売者ラベルのリスト。\",\"items\":{\"type\":\"object\",\"description\":\"一つの販売者ラベル。\",\"properties\":{\"data\":{\"type\":\"object\",\"description\":\"この販売者ラベル用の表示内容。\",\"properties\":{\"content\":{\"type\":\"string\",\"description\":\"販売者ラベル用に表示されるテキスト。\"},\"type\":{\"type\":\"string\",\"description\":\"販売者ラベルに関する報告されたタイプコードをテキストで表示。\"}}}}}}}}}},\"clickParam\":{\"type\":\"object\",\"description\":\"このリストカードに関連するパラメーター。\",\"properties\":{\"args\":{\"type\":\"object\",\"description\":\"リストの表示価格と公開時間を含むパラメーター。\",\"properties\":{\"displayPrice\":{\"type\":\"string\",\"description\":\"リストの表示価格をテキストで報告。\"},\"publishTime\":{\"type\":\"string\",\"description\":\"報告された公開時間をテキストで表示。このフィールドの有効なUnixタイムスタンプはミリ秒です。\"}}}}}}}}}}}}}},\"resultInfo\":{\"type\":\"object\",\"description\":\"検索結果のページング情報。\",\"properties\":{\"hasNextPage\":{\"type\":\"string\",\"description\":\"ページングフラグをテキストで表示。値がtrueの場合はページを増やして続行します。値がfalseの場合は終了を示します。\"}}}}}}},\"allOf\":[{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}]}}}},\"400\":{\"description\":\"有効でないリクエストパラメータまたはボディ。\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"401\":{\"description\":\"有効でないまたは無効なアクセストークン。\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"403\":{\"description\":\"権限拒否。\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"429\":{\"description\":\"リクエストレートまたは日次クォーターリミットを超過。\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"500\":{\"description\":\"内部サーバーエラー。\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"503\":{\"description\":\"サービスが一時的に利用できない。\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}}}")'
  :servers='JSON.parse("[{\"url\":\"https://api.justoneapi.com\",\"description\":\"グローバルプロダクションAPI（デフォルト）\"}]")'
  :security='JSON.parse("[]")'
  :securitySchemes='JSON.parse("{}")'
  :schemas='JSON.parse("{}")'
/>

<ApiHealthSection :api='JSON.parse("\"/api/xianyu/search-item-list/v1\"")' />

<p>アクティビティ、最新性、販売者信用、価格、またはリスト作成日によって、Xianyu（GooFish）の中古リストをキーワードで検索します。活動、最新性、販売者信用、価格、またはリスト作成日によって転売商品を発見する際に使用します。</p>

## パラメータ

<div class="api-doc-table api-doc-table--params">

| 名前 | パラメーターの場所 | タイプ | 必須 | デフォルト | 説明 |
| --- | --- | --- | --- | --- | --- |
| <code>token</code> | query | <code>string</code> | はい | - | このAPIサービスのアクセストークン。 |
| <code>keyword</code> | query | <code>string</code> | はい | - | 検索キーワード。 |
| <code>page</code> | query | <code>string</code> | いいえ | - | ページングのページ番号。最初のページは1から始まる。 |
| <code>sort</code> | query | <code>string</code> | いいえ | <code>active</code> | Xianyu検索結果の並べ替え順序。<br /><br><br>利用可能な値:<br /><br>- <code>active</code>: アクティブな商品リストを先に表示<br /><br>- <code>recent</code>: 最近の近くのまたは位置ベースの結果を先に表示<br /><br>- <code>credit</code>: 販売者の信用を先に表示<br /><br>- <code>price_asc</code>: 価格が低いものから先に表示<br /><br>- <code>price_desc</code>: 価格が高いものから先に表示<br /><br>- <code>price_drop</code>: 値下げされた商品リストを先に表示<br /><br>- <code>newest</code>: 新しく掲載された商品を先に表示 |

</div>

## コードサンプル

::: code-group

```bash [🐚 cURL]
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/xianyu/search-item-list/v1?token=YOUR_API_KEY&keyword=VALUE'
```

```text [🤖 AIプロンプト]
私はJustOneAPIの"商品検索 (V1)" APIを使用したいです。
基本URL: https://api.justoneapi.com.
APIパス: /api/xianyu/search-item-list/v1?token=YOUR_API_KEY&keyword=VALUE
APIエンドポイント: BASE_URL + /api/xianyu/search-item-list/v1?token=YOUR_API_KEY&keyword=VALUE
HTTPメソッド: GET
認証: "token"クエリパラメーターをURLに追加します。
OpenAPI定義: https://docs.justoneapi.com/openapi/xianyu-goofish/product-search-v1-ja.json

パラメーター:
- token (query): このAPIサービスのアクセストークン。 (必須)
- keyword (query): 検索キーワード。 (必須)
- page (query): ページングのページ番号。最初のページは1から始まる。
- sort (query): Xianyu検索結果の並べ替え順序。

利用可能な値:
- `active`: アクティブな商品リストを先に表示
- `recent`: 最近の近くのまたは位置ベースの結果を先に表示
- `credit`: 販売者の信用を先に表示
- `price_asc`: 価格が低いものから先に表示
- `price_desc`: 価格が高いものから先に表示
- `price_drop`: 値下げされた商品リストを先に表示
- `newest`: 新しく掲載された商品を先に表示

返信形式：実際の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 [🐍 Python]
import requests

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

url = BASE_URL + "/api/xianyu/search-item-list/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 [🌐 JavaScript]
const BASE_URL = "https://api.justoneapi.com"; // オープンAPIサーバーによって提供される
const url = BASE_URL + "/api/xianyu/search-item-list/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 [☕ 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/xianyu/search-item-list/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 [🐹 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/xianyu/search-item-list/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]
<?php
$BASE_URL = 'https://api.justoneapi.com'; // オープンAPIサーバーによって提供される
$url = $BASE_URL . '/api/xianyu/search-item-list/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;
}
```

:::

<div style="text-align: right; margin-top: -20px; margin-bottom: 20px;">
<a href="/openapi/xianyu-goofish/product-search-v1-ja.json" target="_blank" style="font-size: 12px; color: var(--vp-c-text-3); text-decoration: none; opacity: 0.8;">[OpenAPI定義 (JSON)]</a>
</div>

## レスポンスフィールド

成功したレスポンスのキーフィールド（`code = 0`）。

<div class="api-doc-table api-doc-table--response">

| フィールドパス | タイプ | 説明 |
| --- | --- | --- |
| <code>data</code> | <code>object</code> | シャニュの検索結果の一ページとページング情報。 |
| <code>data.resultList</code> | <code>array</code> | このページで返される結果カード。リストは空になることがあります。 |
| <code>data.resultList[]</code> | <code>object</code> | 検索結果の一つのカード。 |
| <code>data.resultList[].type</code> | <code>string</code> | この検索結果に含まれるカードのタイプコード、テキスト形式で返される。 |
| <code>data.resultList[].data</code> | <code>object</code> | 結果カードに含まれるデータ。 |
| <code>data.resultList[].data.item</code> | <code>object</code> | 結果カードに含まれるリスト情報。 |
| <code>data.resultList[].data.item.main</code> | <code>object</code> | 主要なリストカードデータ。 |
| <code>data.resultList[].data.item.main.exContent</code> | <code>object</code> | 検索カードに表示されるリストと販売者詳細。 |
| <code>data.resultList[].data.item.main.exContent.itemId</code> | <code>string</code> | シャニュのリストID、テキスト形式で返される。この値を使用して商品詳細でリストをクエリする。 |
| <code>data.resultList[].data.item.main.exContent.title</code> | <code>string</code> | 掲載情報の表示タイトル。 |
| <code>data.resultList[].data.item.main.exContent.area</code> | <code>string</code> | リストに表示されるエリアラベル。 |
| <code>data.resultList[].data.item.main.exContent.isAuction</code> | <code>string</code> | 報告されたオークション指標、テキスト形式で返される。 |
| <code>data.resultList[].data.item.main.exContent.picUrl</code> | <code>string</code> | リストカードに表示されるメイン画像のURL。 |
| <code>data.resultList[].data.item.main.exContent.picWidth</code> | <code>string</code> | メイン画像の幅、ピクセル単位で報告される、テキスト形式で返される。 |
| <code>data.resultList[].data.item.main.exContent.picHeight</code> | <code>string</code> | メイン画像の高さ、ピクセル単位で報告される、テキスト形式で返される。 |
| <code>data.resultList[].data.item.main.exContent.showVideoIcon</code> | <code>string</code> | カード上にビデオアイコンを表示するためのテキストフラグ。 |
| <code>data.resultList[].data.item.main.exContent.price</code> | <code>array</code> | 表示順序で表示されるリスト価格の断片。テキストには記号や省略された金額が含まれることがあります。 |
| <code>data.resultList[].data.item.main.exContent.price[]</code> | <code>object</code> | 表示される価格の一つの断片。 |
| <code>data.resultList[].data.item.main.exContent.price[].text</code> | <code>string</code> | この断片に対して表示されるテキスト。 |
| <code>data.resultList[].data.item.main.exContent.price[].type</code> | <code>string</code> | この価格断片に対して報告されるタイプコード、テキスト形式で返される。 |
| <code>data.resultList[].data.item.main.exContent.oriPrice</code> | <code>string</code> | 提供時の元の価格表示テキスト。 |
| <code>data.resultList[].data.item.main.exContent.userNickName</code> | <code>string</code> | 提供時のリストの販売者ニックネーム。 |
| <code>data.resultList[].data.item.main.exContent.userAvatarUrl</code> | <code>string</code> | カード上に表示される販売者のアバターURL。 |
| <code>data.resultList[].data.item.main.exContent.userIdentityShow</code> | <code>string</code> | カード上に表示される販売者のアイデンティティラベルで、空の場合もあります。 |
| <code>data.resultList[].data.item.main.exContent.userFishShopLabel</code> | <code>object</code> | リストカード上に表示される販売者ラベル。 |
| <code>data.resultList[].data.item.main.exContent.userFishShopLabel.tagList</code> | <code>array</code> | カードに付属する販売者ラベルのリスト。 |
| <code>data.resultList[].data.item.main.exContent.userFishShopLabel.tagList[]</code> | <code>object</code> | 一つの販売者ラベル。 |
| <code>data.resultList[].data.item.main.exContent.userFishShopLabel.tagList[].data</code> | <code>object</code> | この販売者ラベル用の表示内容。 |
| <code>data.resultList[].data.item.main.exContent.userFishShopLabel.tagList[].data.content</code> | <code>string</code> | 販売者ラベル用に表示されるテキスト。 |
| <code>data.resultList[].data.item.main.exContent.userFishShopLabel.tagList[].data.type</code> | <code>string</code> | 販売者ラベルに関する報告されたタイプコードをテキストで表示。 |
| <code>data.resultList[].data.item.main.clickParam</code> | <code>object</code> | このリストカードに関連するパラメーター。 |
| <code>data.resultList[].data.item.main.clickParam.args</code> | <code>object</code> | リストの表示価格と公開時間を含むパラメーター。 |
| <code>data.resultList[].data.item.main.clickParam.args.displayPrice</code> | <code>string</code> | リストの表示価格をテキストで報告。 |
| <code>data.resultList[].data.item.main.clickParam.args.publishTime</code> | <code>string</code> | 報告された公開時間をテキストで表示。このフィールドの有効なUnixタイムスタンプはミリ秒です。 |
| <code>data.resultInfo</code> | <code>object</code> | 検索結果のページング情報。 |
| <code>data.resultInfo.hasNextPage</code> | <code>string</code> | ページングフラグをテキストで表示。値がtrueの場合はページを増やして続行します。値がfalseの場合は終了を示します。 |

</div>

## レスポンス例

<ApiExampleSection :api='JSON.parse("\"/api/xianyu/search-item-list/v1\"")' />

