# OnPage API リソース

**API:** Data API

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

**Tags:** DataForSEO

クロールで見つかったページ以外のアセット（画像、スクリプト、スタイルシート）と、そのステータスコードおよびサイズです。ページは `search_after_token` でページングします。完了したクロールを読み取るため、`post_dataforseo_on_page_submit` が返す `id` が必要です。`crawl_progress` と、`max_crawl_pages`・`pages_in_queue`・`pages_crawled` を含む `crawl_status` を返します。少ない結果を信じる前にこれらを確認してください。実行中のクロールは報告できる内容が少ないだけです。クローラーがまったく到達できなかったアセットについては `post_dataforseo_on_page_uncrawlable_resources` を使用してください。💰 アップストリームは無料：完了したクロールの照会には費用がかからず、費用がかかるのはクロール自体だけです。

### 料金の参考情報

- 計測方法：報告されたレスポンスコスト。
- 参考リクエスト見積もり：0.012 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": {
          "id": {
            "type": "string",
            "description": "<em>タスクの ID</em><br><strong>必須フィールド</strong><br>この ID は、<a href=\"/v3/on_page/task_post/\">Task POST</a> エンドポイントのレスポンスで取得できます<br>例：<br>\"07131248-1535-0216-1000-17384017ad04\""
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>ページ URL</em><br>任意フィールド<br>特定のページのリソースを取得する場合は、このフィールドを指定します<br>特定の URL からリソースの <code>meta</code> を取得するには、このフィールドでその URL を指定する必要があることに注意してください；<br>タスクの設定時に <code>url</code> を指定しない場合、結果内のリソースの <code>meta</code> は、クローラーが最初にそのリソースを検出したページのデータに基づいて返されます"
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>返されるリソースの最大数</em><br>任意フィールド<br>デフォルト値：<code>100</code><br>最大値：<code>1000</code>"
          },
          "offset": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>返されるリソースの結果配列内のオフセット</em><br>任意フィールド<br>デフォルト値：<code>0</code><br>最大値：<code>2000000</code><br><code>10</code> を指定すると、結果配列の最初の 10 リソースが省略され、後続のリソースのデータが返されます"
          },
          "filters": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": [
                "object",
                "null"
              ]
            },
            "description": "<em>結果フィルターパラメーターの配列</em><br>任意フィールド<br><strong>複数のフィルターを同時に追加できます（最大 8 個）</strong><br>条件の間には論理演算子 <code>and</code>、<code>or</code> を設定してください<br>次の演算子がサポートされています：<br><code>regex</code>、<code>not_regex</code>、<code>&lt;</code>、<code>&lt;=</code>、<code>&gt;</code>、<code>&gt;=</code>、<code>=</code>、<code>&lt;&gt;</code>、<code>in</code>、<code>not_in</code>、<code>like</code>、<code>not_like</code><br><code>like</code> と <code>not_like</code> で <code>%</code> 演算子を使用すると、0 文字以上の任意の文字列に一致させられます<br>例：<br><code>[\"resource_type\",\"=\",\"stylesheet\"]</code><p><code>[[\"resource_type\",\"=\",\"image\"],<br>\"and\",[\"checks.is_https\",\"=\",false]]</code><p><code>[[\"fetch_timing.duration_time\",\">\",1],\"and\",[[\"total_transfer_size\",\"&gt;\",100],\"or\",[\"checks.high_loading_time\",\"=\",true]]]</code><p>利用可能なフィルターの完全なリストは<a href=\"/v3/on_page/filters_and_thresholds/?bash\" rel=\"noopener noreferrer\" target=\"_blank\">このリンク</a>から確認できます。"
          },
          "relevant_pages_filters": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "<em>関連するページでリソースを絞り込む</em><br>任意フィールド<br>このフィールドを使用すると、定義したパラメーターに一致するページからリソースを取得できます<br>ここでは、<a href=\"/v3/on_page/pages/\" rel=\"noopener noreferrer\" target=\"_blank\">Pages エンドポイント</a>で使用できるものと同じフィルターを適用できます<br><strong>複数のフィルターを同時に追加できます（最大 8 個）</strong><br>条件の間には論理演算子 <code>and</code>、<code>or</code> を設定してください<br>次の演算子がサポートされています：<br><code>regex</code>、<code>not_regex</code>、<code>&lt;</code>、<code>&lt;=</code>、<code>&gt;</code>、<code>&gt;=</code>、<code>=</code>、<code>&lt;&gt;</code>、<code>in</code>、<code>not_in</code>、<code>like</code>、<code>not_like</code><br><code>like</code> と <code>not_like</code> で <code>%</code> 演算子を使用すると、0 文字以上の任意の文字列に一致させられます<br>例：<br><code>[\"checks.no_image_title\",\"=\",true]</code>"
          },
          "order_by": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "<em>結果の並び替えルール</em><br>任意フィールド<br><code>filters</code> 配列と同じ値を使用して結果を並び替えられます<br>指定可能な並び替えの種類：<br><code>asc</code> - 結果を昇順で並び替えます<br><code>desc</code> - 結果を降順で並び替えます<br>並び替えの種類はカンマで設定します<br>例：<br><code>[\"size,desc\"]</code><br><strong>1 回のリクエストで設定できる並び替えルールは 3 つまでです</strong><br>複数の並び替えルールはカンマで区切ります<br>例：<br><code>[\"size,desc\",\"fetch_timing.fetch_end,desc\"]</code>"
          },
          "search_after_token": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>後続のリクエスト用トークン</em><br>任意フィールド<br>各リクエストのレスポンスの対応するフィールドで提供されます<br>このパラメータを使用すると、1 回のリクエストで <code>20,000</code> 件を超える結果を取得する際のタイムアウトを回避できます<br>レスポンス配列内の一意の <code>search_after_token</code> 値を指定すると、最初のタスクの後続の結果を取得できます<br><code>search_after_token</code> の値は後続のタスクごとに一意です<br><strong>注意:</strong> リクエストで <code>search_after_token</code> を指定する場合、他のすべてのパラメータは前のリクエストと同一である必要があります"
          },
          "tag": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>ユーザー定義のタスク識別子</em><br>任意フィールド<br><em>文字数上限は 255 です</em><br>このパラメーターを使ってタスクを識別し、結果と照合できます<br>指定した <code>tag</code> の値は、レスポンスの <code>data</code> オブジェクトに含まれます"
          }
        },
        "example": [
          {
            "id": "07281559-0695-0216-0000-c269be8b7592",
            "filters": [
              [
                "resource_type",
                "=",
                "image"
              ],
              "and",
              [
                "size",
                ">",
                100000
              ]
            ],
            "order_by": [
              "size,desc"
            ],
            "limit": 10
          }
        ]
      }
    ]
  },
  "example": [
    {
      "id": "07281559-0695-0216-0000-c269be8b7592",
      "filters": [
        [
          "resource_type",
          "=",
          "image"
        ],
        "and",
        [
          "size",
          ">",
          100000
        ]
      ],
      "order_by": [
        "size,desc"
      ],
      "limit": 10
    }
  ]
}
```

## Responses

### 200 — 操作成功

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

**application/json**

Schema: object | null

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

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

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

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

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

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

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

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

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

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

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response36Afe1097B20_BaseOnPageResourceItem

`#/components/schemas/Response36Afe1097B20_BaseOnPageResourceItem`

