# OnPage API ページスクリーンショット

**API:** Data API

**Endpoint:** `POST /v1/beta/dataforseo/on_page/page_screenshot`

**Tags:** DataForSEO

任意の `url` をレンダリングしてスクリーンショットを返します。`full_page_screenshot` でスクロール全体の高さを撮るかどうかを決め、`browser_screen_width` と `browser_screen_height` でビューポートを設定します。単独で動作し、クロールは不要です。DataForSEO のエンベロープに包まれます。データは `tasks[0].result`、結果は `tasks[0].status_code` に格納され、拒否されたリクエストでも HTTP 200 が返ります。⚠️ エージェントが画像を扱えない段階でも、画像はそれだけで大きなツール結果になります。見た目が要点である場合にのみスクリーンショットを要求し、テキストが要点なら `post_dataforseo_on_page_content_parsing_live` を使用してください。

### 料金の参考情報

- 計測方法：報告されたレスポンスコスト。
- 参考リクエスト見積もり：0.0051 USD。
- 参照用の顧客乗数：1.0。確定済みの顧客金額に再適用しないでください。

参照用のメタデータのみであり、アカウントへの見積もり、保証された価格、支出上限ではありません。リソースクレジットは Felo クレジットではありません。最終的な請求は Felo の請求記録に従います。

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Request body

Required: **no**

### application/json

Schema:

```json
{
  "type": "array",
  "items": {
    "type": [
      "object",
      "null"
    ],
    "oneOf": [
      {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "<em>ページ URL</em><br><strong>必須フィールド</strong><br>キャプチャするページの絶対 URL<br><strong>注意：</strong>ここで指定した URL が 404 ステータスコードを返す場合、または指定した値が有効な URL でない場合、レスポンス配列に <code>\"error_message\":\"Screenshot is empty\"</code> が返されます"
          },
          "accept_language": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>ウェブサイトにアクセスするための言語ヘッダー</em><br>任意フィールド<br>すべてのロケール形式をサポートしています（xx、xx-XX、xxx-XX など）<br><strong>注意：</strong>このパラメーターを指定しない場合、一部のウェブサイトがアクセスを拒否することがあります。その場合、レスポンス配列に <code>\"error_message\":\"Screenshot is empty\"</code> が返されます"
          },
          "custom_user_agent": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>カスタムユーザーエージェント</em><br>任意フィールド<br>ウェブサイトをクロールするためのカスタムユーザーエージェント<br>例： <code>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36<br></code><br>デフォルト値：<code>Mozilla/5.0 (compatible; RSiteAuditor)</code>"
          },
          "browser_preset": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>ブラウザースクリーンパラメーターのプリセット</em><br>任意フィールド<br>このフィールドを使用する場合、<code>browser_screen_width</code>、<code>browser_screen_height</code>、<code>browser_screen_scale_factor</code> を指定する必要はありません<p>可能な値：<br><code>desktop</code>、<code>mobile</code>、<code>tablet</code><p><code>desktop</code> プリセットでは次の値が適用されます：<p><code>browser_screen_width: 1920</code><br><code>browser_screen_height: 1080</code><br><code>browser_screen_scale_factor: 1</code><p><code>mobile</code> プリセットでは次の値が適用されます：<p><code>browser_screen_width: 390</code><br><code>browser_screen_height: 844</code><br><code>browser_screen_scale_factor: 3</code><p><code>tablet</code> プリセットでは次の値が適用されます：<p><code>browser_screen_width: 1024</code><br><code>browser_screen_height: 1366</code><br><code>browser_screen_scale_factor: 2</code><p><strong>注意：</strong>このエンドポイントでは、<code>enable_browser_rendering</code>、<code>enable_javascript</code>、<code>load_resources</code>、<code>enable_xhr</code> の各パラメーターは常に有効です。"
          },
          "browser_screen_width": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>ブラウザースクリーンの幅</em><br>任意フィールド<br>特定のデバイス向けの監査を実行するために、ブラウザースクリーンの幅をカスタム設定できます；<br>このフィールドを使用する場合、<code>browser_preset</code> は無視されるため指定する必要はありません；<p>            最小値（ピクセル）：<code>240</code> <br>最大値（ピクセル）：<code>9999</code>",
            "format": "int64"
          },
          "browser_screen_height": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>ブラウザースクリーンの高さ</em><br>任意フィールド<br>特定のデバイス向けの監査を実行するために、ブラウザースクリーンの高さをカスタム設定できます；<br>このフィールドを使用する場合、<code>browser_preset</code> は無視されるため指定する必要はありません；<p>            最小値（ピクセル）：<code>240</code> <br>最大値（ピクセル）：<code>9999</code>"
          },
          "browser_screen_scale_factor": {
            "type": [
              "number",
              "null"
            ],
            "description": "<em>ブラウザースクリーンのスケール係数</em><br>任意フィールド<br>特定のデバイス向けの監査を実行するために、ブラウザースクリーンの解像度比をカスタム設定できます；<br>このフィールドを使用する場合、<code>browser_preset</code> は無視されるため指定する必要はありません；<p>            最小値：<code>0.5</code> <br>最大値：<code>3</code>"
          },
          "full_page_screenshot": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "<em>ページ全体のスクリーンショットを撮る</em><br>任意フィールド<br>スクロール前に表示されるページの一部のみをキャプチャする場合は <code>false</code> に設定します<br>デフォルト値：<code>true</code>"
          },
          "disable_cookie_popup": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "<em>Cookie ポップアップを無効にする </em><br>任意フィールド<br>ユーザーに Cookie の同意を求めるポップアップを無効にする場合は <code>true</code> に設定します；<br>デフォルト値：<br><code>false</code>"
          },
          "switch_pool": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "<em>プロキシプールを切り替える</em><br>任意フィールド<br><code>true</code> の場合、要求されたデータの取得に追加のプロキシプールが使用されます；<br>多数のタスクを同時に設定したために <code>rate-limit</code> や <code>site_unreachable</code> エラーが発生することがある場合、このパラメーターを使用できます"
          },
          "ip_pool_for_scan": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>プロキシプール</em><br>任意フィールド<br>要求されたデータの取得に使用するプロキシプールのロケーションを選択できます；<br>いずれかのロケーションでページコンテンツにアクセスできず、<code>site_unreachable</code> エラーが発生することがある場合、このパラメーターを使用できます<br>可能な値：<code>us</code>、<code>de</code>"
          }
        },
        "example": [
          {
            "url": "https://dataforseo.com/apis"
          }
        ]
      }
    ]
  },
  "example": [
    {
      "url": "https://dataforseo.com/apis"
    }
  ]
}
```

