> ## Documentation Index
> Fetch the complete documentation index at: https://docs.olostep.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ウェブデータコマンド

> スクレイピング、検索、マッピング、回答、抽出、コンテンツ：ウェブからデータを取得します。

これらのコマンドはウェブからデータを取得します。新しいデータを取得するたびにクレジットを使用します。サイト全体をクロールするには、[`olostep crawl`](https://docs.olostep.com/cli/reference/jobs#crawl)を参照してください。複数のURLを一度にスクレイピングするには、[`olostep batch`](https://docs.olostep.com/cli/reference/jobs#batch)を参照してください。

すべてのコマンドはターミナルでMarkdownを出力し、`--json`を使用するとJSONを出力します。[出力](https://docs.olostep.com/cli/usage.md#output)を参照してください。

## scrape

単一ページをスクレイピングします。`olostep scrape <url>`は`olostep scrape create`を実行します。[スクレイピング](https://docs.olostep.com/features/scrapes.md)の形式とオプションを参照してください。

### olostep scrape create

ページをMarkdown、HTML、または構造化データにスクレイピングします。

> [!NOTE]
>
> クレジットを使用します。

```bash theme={null}
olostep scrape create [--formats string]... [--country text] [--wait integer] [--remove-css-selectors text] [--remove-class-names string]... [--parser json] [--llm-extract json] [--screen-size json] [--links-on-page json] [--metadata json] [--preview] [--url-to-scrape text] [--json] [--fields a,b] [--dry-run] [<url_to_scrape>]
```

省略形: `olostep scrape <url>`。

**引数**

| 引数 | 説明 |
| - | - |
| `url_to_scrape` | http(s) URL。オプションで、フラグとして渡すこともできます。 |

**フラグ**

| フラグ | 必須 | 説明 |
| - | - | - |
| `-f`, `--formats` | いいえ | 出力形式、例えば`markdown`や`html`。フラグを繰り返すか、値をカンマで区切ります。 |
| `-c`, `--country` | いいえ | 国。 |
| `--wait` | いいえ | スクレイピング前に待機するミリ秒（0から60000）。 |
| `--remove-css-selectors` | いいえ | ページから削除するCSSセレクタ。 |
| `--remove-class-names` | いいえ | 削除するクラス。フラグを繰り返すか、値をカンマで区切ります。 |
| `--parser` | いいえ | パーサー設定。JSONオブジェクト、または`@file.json`。 |
| `--llm-extract` | いいえ | LLM抽出設定。JSONオブジェクト、または`@file.json`。 |
| `--screen-size` | いいえ | スクリーンショットのビューポート。JSONオブジェクト、または`@file.json`。 |
| `--links-on-page` | いいえ | リンク抽出オプション。JSONオブジェクト、または`@file.json`。 |
| `--metadata` | いいえ | リクエストメタデータ。JSONオブジェクト、または`@file.json`。 |
| `--url-to-scrape` | いいえ | `url_to_scrape`引数と同じ。 |

また、`--json`、`--fields`、`--dry-run`、`--preview`を受け付けます。[グローバルフラグ](https://docs.olostep.com/cli/usage.md#global-flags)を参照してください。

```bash theme={null}
olostep scrape https://example.com -f markdown
olostep scrape https://example.com -f markdown,html -c US --wait 2000
olostep scrape https://example.com -f markdown --json
```

### olostep scrape get

IDで以前のスクレイプを表示します。

```bash theme={null}
olostep scrape get [--json] [--fields a,b] <scrape_id>
```

**引数**

| 引数 | 説明 |
| - | - |
| `scrape_id` | スクレイプID。 |

また、`--json`と`--fields`を受け付けます。[グローバルフラグ](https://docs.olostep.com/cli/usage.md#global-flags)を参照してください。

```bash theme={null}
olostep scrape get <scrape_id>
```

## search

ウェブを検索します。`olostep search "<query>"`は`olostep search create`を実行します。[検索](https://docs.olostep.com/features/search.md)を参照してください。

### olostep search create

ウェブを検索します。

> [!NOTE]
>
> クレジットを使用します。

```bash theme={null}
olostep search create [--options json] [--preview] [--query text] [--json] [--fields a,b] [--dry-run] [<query>]
```

省略形: `olostep search "<query>"`。

**引数**

| 引数 | 説明 |
| - | - |
| `query` | 検索クエリ。オプションで、フラグとして渡すこともできます。 |

**フラグ**

| フラグ | 必須 | 説明 |
| - | - | - |
| `--options` | いいえ | 追加の公開検索APIオプション。JSONオブジェクト、または`@file.json`。 |
| `--query` | いいえ | `query`引数と同じ。 |

また、`--json`、`--fields`、`--dry-run`、`--preview`を受け付けます。[グローバルフラグ](https://docs.olostep.com/cli/usage.md#global-flags)を参照してください。

```bash theme={null}
olostep search "best hiking trails"
olostep search "olostep web scraping api" --json
```

### olostep search get

IDで以前の検索を表示します。

```bash theme={null}
olostep search get [--json] [--fields a,b] <search_id>
```

**引数**

| 引数 | 説明 |
| - | - |
| `search_id` | 検索ID。 |

また、`--json`と`--fields`を受け付けます。[グローバルフラグ](https://docs.olostep.com/cli/usage.md#global-flags)を参照してください。

```bash theme={null}
olostep search get <search_id>
```

## map

ウェブサイトのURLを一覧表示します。`olostep map <url>`は`olostep map create`を実行します。[マップ](https://docs.olostep.com/features/maps.md)を参照してください。

### olostep map create

ウェブサイトのURLを発見します。

> [!NOTE]
>
> クレジットを使用します。

```bash theme={null}
olostep map create [--include-urls string]... [--exclude-urls string]... [--search text] [--top-n integer] [--include-subdomain] [--preview] [--url text] [--json] [--fields a,b] [--dry-run] [<url>]
```

省略形: `olostep map <url>`。

**引数**

| 引数 | 説明 |
| - | - |
| `url` | http(s) URL。オプションで、フラグとして渡すこともできます。 |

**フラグ**

| フラグ | 必須 | 説明 |
| - | - | - |
| `--include-urls` | いいえ | URLパターンを含める。フラグを繰り返すか、値をカンマで区切ります。 |
| `--exclude-urls` | いいえ | URLパターンを除外する。フラグを繰り返すか、値をカンマで区切ります。 |
| `--search` | いいえ | このクエリにどれだけ一致するかでURLをランク付けします。 |
| `-n`, `--top-n` | いいえ | 返すURLの最大数。 |
| `--include-subdomain` | いいえ | サブドメインを含める。 |
| `--url` | いいえ | `url`引数と同じ。 |

また、`--json`、`--fields`、`--dry-run`、`--preview`を受け付けます。[グローバルフラグ](https://docs.olostep.com/cli/usage.md#global-flags)を参照してください。

```bash theme={null}
olostep map https://example.com -n 20
olostep map https://example.com --search "pricing" -n 10
```

## answer

ウェブで質問を調査します。`olostep answer "<task>"`は`olostep answer create`を実行します。[回答](https://docs.olostep.com/features/answers.md)を参照してください。

### olostep answer create

ウェブで質問やタスクを調査し、求める形の回答やJSONを取得します。

> [!NOTE]
>
> クレジットを使用します。

```bash theme={null}
olostep answer create [--schema json] [--options json] [--preview] [--task text] [--json] [--fields a,b] [--dry-run] [<task>]
```

省略形: `olostep answer "<task>"`。

**引数**

| 引数 | 説明 |
| - | - |
| `task` | 調査タスク。オプションで、フラグとして渡すこともできます。 |

**フラグ**

| フラグ | 必須 | 説明 |
| - | - | - |
| `--schema` | いいえ | 要求されたJSONスキーマ。JSONオブジェクト、または`@file.json`。 |
| `--options` | いいえ | 追加の回答オプション。JSONオブジェクト、または`@file.json`。 |
| `--task` | いいえ | `task`引数と同じ。 |

また、`--json`、`--fields`、`--dry-run`、`--preview`を受け付けます。[グローバルフラグ](https://docs.olostep.com/cli/usage.md#global-flags)を参照してください。

```bash theme={null}
olostep answer "What does Olostep do?"
olostep answer "What is the latest book by J.K. Rowling?" --schema '{"book_title":"","author":"","release_date":""}' --json
```

### olostep answer get

IDで以前の回答を表示します。

```bash theme={null}
olostep answer get [--json] [--fields a,b] <answer_id>
```

**引数**

| 引数 | 説明 |
| - | - |
| `answer_id` | 回答ID。 |

また、`--json`と`--fields`を受け付けます。[グローバルフラグ](https://docs.olostep.com/cli/usage.md#global-flags)を参照してください。

```bash theme={null}
olostep answer get <answer_id>
```

## extract

ページから構造化データを引き出します。`olostep extract <url>`は`olostep extract run`を実行します。[LLM抽出](https://docs.olostep.com/features/structured-content/llm-extraction.md)を参照してください。

### olostep extract run

ページから平易な言葉で指示を出して構造化データを抽出します。

> [!NOTE]
>
> クレジットを使用します。

```bash theme={null}
olostep extract run (--instruction text) [--schema json] [--preview] [--url text] [--json] [--fields a,b] [--dry-run] [<url>]
```

省略形: `olostep extract <url>`。

**引数**

| 引数 | 説明 |
| - | - |
| `url` | http(s) URL。オプションで、フラグとして渡すこともできます。 |

**フラグ**

| フラグ | 必須 | 説明 |
| - | - | - |
| `-i`, `--instruction` | はい | 何を抽出するか。 |
| `--schema` | いいえ | オプションのJSONスキーマ。JSONオブジェクト、または`@file.json`。 |
| `--url` | いいえ | `url`引数と同じ。 |

また、`--json`、`--fields`、`--dry-run`、`--preview`を受け付けます。[グローバルフラグ](https://docs.olostep.com/cli/usage.md#global-flags)を参照してください。

```bash theme={null}
olostep extract https://example.com -i "Extract product prices"
olostep extract https://example.com/team -i "List each person's name and role" --json
```

## content

すでにスクレイピングまたはクロールしたページを再度スクレイピングせずに読み取ります。

### olostep content retrieve

すでにスクレイピングまたはクロールしたページの保存されたHTML、Markdown、またはJSONを取得します。`retrieve_id`は`scrape create`、`scrape get`、`crawl pages`（Retrieve ID列）、または`batch items`から取得します。`scrape_abc123`のようなスクレイプIDも使用できます。

```bash theme={null}
olostep content retrieve [--formats string]... [--json] [--fields a,b] <retrieve_id>
```

**引数**

| 引数 | 説明 |
| - | - |
| `retrieve_id` | ページのretrieve\_id、例えばabc123（またはそのスクレイプID、scrape\_abc123）。 |

**フラグ**

| フラグ | 必須 | 説明 |
| - | - | - |
| `-f`, `--formats` | いいえ | 返す形式：`html`、`markdown`、または`json`。保存されたすべての形式を返すには省略します。フラグを繰り返すか、値をカンマで区切ります。 |

また、`--json`と`--fields`を受け付けます。[グローバルフラグ](https://docs.olostep.com/cli/usage.md#global-flags)を参照してください。

```bash theme={null}
olostep content retrieve <retrieve_id> -f markdown
olostep content retrieve scrape_abc123 -f html,markdown --json
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.