```json
{
  "type": "object",
  "properties": {
    "resource_type": {
      "type": [
        "string",
        "null"
      ],
      "description": "要素の種類"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "一般的なステータスコード。レスポンスコードの完全な一覧はこちらです。注意: 関連する例外やエラー条件を処理するための必要なシステムを設計することを強く推奨します"
    },
    "location": {
      "type": [
        "string",
        "null"
      ],
      "description": "Location ヘッダー。ページのリダイレクト先 URL を示します"
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "description": "ページ URL"
    },
    "resource_errors": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_OnPageResourceIssueInfo"
        }
      ],
      "description": "リソースのエラーと警告"
    },
    "size": {
      "type": [
        "integer",
        "null"
      ],
      "description": "リソースサイズ。指定したページのサイズをバイト単位で示します"
    },
    "encoded_size": {
      "type": [
        "integer",
        "null"
      ],
      "description": "エンコード後のページサイズ。エンコードされたページのサイズをバイト単位で示します"
    },
    "total_transfer_size": {
      "type": [
        "integer",
        "null"
      ],
      "description": "圧縮後のページサイズ。指定したページの圧縮後サイズを示します",
      "format": "int64"
    },
    "fetch_time": {
      "type": [
        "string",
        "null"
      ],
      "description": "リソースを取得した日時。UTC 形式: “yyyy-mm-dd hh-mm-ss +00:00”、例: 2019-11-15 12:57:46 +00:00"
    },
    "cache_control": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_CacheControl"
        }
      ],
      "description": "キャッシュに関する説明"
    },
    "checks": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "description": "ウェブサイトチェック：ページに関連するページ内チェック項目"
    },
    "content_encoding": {
      "type": [
        "string",
        "null"
      ],
      "description": "エンコードの種類"
    },
    "media_type": {
      "type": [
        "string",
        "null"
      ],
      "description": "ページの表示に使用されるメディアの種類"
    },
    "server": {
      "type": [
        "string",
        "null"
      ],
      "description": "サーバーのバージョン"
    },
    "last_modified": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_LastModified"
        }
      ],
      "description": "リソースに関連する変更に関するデータが含まれます。データがない場合、値は null になります"
    }
  },
  "additionalProperties": false,
  "discriminator": {
    "propertyName": "resource_type",
    "mapping": {
      "html": "#/components/schemas/Response36Afe1097B20_OnPageHtmlResourceItem",
      "broken": "#/components/schemas/Response36Afe1097B20_OnPageBrokenResourceItem",
      "redirect": "#/components/schemas/Response36Afe1097B20_OnPageRedirectResourceItem",
      "script": "#/components/schemas/Response36Afe1097B20_OnPageScriptResourceItem",
      "image": "#/components/schemas/Response36Afe1097B20_OnPageImageResourceItem",
      "stylesheet": "#/components/schemas/Response36Afe1097B20_OnPageStylesheetResourceItem"
    }
  }
}
```

