メインコンテンツへスキップ
POST
/
v1
/
crawls
新しいクローラーを開始
curl --request POST \
  --url https://api.olostep.com/v1/crawls \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "start_url": "<string>",
  "max_pages": 123,
  "include_urls": [
    "<string>"
  ],
  "exclude_urls": [
    "<string>"
  ],
  "max_depth": 123,
  "include_external": true,
  "include_subdomain": true,
  "search_query": "<string>",
  "top_n": 123,
  "webhook": "<string>",
  "timeout": 123,
  "follow_robots_txt": true,
  "scrape_options": {
    "formats": [
      "markdown",
      "screenshot"
    ],
    "parser": "@olostep/extract-emails"
  }
}
'
{
  "id": "<string>",
  "object": "<string>",
  "status": "<string>",
  "created": 123,
  "start_date": "<string>",
  "start_url": "<string>",
  "max_pages": 123,
  "max_depth": 123,
  "exclude_urls": [
    "<string>"
  ],
  "include_urls": [
    "<string>"
  ],
  "include_external": true,
  "search_query": "<string>",
  "top_n": 123,
  "current_depth": 123,
  "pages_count": 123,
  "webhook": "<string>",
  "follow_robots_txt": true
}
完了時に通知を受け取る: クロールが完了した際にHTTP POSTを受け取るために、webhook パラメータとあなたのエンドポイントURLを渡してください。詳細はWebhooksを参照してください。

承認

Authorization
string
header
必須

Bearer認証ヘッダーの形式はBearer で、はあなたの認証トークンです。

ボディ

application/json
start_url
string
必須

クローラーの開始地点。

max_pages
number
必須

クロールするページの最大数。ウェブサイト全体をクロールするようなほとんどのユースケースに推奨されます。

include_urls
string[]

glob構文を使用してクローラーに含めるURLパスパターン。 デフォルトは/**で、すべてのURLを含みます。特定のセクションをクロールするには、/blog/**のようなパターンを使用します(例:ブログページのみ)、/products/*.htmlは商品ページ用、または異なるセクションのために複数のパターンを使用します。*(任意の文字)や**(再帰的なマッチング)などの標準的なglob機能をサポートしています。

exclude_urls
string[]

除外するglobパターンのURLパス名。例:/careers/**。除外されたURLは、含まれるURLよりも優先されます。

max_depth
number

クロールの最大深度。n次のリンクまでのみ抽出するのに便利です。

include_external
boolean

一次外部リンクをクロールします。

include_subdomain
boolean

ウェブサイトのサブドメインを含めます。デフォルトはfalseです。

search_query
string

特定のリンクを見つけるためのオプションの検索クエリで、結果を関連性でソートします。

top_n
number

検索クエリに従って、各ページで最も関連性の高いリンクのトップNのみをクロールするためのオプションの数。

webhook
string<uri>

クロールが完了したときにPOSTリクエストを受け取るためのHTTPS URL。http://またはhttps://プロトコルを使用して公開アクセス可能なURLでなければなりません。localhostやプライベートIPアドレスを指すことはできません。ペイロード形式と再試行の動作についてはWebhooksを参照してください。

timeout
number

指定されたタイムアウトから約10秒余分にかかることがありますが、n秒後にクロールを終了し、それまでに完了したページを取得します。

follow_robots_txt
boolean
デフォルト:true

robots.txtルールを尊重するかどうか。falseに設定すると、クローラーはrobots.txtの禁止指令に関係なくウェブサイトをスクレイプします。デフォルトはtrueです。

scrape_options
object

Olostep APIから各個別ページのスクレイプリクエストを制御します。すべてのフィールドはオプションです。

レスポンス

クロールが正常に開始されました。

id
string

クロールID

object
string

オブジェクトの種類。このエンドポイントでは "crawl"。

status
string

in_progress または completed

created
number

エポックでの作成時間

start_date
string

日付での作成時間

start_url
string
max_pages
number
max_depth
number
exclude_urls
string[]
include_urls
string[]
include_external
boolean
search_query
string
top_n
number
current_depth
number

クロールプロセスの現在の深さ。

pages_count
number

クロールされたページの数

webhook
string
follow_robots_txt
boolean