## Responses

### 200 — 操作成功

Headers:
- `X-Request-Id` (string) — Felo サポートに問い合わせる際に伝えるリクエスト識別子。

**application/json**

Schema: object | null

```json
{
  "type": [
    "object",
    "null"
  ],
  "oneOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_OnPagePageScreenshotResponseInfo"
    }
  ]
}
```

### 400 — リクエストを処理できませんでした。リクエストパラメータを確認してください。

### 401 — 有効な Felo API キーが必要です。

### 402 — 請求要件が満たされていないため、リクエストを続行できません。

### 403 — このアカウントにはこの操作を行う権限がありません。

### 429 — リクエストまたは支出の上限に達しました。

### 502 — サービスがリクエストを完了できませんでした。

### 503 — API または請求サービスが一時的に利用できません。

### 504 — リクエストの処理中にサービスがタイムアウトしました。

### default — エラーレスポンス。上流のパススルーレスポンスはプロバイダーの形式を使用する場合があります

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response36Afe1097B20_BaseResponseInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseInfo`

```json
{
  "properties": {
    "version": {
      "type": [
        "string",
        "null"
      ],
      "description": "API の現在のバージョン"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "一般的なステータスコード\nレスポンスコードの完全な一覧はこちらです"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "一般的な情報メッセージ\n一般的な情報メッセージの完全な一覧はこちらです"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "合計実行時間（秒）"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "タスクの総コスト（USD）",
      "format": "double"
    },
    "tasks_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "tasks 配列内のタスク数",
      "format": "int64"
    },
    "tasks_error": {
      "type": [
        "integer",
        "null"
      ],
      "description": "エラーで返された tasks 配列内のタスク数",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_BaseResponseTaskInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo`

```json
{
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "タスク識別子\n当社システム内で UUID 形式の一意のタスク識別子"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "タスクのステータスコード\nDataForSEO によって生成され、次の範囲の値になります: 10000-60000\nレスポンスコードの完全な一覧はこちらです"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "タスクの情報メッセージ\n一般的な情報メッセージの完全な一覧はこちらです"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "実行時間（秒）"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "タスクの総コスト（USD）",
      "format": "double"
    },
    "result_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "result 配列内の要素数",
      "format": "int64"
    },
    "path": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "URL パス"
    },
    "data": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "object",
          "null"
        ]
      },
      "description": "POST リクエストで指定したものと同じパラメーターを含みます"
    }
  }
}
```

### Response36Afe1097B20_OnPagePageScreenshotResponseInfo

`#/components/schemas/Response36Afe1097B20_OnPagePageScreenshotResponseInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseInfo"
    },
    {
      "type": "object",
      "properties": {
        "tasks": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_OnPagePageScreenshotTaskInfo"
              }
            ]
          },
          "description": "<em>タスクの配列</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_OnPagePageScreenshotResultInfo

`#/components/schemas/Response36Afe1097B20_OnPagePageScreenshotResultInfo`

```json
{
  "type": "object",
  "properties": {
    "crawl_progress": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>クロールセッションのステータス</em><br>可能な値：<code>in_progress</code>、<code>finished</code>"
    },
    "error_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>エラーメッセージ</em><br>指定した <code>url</code> が 404 ステータスコードを返す場合、または有効な URL でない場合は、<code>\"error_message\":\"Screenshot is empty\"</code> が返されます<br>エラーが発生しなかった場合、値は <code>null</code> になります"
    },
    "items_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>結果配列内の項目数</em>",
      "format": "int64"
    },
    "items": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_ScreenshotItem"
          }
        ]
      },
      "description": "<em>項目の配列</em>"
    }
  }
}
```

### Response36Afe1097B20_OnPagePageScreenshotTaskInfo

`#/components/schemas/Response36Afe1097B20_OnPagePageScreenshotTaskInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo"
    },
    {
      "type": "object",
      "properties": {
        "result": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_OnPagePageScreenshotResultInfo"
              }
            ]
          },
          "description": "<em>結果の配列</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_ScreenshotItem

`#/components/schemas/Response36Afe1097B20_ScreenshotItem`

```json
{
  "type": "object",
  "properties": {
    "image": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>リクエストしたページのスクリーンショット</em><br>DataForSEO ストレージ上のページスクリーンショットの URL<br><strong>注意：DataForSEO ストレージに保存されたページスクリーンショットは、リクエスト後 1 日間のみアクセスできます</strong>"
    }
  }
}
```
