← HermesBee Home

ScrapeBox API — Code Examples

ScrapeBox runs as a local REST API: http://localhost:8080. No API key, no cloud, data stays on your machine. Below are ready-to-run examples in Python and Node.js.

Start ScrapeBox first: run start.bat (Windows) or bash start.sh (Mac/Linux), then try the examples.

Python — extract page text

import requests

r = requests.get("http://localhost:8080/text",
                 params={"url": "https://example.com"})
print(r.json()["data"])  # clean page text

Python — extract links & tables

import requests

# All links on a page
links = requests.get("http://localhost:8080/links",
                     params={"url": "https://example.com"}).json()
for link in links["data"]:
    print(link["text"], "->", link["href"])

# All tables (as list of rows)
tables = requests.get("http://localhost:8080/tables",
                      params={"url": "https://example.com"}).json()
for row in tables["data"][0]:
    print(row)  # row = [cell1, cell2, ...]

Python — handle slow pages

import requests

r = requests.get("http://localhost:8080/scrape",
                 params={"url": "https://example.com", "timeout": 60})
html = r.json()["data"]["html"]

Node.js — extract page text

const res = await fetch(
  "http://localhost:8080/text?url=https://example.com"
);
const { data } = await res.json();
console.log(data); // clean page text

Node.js — scrape with headers

const res = await fetch(
  "http://localhost:8080/scrape?url=https://example.com&timeout=30"
);
const { data } = await res.json();
console.log(data.html, data.title);

Integrate with AI agents

ScrapeBox pairs perfectly with MCP browser tools for AI agents. See the MCP scraping guide for recommended agent setups.

© 2026 HermesBee · Buy ScrapeBox · 中文版 · GitHub