Skip to content

Instantly share code, notes, and snippets.

@quantumproxies
quantumproxies / qd_playwright_proxy.py
Created August 21, 2026 12:42
Playwright per-context proxies in Python — one browser, many countries https://quanticdata.io/blog/how-to-use-playwright-for-scraping/
"""One Playwright browser, a different country per context.
pip install playwright && playwright install chromium
export QD_PROXY_USER=... QD_PROXY_PASS=...
python3 qd_playwright_proxy.py
Two things worth knowing:
1. Setting the proxy on the CONTEXT rather than the browser means one browser process
can hold several exits at once. Launching a browser per country is the expensive
@quantumproxies
quantumproxies / qd-proxy.mjs
Created August 21, 2026 12:42
Proxies in Node.js 18+ — native fetch ignores HTTP_PROXY, you need a dispatcher https://quanticdata.io/blog/how-to-use-a-proxy-in-nodejs/
/**
* Proxies in Node.js 18+, and the reason most people's first attempt does nothing.
*
* Node's built-in fetch IGNORES the HTTP_PROXY / HTTPS_PROXY environment variables.
* Setting them changes nothing. You must pass an undici dispatcher explicitly.
*
* npm i undici
* QD_PROXY_USER=... QD_PROXY_PASS=... node qd-proxy.mjs
*
* https://quanticdata.io/residential-proxies/
@quantumproxies
quantumproxies / qd_proxy_requests.py
Created August 21, 2026 12:42
Rotating and sticky proxies with Python requests — the username carries the targeting https://quanticdata.io/blog/how-to-use-a-proxy-with-python-requests/
"""Rotating vs sticky proxies with Python requests, and how to prove which you got.
pip install requests
export QD_PROXY_USER=... QD_PROXY_PASS=...
python3 qd_proxy_requests.py
Targeting lives in the USERNAME — no custom headers, no extra API call:
USER-country-us rotating US exit
USER-country-de-city-berlin city-level
@quantumproxies
quantumproxies / qd_claude_tools.py
Created August 21, 2026 12:42
Give Claude live web access with two tool definitions — QuanticData + the Claude API https://quanticdata.io/blog/how-to-use-claude-api/
"""A Claude tool loop with real web access, in one file.
pip install anthropic requests
export ANTHROPIC_API_KEY=sk-ant-... QD_API_KEY=qd_live_...
python3 qd_claude_tools.py "What changed in the EU AI Act timeline this month?"
Two tools is enough: search to FIND, scrape to READ. A search costs $0.0005 and a page
$0.0002, so a six-source turn is about a thousandth of what the model tokens cost.
https://quanticdata.io/web-data-api-for-ai/ · https://quanticdata.io/blog/how-to-use-claude-api/
@quantumproxies
quantumproxies / README.md
Created August 21, 2026 12:42
MCP config for Claude Code, Claude Desktop and Cursor — give your agent live web access https://quanticdata.io/blog/how-to-use-mcp-in-cursor/

QuanticData MCP — client configuration

Give Claude Code, Claude Desktop, Cursor or any MCP client live web access: scrape a page, run a search, map or crawl a site, audit a URL, and run 31 ready-made collectors.

Server (single file, zero dependencies): quanticdata-mcp-server · product page: quanticdata.io/mcp-server

@quantumproxies
quantumproxies / qd_chunks.py
Created August 21, 2026 12:42
Web page to RAG-ready chunks with heading paths and provenance — QuanticData for LLMs https://quanticdata.io/blog/how-to-create-an-llm-dataset/
"""One URL -> JSONL chunks ready for an embedding index.
pip install requests
export QD_API_KEY=qd_live_...
python3 qd_chunks.py https://quanticdata.io/docs/ > chunks.jsonl
Three things most corpus builders skip, and all three cost you at retrieval time:
heading_path a chunk saying "rotate it every 90 days" is useless alone and
unambiguous under Docs > Authentication > API keys
@quantumproxies
quantumproxies / qd_map.py
Created August 21, 2026 12:42
Every URL of any website in one call, flat $0.0005 — QuanticData Map API https://quanticdata.io/crawl-map/
"""Every URL a site's sitemaps and homepage know about — one call, one flat price.
pip install requests
export QD_API_KEY=qd_live_...
python3 qd_map.py https://quanticdata.io # section histogram + urls.txt
python3 qd_map.py https://quanticdata.io /blog/ # only URLs containing /blog/
$0.0005 whatever the site's size. `total` and `summary` describe the WHOLE site even
when `links` is capped, so you can size a crawl before you pay for one.
https://quanticdata.io/crawl-map/
@quantumproxies
quantumproxies / qd_crawl.py
Created August 21, 2026 12:42
Crawl a site to Markdown files with polite polling — QuanticData Crawl API in Python https://quanticdata.io/blog/how-to-web-crawl-python/
"""Crawl a site to one Markdown file per page, polling with backoff.
pip install requests
export QD_API_KEY=qd_live_...
python3 qd_crawl.py https://quanticdata.io 40 /blog/
$0.0003 a page, and the unfetched share of the budget is refunded when the job settles.
Cheaper alternative for a site you can filter first: POST /v1/map (flat $0.0005, every
URL the sitemaps know) then POST /v1/batch on exactly the URLs you want.
https://quanticdata.io/crawl-map/ · https://quanticdata.io/blog/how-to-web-crawl-python/
@quantumproxies
quantumproxies / qd-seo-audit.sh
Created August 21, 2026 12:42
Is your page indexable without JavaScript? One curl answers it — QuanticData SEO Audit API https://quanticdata.io/blog/how-to-perform-an-seo-audit/
#!/usr/bin/env bash
# Fetch a URL twice — as a no-JS bot and fully rendered — and show the difference.
# That diff is invisible in a browser: your eyes always see the rendered view.
#
# export QD_API_KEY=qd_live_...
# ./qd-seo-audit.sh https://example.com
#
# Needs curl and jq. $0.0012 a URL. https://quanticdata.io/seo-audit/
# Guide: https://quanticdata.io/blog/how-to-perform-an-seo-audit/
set -euo pipefail
@quantumproxies
quantumproxies / qd_price_watch.py
Created August 21, 2026 12:41
Amazon price watcher in 40 lines — ASINs to a CSV history with movers, QuanticData collectors https://quanticdata.io/blog/how-to-price-watch-on-amazon/
"""Append today's Amazon prices to a CSV and print what moved since last run.
pip install requests
export QD_API_KEY=qd_live_...
python3 qd_price_watch.py B09XS7JWHH B09HM94VDS us
The CSV is the whole database. Run it from cron; `price_value` is the numeric field
(`price` keeps Amazon's formatting, which differs per marketplace).
$0.003 per product. https://quanticdata.io/collectors/amazon-product-api/
Guide: https://quanticdata.io/blog/how-to-price-watch-on-amazon/