### 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_CacheControl

`#/components/schemas/Response36Afe1097B20_CacheControl`

```json
{
  "type": "object",
  "properties": {
    "cachable": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "ページがキャッシュ可能かどうかを示します"
    },
    "ttl": {
      "type": [
        "integer",
        "null"
      ],
      "description": "存続時間。ブラウザがリソースをキャッシュする時間の長さ"
    }
  }
}
```

### Response36Afe1097B20_CrawlStatusInfo

`#/components/schemas/Response36Afe1097B20_CrawlStatusInfo`

```json
{
  "type": "object",
  "properties": {
    "max_crawl_pages": {
      "type": [
        "integer",
        "null"
      ],
      "description": "クロールするページ数の上限\n タスク設定時に指定した max_crawl_pages の制限を示します",
      "format": "int64"
    },
    "pages_in_queue": {
      "type": [
        "integer",
        "null"
      ],
      "description": "現在クロールキューにあるページ数",
      "format": "int64"
    },
    "pages_crawled": {
      "type": [
        "integer",
        "null"
      ],
      "description": "クロール済みのページ数",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_LastModified

`#/components/schemas/Response36Afe1097B20_LastModified`

```json
{
  "type": "object",
  "properties": {
    "header": {
      "type": [
        "string",
        "null"
      ],
      "description": "ヘッダーが最後に変更された日時\nUTC 形式：「yyyy-mm-dd hh-mm-ss +00:00」\n例：\n2019-11-15 12:57:46 +00:00\nデータがない場合、値は null になります"
    },
    "sitemap": {
      "type": [
        "string",
        "null"
      ],
      "description": "サイトマップが最後に変更された日時\nUTC 形式：「yyyy-mm-dd hh-mm-ss +00:00」\n例：\n2019-11-15 12:57:46 +00:00\nデータがない場合、値は null になります"
    },
    "meta_tag": {
      "type": [
        "string",
        "null"
      ],
      "description": "meta タグが最後に変更された日時\nUTC 形式：「yyyy-mm-dd hh-mm-ss +00:00」\n例：\n2019-11-15 12:57:46 +00:00\nデータがない場合、値は null になります"
    }
  }
}
```

