Capture PDFs, links, scraped elements, and extracted JSON with /snapshot
changelog / Other / Browser Run / 2026/11/19 09:00 JST
CloudflareのBrowser Runの/snapshotエンドポイントが、1回のページ読み込みでPDF、リンク一覧、スクレイピング結果、AIによる構造化JSONの4形式も返せるようになった。従来はHTMLやスクリーンショットなどに限られ、PDFや構造化データが要る場合はページを読み直す必要があった。1回の読み込みで済むため、処理時間とコストの両方が抑えられ、ページ監視や情報収集、ドキュメント自動生成といった用途で使い勝手が大きく上がる。
出典サイトで原文を開く → 出典サイトの説明: Browser Run
Browser Run ‘s /snapshot endpoint can now return four more formats from a single page load: pdf , links , scrape , and json . Before, /snapshot returned HTML, screenshots, Markdown, and the accessibility tree, so a workflow that also needed a PDF or structured data had to prepare the same page again in a second request. Use the new formats when you need to: PDF : print the page, with the same pdfOptions as the /pdf endpoint. Links : collect the links on the page, with the same visibleLinksOnly and excludeExternalLinks options as /links . Scraped elements : return the elements matched by elements , the same payload as /scrape . elements is required when you request it. Extracted JSON : extract structured data from the page HTML with Workers AI , with the same prompt , response_format , and custom_ai fields as /json . prompt or response_format is required, and the request incurs Workers AI usage. Request them through formats , the same way as the existing formats. This example returns a PDF, the page links, and the text of each paragraph: const response = await env. BROWSER . quickAction ( “snapshot” , { url: “https://example.com/” , formats: [ “pdf” , “links” , “scrape” ], elements:
出典: 公式ページ