# QuanticData API in Python: Scrape, SERP, Map

> Working Python examples for every QuanticData endpoint: scrape to Markdown, SERP as JSON, map and crawl a site, batch URLs, SEO audit, collectors and proxies.

[Home](https://quanticdata.io/)/[Docs](https://quanticdata.io/docs/)/Python

# QuanticData API in Python

Every endpoint of the web data API with a working Python example: scrape, search, map, crawl, batch, SEO audit, collectors and proxy generation. One host, one Bearer key, one JSON envelope. Also in: [Node.js](https://quanticdata.io/docs/node/) · [cURL](https://quanticdata.io/docs/curl/) · [PHP](https://quanticdata.io/docs/php/).

By [Aldo Morese](https://quanticdata.io/about/), founder of QuanticData · Published Aug 21, 2026 · Updated Sep 3, 2026

The whole Python path in one picture: install, one authenticated POST to /v1/scrape, and the envelope that comes back — payload with the Markdown, and usage.cost_usd saying the call cost $0.0002. The strip along the bottom is every failure you can get, and none of them is billed.

## Setup

```
pip install requests   # or: pip install quanticdata (official SDK)
```

Get a key at [app.quanticdata.io/register](https://app.quanticdata.io/register): no card, keys start with `qd_live_`, and every account has $2 of credit a month. Base URL `https://api.quanticdata.io/v1`, header `Authorization: Bearer qd_live_…`. The full parameter reference is the [API reference](https://quanticdata.io/docs/) and the [OpenAPI file](https://quanticdata.io/docs/openapi.yaml); this page is the Python path through it.

## The envelope

Every data call answers with the same shape: `ok`, `payload` with the result, and `payload.usage` with the cost. Errors come back as `ok: false` with `error.code` and `error.message`, and are not billed.

## Scrape a page

`POST /v1/scrape` · $0.0002 per page

```
import requests

r = requests.post(
    "https://api.quanticdata.io/v1/scrape",
    headers={"Authorization": "Bearer qd_live_YOUR_KEY"},
    json={
      "url": "https://example.com",
      "format": "markdown"
    },
    timeout=120,
)
r.raise_for_status()
data = r.json()
print(data["payload"])
```

payload.content is the Markdown; payload.usage is what the call cost. Add render: true for JavaScript pages ($0.001) or engine: "tls" to refuse escalation.

## Search results

`POST /v1/serp` · $0.0005 per search

```
import requests

r = requests.post(
    "https://api.quanticdata.io/v1/serp",
    headers={"Authorization": "Bearer qd_live_YOUR_KEY"},
    json={
      "query": "best coffee grinder",
      "engine": "google",
      "country": "us"
    },
    timeout=120,
)
r.raise_for_status()
data = r.json()
print(data["payload"])
```

payload.organic is the list of results; ai_overview, people_also_ask and related_searches ride along when Google returns them.

## Map a site

`POST /v1/map` · $0.0005 per site

```
import requests

r = requests.post(
    "https://api.quanticdata.io/v1/map",
    headers={"Authorization": "Bearer qd_live_YOUR_KEY"},
    json={
      "url": "https://example.com",
      "limit": 100
    },
    timeout=120,
)
r.raise_for_status()
data = r.json()
print(data["payload"])
```

Every URL the site exposes through sitemaps and homepage links, with a per-section summary. Use search to filter or group_by: "path" for the tree.

## Crawl a site

`POST /v1/crawl` · $0.0003 per page

```
import requests

r = requests.post(
    "https://api.quanticdata.io/v1/crawl",
    headers={"Authorization": "Bearer qd_live_YOUR_KEY"},
    json={
      "url": "https://example.com",
      "limit": 50,
      "depth": 3,
      "format": "markdown"
    },
    timeout=120,
)
r.raise_for_status()
data = r.json()
print(data["payload"])
```

Async. The response carries a jobId; poll GET /v1/crawl/{jobId} until status is done. Pages not fetched are refunded.

## Batch of URLs

`POST /v1/batch` · $0.0002 per URL

```
import requests

r = requests.post(
    "https://api.quanticdata.io/v1/batch",
    headers={"Authorization": "Bearer qd_live_YOUR_KEY"},
    json={
      "urls": [
        "https://example.com/a",
        "https://example.com/b"
      ],
      "format": "markdown",
      "concurrency": 5
    },
    timeout=120,
)
r.raise_for_status()
data = r.json()
print(data["payload"])
```

Up to 1,000 URLs per job, async; poll GET /v1/batch/{jobId} or pass a webhook URL.

## SEO audit

`POST /v1/seo-audit` · $0.0012 per URL

```
import requests

r = requests.post(
    "https://api.quanticdata.io/v1/seo-audit",
    headers={"Authorization": "Bearer qd_live_YOUR_KEY"},
    json={
      "url": "https://example.com"
    },
    timeout=120,
)
r.raise_for_status()
data = r.json()
print(data["payload"])
```

Fetches the URL as a plain HTTP client and as a rendered browser, and returns both views plus the diff: title, description, canonical, h1, word count, JS-only content.

## Run a collector

`POST /v1/scraper/collectors/google_maps_places/run` · from $0.0005 per result

```
import requests

r = requests.post(
    "https://api.quanticdata.io/v1/scraper/collectors/google_maps_places/run",
    headers={"Authorization": "Bearer qd_live_YOUR_KEY"},
    json={
      "query": "pizza restaurants",
      "location": "Brooklyn, NY",
      "country": "us",
      "max_results": 20
    },
    timeout=120,
)
r.raise_for_status()
data = r.json()
print(data["payload"])
```

Collectors take a semantic input, never a URL. A 200 is a finished run; a 202 is async, poll GET /v1/scraper/collectors/runs/{runId}. Billed per delivered row.

## Generate proxy strings

`POST /v1/public/proxies/generate` · no charge; bandwidth is billed by the plan

```
import requests

r = requests.post(
    "https://api.quanticdata.io/v1/public/proxies/generate",
    headers={"Authorization": "Bearer qd_live_YOUR_KEY"},
    json={
      "orderId": "your_order_id",
      "protocol": "http",
      "format": "user:pass@host:port",
      "quantity": 10,
      "country": "us",
      "rotation": "rotating"
    },
    timeout=120,
)
r.raise_for_status()
data = r.json()
print(data["payload"])
```

GET /v1/public/proxies lists your plans and their orderId. The generator returns ready-to-use endpoint strings for a country, state or city.

## Errors you will see

- **401** — missing or wrong key. Keys are case-sensitive and start with `qd_live_`.

- **402** — credit exhausted on pay-as-you-go; add a payment method or wait for the monthly $2.

- **422** — the body did not validate: the message names the field.

- **429** — account rate limit; honour `Retry-After`.

- **ok: false** with a 200 — the target could not be fetched (blocked, timed out, gone). Not billed; the error code says which.

Prices for every unit are on the [pricing page](https://quanticdata.io/pricing/). Agents can skip the HTTP layer entirely with the [MCP server](https://quanticdata.io/mcp-server/), which exposes the same calls as tools.

## Guides for Python developers

Longer walkthroughs from the blog that use the same key and gateway:

- [How to Use a Proxy with Python Requests](https://quanticdata.io/blog/how-to-use-a-proxy-with-python-requests/)

- [How to Rotate Proxies in Python](https://quanticdata.io/blog/how-to-rotate-proxies-python/)

- [How to Rotate Proxy in Selenium Python](https://quanticdata.io/blog/how-to-rotate-proxy-in-selenium-python/)

- [How to Use scrapy-playwright](https://quanticdata.io/blog/how-to-use-scrapy-playwright/)

- [Playwright Stealth in Python](https://quanticdata.io/blog/playwright-stealth-in-python/)

- [How to Use undetected-chromedriver](https://quanticdata.io/blog/how-to-use-undetected-chromedriver/)

- [How to Web Scrape Using Python](https://quanticdata.io/blog/how-to-web-scraping-using-python/)

## Questions about the API in Python

### Do I need an SDK to use the API from Python?

No. Every endpoint is plain JSON over HTTPS, and the examples on this page use only requests. The official `quanticdata` package on PyPI wraps the same calls with typed helpers and a LangChain integration if you prefer.

### How do I know what a call cost?

Every response carries `payload.usage` with `cost_usd`, the part covered by free credit and the part charged. Failed calls return an error envelope and cost nothing.

### What happens on rate limits?

Pay-as-you-go accounts have 60 requests per minute, Starter 300, Growth 600, Scale 1,200. Above that the API answers 429 with a Retry-After header; back off and retry, exactly as you would with any target.

### Can I get the response as JSON instead of Markdown?

Yes. `format` accepts markdown, html, text or raw, and `extract` takes CSS selectors or a JSON schema with an AI prompt to return structured fields under `payload.data`.

## Run the Python examples now

A free key takes a minute, and the $2 of monthly credit covers about 10,000 scraped pages.

[Get my free API key](https://app.quanticdata.io/register)

Free key, $2 of usage credit every month, no credit card.

## Also on this site

Quantic**Data**

Residential proxies & web data APIs for AI.

#### Proxies

- [Residential Basic](https://quanticdata.io/residential-proxies/#basic)

- [Residential Premium](https://quanticdata.io/residential-proxies/#plans)

- [Cheap Residential](https://quanticdata.io/cheap-residential-proxies/)

- [Mobile Proxies](https://quanticdata.io/mobile-proxies/)

- [Datacenter Proxies](https://quanticdata.io/datacenter-proxies/)

- [ISP Proxies](https://quanticdata.io/isp-proxies/)

- [Rotating Proxies](https://quanticdata.io/rotating-proxies/)

- [Sneaker Proxies](https://quanticdata.io/sneaker-proxies/)

- [SOCKS5 Proxies](https://quanticdata.io/socks5-proxies/)

- [IPv6 Proxies](https://quanticdata.io/ipv6-proxies/)

- [Proxy locations](https://quanticdata.io/proxies/)

#### Data APIs

- [MCP Server](https://quanticdata.io/mcp-server/)

- [Web Scraper API](https://quanticdata.io/web-scraping-api/)

- [SERP API](https://quanticdata.io/serp-api/)

- [Collectors](https://quanticdata.io/collectors/)

- [Web Data for AI](https://quanticdata.io/web-data-api-for-ai/)

- [Quantic AI](https://quanticdata.io/ai-web-scraping-service/)

- [Crawl & Map](https://quanticdata.io/crawl-map/)

- [SEO Audit](https://quanticdata.io/seo-audit/)

#### Use cases

- [Company data](https://quanticdata.io/scrape-company-data/)

- [Price monitoring](https://quanticdata.io/competitor-price-monitoring/)

- [Market research](https://quanticdata.io/market-research-data/)

- [Real estate data](https://quanticdata.io/real-estate-data-scraping/)

- [Scrape job postings](https://quanticdata.io/scrape-job-postings/)

#### Company

- [Documentation](https://quanticdata.io/docs/)

- [Blog](https://quanticdata.io/blog/)

- [Free tools](https://quanticdata.io/tools/)

- [Partners](https://quanticdata.io/partners/)

- [About](https://quanticdata.io/about/)

- [Alternatives](https://quanticdata.io/alternatives/)

- [Pricing](https://quanticdata.io/pricing/)

- [FAQ](https://quanticdata.io/#faq)

- [For AI agents](https://quanticdata.io/#ai)

#### Free tools

- [All tools](https://quanticdata.io/tools/)

- [Website to Markdown](https://quanticdata.io/tools/website-to-markdown/)

- [PDF to Markdown](https://quanticdata.io/tools/pdf-to-markdown/)

- [WAF detector](https://quanticdata.io/tools/waf-detector/)

- [AI visibility audit](https://quanticdata.io/tools/ai-visibility-audit/)

- [AI crawler checker](https://quanticdata.io/tools/ai-crawler-checker/)

- [robots.txt tester](https://quanticdata.io/tools/robots-txt-tester/)

- [robots.txt generator](https://quanticdata.io/tools/robots-txt-generator/)

- [User agent](https://quanticdata.io/tools/user-agent/)

- [cURL converter](https://quanticdata.io/tools/curl-converter/)

- [Proxy tester](https://quanticdata.io/tools/proxy-tester/)

© 2026 QuanticData ·

- [quanticdata.io](https://quanticdata.io/)

·

- [Terms](https://quanticdata.io/terms/)

·

- [Privacy](https://quanticdata.io/privacy/)

If you are an AI agent:

- [llms.txt](https://quanticdata.io/llms.txt)

·

- [llms-full.txt](https://quanticdata.io/llms-full.txt)

---

Source: https://quanticdata.io/docs/python/ · Site index for AI: https://quanticdata.io/llms.txt · Full dump: https://quanticdata.io/llms-full.txt
