CLI を使い始める

products

orc products は、Workspaceの商品カタログを管理するコマンドです。承認済み商品の一括登録・更新・削除、一覧・詳細・集計の取得に加え、観測で見つかった競合商品、検索展開、属性、元のプロンプトを確認できます。JANや公開商品URLから、登録前に根拠付きの商品候補を調べる操作もあります。

認証を設定して対象Workspaceを選びます。get と商品別の観測情報には、作成・一覧で返されたOrchestor商品IDを使用してください。external_id や観測されたshopping結果IDは、このIDの代わりにはなりません。別のWorkspaceの商品IDは取得できません。

使い方

terminal
orc products list --workspace <workspace-id>

商品カタログと商品IDを確認します。

サブコマンド

list

有効な商品を新しい順に一覧します。--brand-id で絞り込み、同じ条件でnext cursorをたどります。

terminal
orc products list [options]

固有のオプション

--brand-id

Filter by a brand ID in the current workspace. Omit to list products across all its brands.

型: string。任意。

terminal
orc products list --brand-id <value>

create

1〜1,000件を登録します。products 配列の各商品に現在のWorkspaceのブランドが必要です。結果は created と rejected に分かれ、一部拒否の場合も各項目を確認できます。本文全体のschema検証に失敗すると処理前に拒否されます。

terminal
orc products create [options]

固有のオプション

--idempotency-key

Retry identity for operations that support idempotency. Use a unique key for each new operation, and reuse it only when retrying the same HTTP method, path, query values and exact request body. JSON whitespace changes can count as a different body. Keys contain 1–255 characters after trimming and expire after 24 hours. A completed JSON response is replayed without repeating the operation. A different request using the same key returns 409 idempotency_error. An in-progress request returns 409 idempotency_in_progress with Retry-After: 2. Whether this header is required depends on the operation.

型: string。任意。

terminal
orc products create --idempotency-key <value>
--products

(required) Catalog products to create in request order. Each item creates a new product.; JSON array of objects (use --stdin for large resources)

型: string。任意。

terminal
orc products create --products <value>

使用例

同じ本文の再試行では同じrequest keyを保持し、結果の各bucketを確認します。

terminal
orc products create --workspace <workspace-id> --stdin --idempotency-key <request-key> --json < products.json

承認済みの商品を一括登録する

update

Orchestor商品IDと変更項目を含む products 配列で1〜1,000件を更新します。指定項目だけを変更し、結果を updated、skipped、rejected で返します。不明IDは not_found、変更項目なしは no_changes でskipします。

terminal
orc products update [options]

固有のオプション

--idempotency-key

Retry identity for operations that support idempotency. Use a unique key for each new operation, and reuse it only when retrying the same HTTP method, path, query values and exact request body. JSON whitespace changes can count as a different body. Keys contain 1–255 characters after trimming and expire after 24 hours. A completed JSON response is replayed without repeating the operation. A different request using the same key returns 409 idempotency_error. An in-progress request returns 409 idempotency_in_progress with Retry-After: 2. Whether this header is required depends on the operation.

型: string。任意。

terminal
orc products update --idempotency-key <value>
--products

(required) Partial updates in request order. Each item requires an Orchestor product ID.; JSON array of objects (use --stdin for large resources)

型: string。任意。

terminal
orc products update --products <value>

使用例

terminal
orc products update --workspace <workspace-id> --stdin --idempotency-key <request-key> --json < products-update.json

商品名を一括更新する

delete

ids 配列または --ids のCSVで1〜1,000件を論理削除します。deleted と skipped を確認してください。不明または削除済みIDは not_found でskipします。非対話時は --yes が必要です。

terminal
orc products delete [options]

固有のオプション

--idempotency-key

Retry identity for operations that support idempotency. Use a unique key for each new operation, and reuse it only when retrying the same HTTP method, path, query values and exact request body. JSON whitespace changes can count as a different body. Keys contain 1–255 characters after trimming and expire after 24 hours. A completed JSON response is replayed without repeating the operation. A different request using the same key returns 409 idempotency_error. An in-progress request returns 409 idempotency_in_progress with Retry-After: 2. Whether this header is required depends on the operation.

型: string。任意。

terminal
orc products delete --idempotency-key <value>
--ids

(required) Orchestor product IDs to delete, processed in request order. Repeating an ID can result in a skipped entry after its first deletion.; csv

型: string。任意。

terminal
orc products delete --ids <value>

