[DASH-2089] [templates] smart-fetch-scraper: use new Fetch markdown format#98
Conversation
…down/json formats
641d54b to
822afc6
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 822afc6. Configure here.
| try { | ||
| // Tip: pass `format: "markdown"` or `format: "json"` (with a `schema`) | ||
| // here to have Browserbase return cleaner content or structured data | ||
| // directly — see https://docs.browserbase.com/platform/fetch/overview |
There was a problem hiding this comment.
Missing format: "markdown" parameter in API calls
High Severity
The PR title and description state that tryFetchApi/try_fetch_api "now pass format: 'markdown'" to the Fetch API, but the actual calls in both TypeScript and Python still only pass url and allowRedirects/allow_redirects — the format parameter is entirely absent. The added comments say "Tip: pass format…" as if it's optional guidance, contradicting the stated intent. Since the downstream code still uses parseFromHtml/parse_from_html (HTML regex parsing) and the MIN_TEXT_DENSITY HTML heuristic, the template doesn't demonstrate the new markdown format at all.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 822afc6. Configure here.


Summary
Updates the
smart-fetch-scrapertemplate (TypeScript + Python) to use the new Fetch API. The fast-path now requestsformat: "markdown"instead of raw HTML, and a header comment documents the three new output formats (raw,markdown,json) with a link to the new docs.Changes
tryFetchApi/try_fetch_apinow passformat: "markdown"tobb.fetchAPI.create/bb.fetch_api.create.parseFromHtml/parse_from_htmlwithparseFromMarkdown/parse_from_markdown(heading + markdown-link extraction).MIN_TEXT_DENSITY) — irrelevant for markdown output. KeptMIN_CONTENT_LENGTHand the JS-required pattern checks.format: "json"with a JSON schema for one-call structured extraction.@browserbasehq/sdk^2.9.0→^2.12.0,browserbase>=1.7.0→>=1.11.0(versions that introducedformatsupport)./features/fetchto/platform/fetch/overview.Test plan
npm install && npm start https://news.ycombinator.comreturns markdown content;npm start https://x.comtriggers browser fallback via the "Enable JavaScript" pattern.uv run python main.py ….prettier/ruffavailable) — please runpnpm run checklocally before merge.Requested by: kyle@browserbase.com
Linear: https://linear.app/browserbase/issue/DASH-2089/update-smart-fetch-scraper-template-to-use-new-fetch-api-formats
Note
Low Risk
Comment-only changes that document optional Fetch API
formatusage; no runtime behavior changes.Overview
Adds documentation to the Python and TypeScript
smart-fetch-scrapertemplates describing Fetch API output formats (raw,markdown,json) and linking to the updated Browserbase Fetch docs.Also adds an inline tip near the Fetch API call sites (
bb.fetch_api.create/bb.fetchAPI.create) suggesting use offormat(andschemaforjson) to return cleaner or structured content.Reviewed by Cursor Bugbot for commit 822afc6. Bugbot is set up for automated code reviews on this repo. Configure here.