CLI を使い始める

research zenn

orc research zenn は、Zennの記事・本・スクラップを検索し、作者・トピック・Publicationから内容をたどるコマンドです。検索結果のownerとslugを使って詳細を取得し、検索件数やトップページの掲載も確認できます。

認証済みのCLIと、アクセス可能なWorkspaceが必要です。--workspace で今回の対象を指定できます。

使い方

terminal
orc research zenn articles list --q "生成AI" --workspace <workspace-id> --json

トピックに関する記事を検索する。

サブコマンド

articles list

記事を検索し、作者・トピック・Publicationと掲載順で絞り込めます。--publication-name は表示名ではなくPublicationのnameです。

terminal
orc research zenn articles list [options]

固有のオプション

--q

Search text, 1–200 characters. Uses Zenn keyword search; content ordering is controlled by order.; max 200 chars

型: string。任意。

terminal
orc research zenn articles list --q <value>
--page

One-based page number. Prefer the returned pagination.next_url.

型: number。任意。

terminal
orc research zenn articles list --page <value>
--topic-name

Zenn topic name, not its numeric ID. URL-encode the path segment.; max 200 chars

型: string。任意。

terminal
orc research zenn articles list --topic-name <value>
--username

Filter by the Zenn author username.

型: string。任意。

terminal
orc research zenn articles list --username <value>
--order

Native Zenn order. Defaults to latest. daily is Trending; alltime is Alltime; recent is Recent. Scraps do not support recent.; enum: latest|daily|alltime|recent

型: string。任意。

terminal
orc research zenn articles list --order <value>
--publication-name

Filter articles by publication name, not display name.

型: string。任意。

terminal
orc research zenn articles list --publication-name <value>

articles get

URLのownerとslugを指定して記事を取得します。数値IDではなく、一覧の api_url や元のURLにある値を使います。

terminal
orc research zenn articles get <owner> <slug> [options]

books list

本を検索し、作者・トピック・掲載順で絞り込みます。

terminal
orc research zenn books list [options]

固有のオプション

--q

Search text, 1–200 characters. Uses Zenn keyword search; content ordering is controlled by order.; max 200 chars

型: string。任意。

terminal
orc research zenn books list --q <value>
--page

One-based page number. Prefer the returned pagination.next_url.

型: number。任意。

terminal
orc research zenn books list --page <value>
--topic-name

Zenn topic name, not its numeric ID. URL-encode the path segment.; max 200 chars

型: string。任意。

terminal
orc research zenn books list --topic-name <value>
--username

Filter by the Zenn author username.

型: string。任意。

terminal
orc research zenn books list --username <value>
--order

Native Zenn order. Defaults to latest. daily is Trending; alltime is Alltime; recent is Recent. Scraps do not support recent.; enum: latest|daily|alltime|recent

型: string。任意。

terminal
orc research zenn books list --order <value>

books get

URLのownerとslugを指定して本を取得します。数値IDではなく、一覧の api_url や元のURLにある値を使います。

terminal
orc research zenn books get <owner> <slug> [options]

map

Zennの取得機能とコンテンツの入口を確認します。

terminal
orc research zenn map [options]

publications list

--q の検索語でPublicationを検索します。

terminal
orc research zenn publications list [options]

固有のオプション

--q

Search text, 1–200 characters. Uses Zenn keyword search; content ordering is controlled by order.; max 200 chars

型: string。必須。

terminal
orc research zenn publications list --q <value>
--page

One-based page number. Prefer the returned pagination.next_url.

型: number。任意。

terminal
orc research zenn publications list --page <value>

publications get

Publicationのnameを指定して公開情報を取得します。表示名や数値IDは使いません。

terminal
orc research zenn publications get <name> [options]

scraps list

スクラップを検索し、作者やトピックで絞り込みます。掲載順は latest、daily、alltime に対応し、recent には対応しません。

terminal
orc research zenn scraps list [options]

固有のオプション

--q

Search text, 1–200 characters. Uses Zenn keyword search; content ordering is controlled by order.; max 200 chars

型: string。任意。

terminal
orc research zenn scraps list --q <value>
--page

One-based page number. Prefer the returned pagination.next_url.

型: number。任意。

terminal
orc research zenn scraps list --page <value>
--topic-name

Zenn topic name, not its numeric ID. URL-encode the path segment.; max 200 chars

型: string。任意。

terminal
orc research zenn scraps list --topic-name <value>
--username

Filter by the Zenn author username.

型: string。任意。

terminal
orc research zenn scraps list --username <value>
--order

Native scrap ordering: latest, daily or alltime. Defaults to latest. Keep the value unchanged when following pagination.; enum: latest|daily|alltime

型: string。任意。

terminal
orc research zenn scraps list --order <value>

scraps get

URLのownerとslugを指定してスクラップを取得します。数値IDではなく、一覧の api_url や元のURLにある値を使います。

terminal
orc research zenn scraps get <owner> <slug> [options]

search counts get

--q の検索語に対する原典の検索件数を取得します。件数は検索需要や記事品質を意味しません。

terminal
orc research zenn search counts get [options]

固有のオプション

--q

Search text, 1–200 characters. Uses Zenn keyword search; content ordering is controlled by order.; max 200 chars

型: string。必須。

terminal
orc research zenn search counts get --q <value>

topics list

トピックを一覧表示し、検索語やページ番号で探索します。

terminal
orc research zenn topics list [options]

固有のオプション

--q

Search text, 1–200 characters. Uses Zenn keyword search; content ordering is controlled by order.; max 200 chars

型: string。任意。

terminal
orc research zenn topics list --q <value>
--page

One-based page number. Prefer the returned pagination.next_url.

型: number。任意。

terminal
orc research zenn topics list --page <value>

topics get

トピック名を指定して公開情報を取得します。数値IDではなくnameを使います。

terminal
orc research zenn topics get <name> [options]

Zennトップページに掲載されるセクションを取得します。

terminal
orc research zenn trends list [options]

users list

--q の検索語でZennのユーザーを検索します。

terminal
orc research zenn users list [options]

固有のオプション

--q

Search text, 1–200 characters. Uses Zenn keyword search; content ordering is controlled by order.; max 200 chars

型: string。必須。

terminal
orc research zenn users list --q <value>
--page

One-based page number. Prefer the returned pagination.next_url.

型: number。任意。

terminal
orc research zenn users list --page <value>

users get

Zennのusernameを指定して公開情報を取得します。

terminal
orc research zenn users get <name> [options]

使用例

記事のURLから詳細を取得する。

terminal
orc research zenn articles get <owner> <slug> --workspace <workspace-id> --json

記事のURLから詳細を取得する。

出力とページ送り

一覧は一回の呼び出しで一ページを取得します。返された pagination.next_url のクエリ値を、対応するフラグへ渡して続きを取得してください。検索条件は維持します。継続情報が不明でも全件取得済みとは判断せず、--page-all による自動巡回は行いません。

--json ではAPIレスポンス全体をCLIの data に保持します。取得内容は data.data、継続情報は data.pagination、取得元情報は data.source です。--raw はCLIの外枠を外し、--field data はAPIのデータだけを選択します。欠損値やnullを0として扱わないでください。

識別子と掲載順

詳細取得のownerは元URLの最初のセグメント、slugはコンテンツのslugです。トピック名・username・Publicationのnameを使い、数値IDや表示名で代用しません。記事と本の --order は latest・daily・alltime・recent、スクラップは recent に非対応です。ページ送りでは掲載順を維持します。

必要な権限

APIキーではreadスコープが必要です。 プロバイダーのキーはサーバー側で管理します。

グローバルオプション

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

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

関連項目