### Response36Afe1097B20_OnPageResourceIssueInfo

`#/components/schemas/Response36Afe1097B20_OnPageResourceIssueInfo`

```json
{
  "type": "object",
  "properties": {
    "errors": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_OnPageResourceIssueItemInfo"
          }
        ]
      },
      "description": "リソースのエラー"
    },
    "warnings": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_OnPageResourceIssueItemInfo"
          }
        ]
      },
      "description": "リソースの警告"
    }
  },
  "description": "リソースのエラーと警告"
}
```

### Response36Afe1097B20_OnPageResourceIssueItemInfo

`#/components/schemas/Response36Afe1097B20_OnPageResourceIssueItemInfo`

```json
{
  "type": "object",
  "properties": {
    "line": {
      "type": [
        "integer",
        "null"
      ],
      "description": "エラーが見つかった行"
    },
    "column": {
      "type": [
        "integer",
        "null"
      ],
      "description": "エラーが見つかった列"
    },
    "message": {
      "type": [
        "string",
        "null"
      ],
      "description": "エラーのテキストメッセージ：HTML エラーの完全なリストはこちらで確認できます"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "一般的なステータスコード。レスポンスコードの完全な一覧はこちらです。注意: 関連する例外やエラー条件を処理するための必要なシステムを設計することを強く推奨します"
    }
  }
}
```

### Response36Afe1097B20_OnPageResourcesResponseInfo

`#/components/schemas/Response36Afe1097B20_OnPageResourcesResponseInfo`

```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_OnPageResourcesTaskInfo"
              }
            ]
          },
          "description": "<em>タスクの配列</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_OnPageResourcesResultInfo

`#/components/schemas/Response36Afe1097B20_OnPageResourcesResultInfo`

```json
{
  "type": "object",
  "properties": {
    "crawl_progress": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>クロールセッションのステータス</em><br>可能な値：<code>in_progress</code>、<code>finished</code>"
    },
    "crawl_status": {
      "type": [
        "object",
        "null"
      ],
      "oneOf": [
        {
          "$ref": "#/components/schemas/Response36Afe1097B20_CrawlStatusInfo"
        }
      ],
      "description": "<em>クロールセッションの詳細</em>"
    },
    "search_after_token": {
      "type": [
        "string",
        "null"
      ]
    },
    "current_offset": {
      "type": [
        "integer",
        "null"
      ]
    },
    "total_items_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>クロールされた関連項目の総数</em>",
      "format": "int64"
    },
    "items_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>結果配列内の項目数</em>",
      "format": "int64"
    },
    "items": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_BaseOnPageResourceItem"
          }
        ]
      },
      "description": "<em>項目の配列</em>"
    }
  }
}
```

### Response36Afe1097B20_OnPageResourcesTaskInfo

`#/components/schemas/Response36Afe1097B20_OnPageResourcesTaskInfo`

```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_OnPageResourcesResultInfo"
              }
            ]
          },
          "description": "<em>結果の配列</em>"
        }
      }
    }
  ]
}
```
