Extract structured JSON from any web page with AlterLab using a JSON schema. Use when the user wants specific fields (prices, titles, listings, contacts) rather than the full page text. Works on JavaScript-heavy and protected pages. Do not use it when the full page text is enough (use alterlab-scrape).
Ships in alterlab-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Do not use when:
alterlab-scrape).Set your API key in the ALTERLAB_API_KEY environment variable. Never paste the key into code, commands, or files you commit. Create a key at https://alterlab.io/dashboard.
No key yet? POST https://api.alterlab.io/api/v1/agent/trial returns a free trial key with no signup (50 requests, 24 hours). Every response from a trial key then carries a claim link in the X-AlterLab-Claim-URL header, and the trial errors repeat it. Give that link to your human: they sign in or sign up, and the same key becomes theirs and keeps working with no reconfiguration. A free account comes with up to 5,000 free requests.
export ALTERLAB_API_KEY="..." # set in your shell, not in the repo
import os
from alterlab import AlterLabSync
client = AlterLabSync(api_key=os.environ["ALTERLAB_API_KEY"])
result = client.scrape(
"https://example.com",
extraction_schema={"type": "object", "properties": {"title": {"type": "string"}, "price": {"type": "string"}, "description": {"type": "string"}}},
)
print(result["filtered_content"]) # dict matching your schema
import { AlterLab } from "alterlab";
const client = new AlterLab({ apiKey: process.env.ALTERLAB_API_KEY });
const result = await client.scrape({
url: "https://example.com",
extraction_schema: { type: "object", properties: { title: { type: "string" }, price: { type: "string" }, description: { type: "string" } } },
});
console.log(result.filtered_content);
curl -X POST https://api.alterlab.io/api/v1/scrape \
-H "X-API-Key: $ALTERLAB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "extraction_schema": {"type": "object", "properties": {"title": {"type": "string"}, "price": {"type": "string"}, "description": {"type": "string"}}}}'
scripts/extract.py calls the API with the Python standard library only (python3 scripts/extract.py --help).
Hosted MCP tools: alterlab_extract (server https://mcp.alterlab.io/mcp).
Docs: https://alterlab.io/docs - API spec: https://alterlab.io/openapi.json
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/alterlab-skills:alterlab-extractfrom alterlab-skills
npx claudepluginhub rapiercraftstudios/alterlab-skills --plugin alterlab-skills5 skills in this plugin
/alterlab-crawlCrawl a whole website or list its URLs with AlterLab. Use when the user wants every page of a docs site or blog, a sitemap of a domain, or a site-wide content export. Works on JavaScript-heavy and protected sites. Do not use it for one or two known URLs (use alterlab-scrape)./alterlab-monitorWatch a web page for changes with AlterLab monitors and scheduled scrapes. Use when the user asks to be told when a price, page or listing changes, or to re-scrape a URL on a schedule./alterlab-scrapeUse when you have one URL and want its content; for an image use alterlab_screenshot, for 2-20 URLs alterlab_batch_scrape, for a whole site alterlab_crawl. Fetch any URL as clean markdown, text, HTML or JSON with AlterLab, including JavaScript-heavy and protected pages. Also use when the user asks to read, fetch, download or summarize a web page, take a screenshot, or scrape a list of URLs.