使用例

terminal
orc products delete --workspace <workspace-id> --stdin --idempotency-key <request-key> --yes --json < products-delete.json

確認済みの商品を非対話で削除する

summary get

有効な商品件数と、その商品の異なるブランド数を取得します。空のカタログは両方0です。

terminal
orc products summary get [options]

attribute-keys list

有効な商品の attributes で使われる、異なる最上位キーを一覧します。入れ子のキーは展開しません。

terminal
orc products attribute-keys list [options]

get

商品IDで選択Workspace内の1件を取得します。別Workspaceの商品は not found になります。

terminal
orc products get <id> [options]

competitors list

同じ観測sliceに現れた競合shopping結果をvisibility順で確認します。商品自体が現れた元の質問には prompts list を使用します。

terminal
orc products competitors list <id> [options]

fanouts list

商品に関連する生成shopping queryを観測数順で取得します。元の質問ではなく、商品根拠へつながる検索展開を確認します。

terminal
orc products fanouts list <id> [options]

attributes list

観測された特徴、offerの事実、評価の根拠をsourceと頻度でまとめて取得します。カタログのカスタム属性キー一覧とは異なります。

terminal
orc products attributes list <id> [options]

prompts list

商品に一致するshopping観測を持つプロンプトを、出現数と平均絶対順位を含めて取得します。

terminal
orc products prompts list <id> [options]

resolve-jan

--jan でJAN/EANの商品候補とURL根拠を調べます。任意の --official-domain は利用者の申告で、所有者検証ではありません。--search false と公開URL入力も使用できます。登録は行いません。APIキーにはPOSTの書き込みscopeが必要です。

terminal
orc products resolve-jan [options]

固有のオプション

--jan

(required) Body field: jan

型: string。任意。

terminal
orc products resolve-jan --jan <value>
--official-domain

Caller-supplied manufacturer domain hint. Not independently verified ownership.; max 253 chars

型: string。任意。

terminal
orc products resolve-jan --official-domain <value>

Allows at most two paid organic search requests using the configured DataForSEO provider.

型: string。任意。

terminal
orc products resolve-jan --search <value>
--urls

Optional public product pages to inspect, also usable without a search provider.; csv

型: string。任意。

terminal
orc products resolve-jan --urls <value>

extract

--urls またはJSONで1〜5件の公開商品URLを指定し、Product/ProductGroup JSON-LDと対応するstorefront HTMLから出典付きの事実を抽出します。検索やカタログ登録は行いません。APIキーには書き込みscopeが必要です。

terminal
orc products extract [options]

固有のオプション

--urls

(required) Body field: urls; csv

型: string。任意。

terminal
orc products extract --urls <value>

使用例

商品登録の入力

products.json
{
  "products": [
    {
      "external_id": "YOUR_EXTERNAL_ID",
      "brand_id": "YOUR_BRAND_ID",
      "name": "YOUR_PRODUCT_NAME",
      "attributes": {
        "category": "YOUR_CATEGORY"
      }
    }
  ]
}

商品登録の入力

商品更新の入力

products-update.json
{
  "products": [
    {
      "id": "YOUR_PRODUCT_ID",
      "name": "YOUR_UPDATED_PRODUCT_NAME"
    }
  ]
}

商品更新の入力

商品削除の入力

products-delete.json
{
  "ids": [
    "YOUR_PRODUCT_ID"
  ]
}

商品削除の入力

削除リクエストを確認する

本文と対象Workspaceを表示し、APIへ送りません。

terminal
orc products delete --workspace <workspace-id> --stdin --dry-run < products-delete.json

削除リクエストを確認する

根拠の調査と登録

JANの解決は最大2回の有料DataForSEO検索と10件の公開ページに制限され、robotsとネットワーク制約に従います。checksum検証はGS1登録確認ではなく、GS1 registryも接続していません。正確なGTIN一致と未検証の検索候補を区別し、現在販売中かは確認しません。URL抽出は検索・registry照会・browser bypassを行いません。

これらの結果を確認・承認してから products create へ渡してください。一括処理ではコマンド全体の成功だけでなく各bucketの結果を確認します。削除された商品は一覧・集計・属性キー探索から外れます。

必要な権限

対象Workspaceへのアクセスが必要です。変更操作には対応する書き込み権限が必要です。

グローバルオプション

orc products では、次のグローバルオプションを使用できます。

各オプションの詳細と使用例は、グローバルオプションを参照してください。