Saffron Browser developer surface
Capture a page as Markdown, save a screenshot and check your account balance over HTTPS. Start with a capture of this guide, or try a catalog export without a key.
01Your first capture
Grab a free key from the homepage (1,000 trial credits, no card). Save the cURL, Python, or TypeScript example and pipe your key from your secret manager to its standard input. The cURL example requires version 8.3 or later. Look for “Saffron Browser developer surface” in the returned Markdown.
curl --fail-with-body --silent --show-error \
--variable key@- --expand-header 'Authorization: Bearer {{key:trim}}' \
--json '{"url":"https://saffronbrowser.dev/","format":"markdown"}' \
https://api.saffronbrowser.com/v1/scrapeimport json
import sys
from urllib.request import Request, urlopen
key = sys.stdin.read().strip()
if not key:
raise SystemExit("Supply your key on standard input.")
request = Request(
"https://api.saffronbrowser.com/v1/scrape",
data=json.dumps({"url": "https://saffronbrowser.dev/", "format": "markdown"}).encode(),
headers={"Authorization": "Bearer " + key, "Content-Type": "application/json"},
)
with urlopen(request, timeout=75) as response:
print(json.load(response)["markdown"])import { readFileSync } from "node:fs";
const key = readFileSync(0, "utf8").trim();
if (!key) throw new Error("Supply your key on standard input.");
const response = await fetch("https://api.saffronbrowser.com/v1/scrape", {
method: "POST",
headers: { Authorization: "Bearer " + key, "Content-Type": "application/json" },
body: JSON.stringify({ url: "https://saffronbrowser.dev/", format: "markdown" }),
});
if (!response.ok) throw new Error("Saffron returned HTTP " + response.status);
console.log((await response.json()).markdown);Capture a URL list
Download the Node.js client. Put one authorized URL per line in urls.txt and supply SAFFRON_API_KEY through your environment. With Node.js 22 or newer, run this from the download folder.
node scrape-list.mjs --timeout 90 \ --output results.jsonl urls.txt
The client writes one result per input line. The default deadline is 65 seconds per URL. This example allows 90 seconds for a busy gateway, with the same three-credit limit per distinct Markdown capture. For a gateway capacity refusal, it waits for Retry-After plus jitter and reuses the same job key, up to eight attempts within the target deadline. A receipt_only row gives the operation ID and billing status for an earlier settlement. Its Markdown stays in the original result. Run node scrape-list.mjs --check urls.txt for a free local preview. The default budget is 25 credits. The client refuses a list that could exceed your budget. A settled receipt includes the actual debit when available. If a result says check_usage or a request times out, check your account before repeating it.
Export a product table
Download the offline catalog example (11 KB ZIP) to try two saved captures without an account or API credits. Unzip it, open the Saffron-Catalog-Drill folder in a terminal and run this with Python 3.9 or later.
python3 run_demo.py
The demo writes seven products to products.json and prints its location. Look for the Atlas & Finch lamp, SKU 00017, at USD 12.40. The second capture has a table that is still loading. The extractor reports TABLE_BUSY and the demo checks that your file stayed byte-for-byte identical.
Capture a live catalog
To capture the seven-product example yourself, get a free developer key and set SAFFRON_API_KEY in your environment. A fresh hosted capture uses account credits. Download the Python extractor and expected product IDs into a new folder and run the commands there.
printf 'Authorization: Bearer %s\n' "$SAFFRON_API_KEY" | curl -fsS --header @- \
--header 'Content-Type: application/json' \
--data '{"url":"https://saffronbrowser.dev/saffron-catalog-example.html","engine":"chromium","proxy":"direct"}' \
--output capture.json https://api.saffronbrowser.com/v1/scrape
python3 -I saffron-catalog.py --input capture.json \ --expected-ids catalog-ids.json --output products.json
products.json contains seven product IDs, names and prices with explicit currency and integer minor units. You can run the extractor again on the saved capture for free.
For your own authorized page, use a single HTML table with id="catalog" and the headings SKU, Name, Price and Currency. Supply your expected IDs to catch missing or extra rows. A loading table or invalid price exits 2 and preserves the last good export. Use --help for different headings. Paginated tables need a complete captured roster.
02Bring an existing integration
For a Firecrawl HTTP integration that uses one page of Markdown, send the URL to POST /v1/scrape with the Saffron request shown below. Set format to markdown and read markdown at the top level of the JSON response. Check the page status before saving its content. Firecrawl response format.
If your Steel integration opens a DevTools websocket with Playwright or Puppeteer, it requires a different connection contract. This public quickstart supports HTTP capture. Keep your current CDP integration in place while evaluating the capture output on a page you control.
03Check your credits
Send GET /v1/billing/usage with the same authorization header. Read credits_balance for your balance and recentActivity for recent requests and their recorded credit costs. Under weighted billing, a native fetch costs one credit when available, rendered DOM extraction costs two and an isolated browser capture costs three. Earlier direct captures can show one credit. Your account records the actual charge. See credit rates and billing terms. Usage lookups are free. On HTTP 429, follow Retry-After when supplied.
A missing or invalid key returns HTTP 401. A depleted balance returns HTTP 402 for a new capture. You can still check your balance. If the service returns HTTP 429, wait for the delay in Retry-After before retrying.
04Authentication
Pass your Saffron key on every request. Use one of these authorization headers.
Authorization: Bearer sb_live_your_keyx-steel-key: sb_live_your_keyx-grid-key: sb_live_your_keyStore your key in a secret manager and send it in a request header. A scrape response can include the target page’s status inside a successful Saffron response. Check both before accepting the content.
05API reference
Render a page and read its Markdown from the JSON response. The top-level status field records the target page’s HTTP status.
Request
{
"url": "https://saffronbrowser.dev/",
"format": "markdown"
}{
"ok": true,
"url": "https://saffronbrowser.dev/",
"status": 200,
"engine": "chromium",
"markdown": "# Saffron Browser developer surface…"
}Send a JSON object with url. Set fullPage to true for the full page. A successful response contains PNG bytes with the content type image/png. Save the response body directly to a file.