Walmart API
Walmart APIを使用すると、製品を検索し、製品IDで詳細な製品情報を取得できます。両方のエンドポイントはデバイスエミュレーション、配達地域設定、フルフィルメントフィルターをサポートしています。
エンドポイント
| エンドポイント | 説明 |
|---|---|
POST /api/v1/walmart/search | 並べ替え、ページネーション、価格、フルフィルメントフィルターを使用してWalmart製品を検索 |
POST /api/v1/walmart/product | Walmart製品IDで詳細な製品情報を取得 |
認証
| ヘッダー | 値 | 必須 |
|---|---|---|
Authorization | Bearer YOUR_API_KEY | はい |
Content-Type | application/json | はい |
商品検索
Bash
POST https://api.scavio.dev/api/v1/walmart/search価格、評価、在庫状況を含む構造化された結果でWalmart製品を検索します。
リクエストボディ
| パラメータ | 型 | デフォルト | 説明 |
|---|---|---|---|
query | string | -- | 必須。 検索クエリ(1〜500文字)。 |
domain | string | "" | Walmartドメイン。 |
device | string | desktop | デバイスタイプ。次のいずれか: desktop, mobile, tablet |
sort_by | string | best_match | 並び順。次のいずれか: best_match, price_low, price_high, best_seller |
start_page | integer | 1 | 開始ページ番号(1から始まる)。 |
min_price | integer | -- | 最低価格フィルター(ドル単位)。 |
max_price | integer | -- | 最高価格フィルター(ドル単位)。 |
fulfillment_speed | string | -- | 配達速度フィルター。次のいずれか: today, tomorrow, 2_days, anytime |
fulfillment_type | string | -- | フルフィルメントタイプフィルター。現在サポート: in_store |
delivery_zip | string | -- | 地域別の結果と在庫のための配送ZIPコード。 |
store_id | string | -- | 店舗在庫のためのWalmartストアID。 |
例
curl -X POST 'https://api.scavio.dev/api/v1/walmart/search' \
-H 'Authorization: Bearer sk_live_your_key' \
-H 'Content-Type: application/json' \
-d '{
"query": "wireless headphones",
"sort_by": "best_seller",
"min_price": 20,
"max_price": 100
}'レスポンス例
JSON
{
"data": {
"page": 1,
"products_count": 40,
"location": {
"city": "Jacksonville",
"state": "FL",
"store_id": "5054",
"zipcode": "32246"
},
"products": [
{
"id": "123456789",
"title": "Sony WH-1000XM5 Wireless Noise Canceling Headphones",
"url": "/ip/Sony-WH-1000XM5/123456789",
"image": "https://i5.walmartimages.com/...",
"price": 248.0,
"price_strikethrough": null,
"currency": "USD",
"rating": 4.7,
"rating_count": 8230,
"sponsored": false,
"out_of_stock": false,
"seller_name": "Walmart.com",
"seller_id": "F55CDC31AB754BB68FE0B39041159D63",
"fulfillment": {
"delivery": true,
"free_shipping": true,
"pickup": true,
"shipping": true
},
"pos": 1,
"variants": []
}
],
"url": "https://www.walmart.com/search?q=...",
"html": "",
"screenshot": ""
},
"response_time": 1920,
"credits_used": 1,
"credits_remaining": 999
}商品詳細
Bash
POST https://api.scavio.dev/api/v1/walmart/product特定のWalmart製品の詳細情報を製品IDで取得します。価格、説明、仕様、画像、評価、販売者情報を返します。
リクエストボディ
| パラメータ | 型 | デフォルト | 説明 |
|---|---|---|---|
product_id | string | -- | 必須。 Walmart製品ID(例: 123456789)。 |
domain | string | -- | Walmartドメイン。 |
device | string | desktop | デバイスタイプ。次のいずれか: desktop, mobile, tablet |
delivery_zip | string | -- | 地域別価格のための配送ZIPコード。 |
store_id | string | -- | 店舗在庫のためのWalmartストアID。 |
例
curl -X POST 'https://api.scavio.dev/api/v1/walmart/product' \
-H 'Authorization: Bearer sk_live_your_key' \
-H 'Content-Type: application/json' \
-d '{"product_id": "123456789"}'レスポンス例
JSON
{
"data": {
"id": "123456789",
"sku": "123456789",
"gtin": "012345678901",
"price": 248.0,
"price_strikethrough": 349.99,
"currency": "USD",
"rating": 4.7,
"rating_count": 8230,
"out_of_stock": false,
"seller_name": "Walmart.com",
"seller_id": "F55CDC31AB754BB68FE0B39041159D63",
"seller_url": null,
"image": "https://i5.walmartimages.com/...",
"images": [
"https://i5.walmartimages.com/..."
],
"fulfillment": {
"delivery": true,
"delivery_information": "Arrives today",
"free_shipping": true,
"fulfilled_by": "",
"out_of_stock": false,
"pickup": true,
"pickup_information": "Pickup today",
"shipping": true,
"shipping_information": "Free shipping"
},
"specifications": [
{ "key": "Brand", "value": "Sony" },
{ "key": "Wireless technology", "value": "Bluetooth" }
],
"html": "",
"screenshot": ""
},
"response_time": 2310,
"credits_used": 1,
"credits_remaining": 998
}レスポンス形式
両方のエンドポイントは一貫したレスポンスラッパーを返します:
| フィールド | 型 | 説明 |
|---|---|---|
data | object | null | レスポンスペイロード。上流でリクエストが失敗した場合はnull。検索は {page, products, location, ...}を返し、商品は商品オブジェクトを直接返します。 |
response_time | number | サーバーサイドの応答時間(ミリ秒) |
credits_used | number | 消費したクレジット数 |
credits_remaining | number | 現在の請求期間の残りクレジット数 |
エラーレスポンス
| ステータス | 説明 |
|---|---|
401 | 認証エラー -- APIキーが不足または無効 |
429 | レートまたは使用制限を超過(プランによる) |
502 | 上流エラー -- しばらくしてから再試行 |
503 | 上流サービス利用不可 -- 後で再試行 |
完全なエラーリファレンスと再試行のベストプラクティスについては、エラーを参照してください。
関連リンク
- クイックスタート -- APIキーを取得して最初のリクエストを行う
- Google Search API -- 構造化SERPデータでGoogleを検索
- YouTube API -- 動画を検索してメタデータを抽出
- Amazon API -- 12のマーケットプレイスでAmazon商品を検索
- レート制限 -- プランごとの制限