---
title: "Building a shot-scraper-style JSON API on Bun 1.4's New Bun.WebView"
source: "Simon Willison 博客（Atom）"
source_tier: "t2"
url: "https://simonwillison.net/2026/Aug/20/bun-webview-json-api/"
permalink: "https://feed.astralor.com/items/itm_356bdab6beb75ab8ed388067"
published: "2026-08-20T15:37:00.000Z"
score: 76
channel: "tech"
tags: ["Bun","Bun.WebView","Claude Code","shot-scraper","Developer tools","Browser automation"]
---

# Building a shot-scraper-style JSON API on Bun 1.4's New Bun.WebView

## AI commentary

> I think the real value here isn't in listing new features, but in turning 'what Bun.WebView can do' into quantifiable deployment data through hands-on testing. For teams building scraping services or AI agent toolchains, that 192MB-256MB memory estimate is far more useful than any marketing pitch.

## At a glance

Bun 1.4 was released today, marking the first stable version since its Rust rewrite a few months ago. The release notes downplay the rewrite and highlight a wide range of new capabilities, including Bun.WebView, Bun.Image, Bun.markdown, Bun.cron(), and Bun.Terminal, along with 2,900 bug fixes and a significant jump in Node.js compatibility. The author was most intrigued by Bun.WebView, which brings first-class browser automation to Bun via macOS WebKit or by driving a local Chromium through the Chrome DevTools Protocol. To explore this, he used Claude Code for web to build a shot-scraper-style JSON API that loads a web page and executes JavaScript against it. Testing with cgroups shows that a full Chrome instance needs about 192MB-256MB of memory for complex pages, a useful data point for container sizing. The experiment draws on his earlier shot-scraper javascript CLI tool and could make browser automation more accessible within the Bun ecosystem.

## Key points

- Bun 1.4, the first stable release after the Rust rewrite, adds Bun.WebView and many other built-in features.
- The author built a shot-scraper-style JSON API prototype with Claude Code, using WebView to load pages and execute JS.
- Testing shows a full Chrome instance needs about 192MB-256MB RAM for complex pages, a useful reference for container deployment.

## Full text

Research: A shot-scraper-style JSON API on Bun 1.4's new Bun.WebView Today saw the long awaited release of Bun 1.4, the first stable version since the infamous Rust rewrite a few months ago. Interestingly, the Rust rewrite was downplayed in the release notes, which introduced a bewildering array of new features and claimed 2,900 additional bug fixes: Bun 1.4 adds +1,517 tests from the Node.js test suite - our biggest jump in Node.js compatibility since Bun 1.0. Bun v1.4 also fixes over 2,900 issues. It reduces idle CPU usage by 5x, reduces memory usage by up to 35%, and starts 50% faster on Linux. It adds Bun.Image, Bun.WebView, Bun.markdown, Bun.cron(), Bun.Terminal, bun run --parallel, bun test --parallel, bun audit fix, bun dedupe, and bun prune. And it rewrites Bun from Zig to Rust. Of these the one that most caught my eye was Bun.WebView, which adds first class support for browser automation to Bun core using either macOS WebKit or control of a local Chromium process via the Chrome DevTools Protocol (CDP). I had Claude Code for web build a prototype of a web API providing the ability to load a web page and then execute JavaScript against it, inspired by my shot-scraper javascript CLI tool - partly to see how much RAM would be needed by such a service. Here's that TypeScript server implementation, which appears to need a 192MB-256MB container to run a full Chrome against complex web pages - tested using cgroups. Tags: browsers, javascript, ai, rust, typescript, generative-ai, llms, coding-agents, bun

---

Verify against the original before citing; curated by Astral Feed: https://feed.astralor.com/items/itm_356bdab6beb75ab8ed388067
