---
title: "AI training data"
description: "Collect AI training data from the web: crawl docs, Q&A sites, news and filings into Markdown JSONL with source URLs for LLM pre-training and fine-tuning."
canonical: https://www.zenrows.com/use-cases/ai-training-data
updated: 2026-10-18
---

# AI training data

AI training data is the text, code or images a model learns from in pre-training or fine-tuning, much of it from public web pages. Zenrows Crawl finds the URLs on each source site and Batch fetches them at volume as clean Markdown, building a corpus with source URL and fetch time on every document.

## Sample output: one corpus record

```json
{
  "id": "sha256:4be1c09a7d3e",
  "url": "https://www.example-standards.org/guides/water-quality-testing",
  "domain": "example-standards.org",
  "fetched_at": "2026-10-17T03:41:56Z",
  "format": "markdown",
  "language": "en",
  "license_note": "CC BY 4.0 per page footer",
  "tokens": 1842,
  "text": "# Water quality testing\n\nSamples should be collected in sterile containers and analysed within 24 hours.\n\n## Field parameters\n\n| Parameter | Method |\n|---|---|\n| pH | Electrode |\n| Turbidity | Nephelometer |"
}
```

Illustrative. Zenrows returns the Markdown `text`; hash id, language, licence note and token count come from your pipeline.

## What AI training data teams collect

Unlike a RAG index, a training corpus holds millions of documents, frozen per version, each with defensible provenance.

| Job | Data you collect | Typical sources |
|---|---|---|
| Domain pre-training corpus | Long-form text in one field | Government publications, standards bodies, university repositories, Wikipedia |
| Instruction and Q&A pairs | Questions with accepted answers | Stack Exchange, product FAQs, documentation |
| Multilingual corpora | Native text per market | National news and public broadcasters, via geotargeting |
| Code and technical text | Docs, READMEs, tutorials, API references | Language docs, GitHub READMEs, developer blogs |
| Domain fine-tuning sets | Product, legal, medical, financial language | Amazon product pages, court opinions, PubMed abstracts, SEC EDGAR filings |
| Fresh evaluation sets | Pages after a model's knowledge cutoff | Recent news, filings, documentation releases |

## Why AI training data collection stalls

Past a few hundred thousand URLs, collection stalls on throughput, then on clean text and provenance.

| What breaks | What it looks like | How Zenrows handles it |
|---|---|---|
| Throughput | A homegrown queue takes weeks of restarts | Batch: one job, per-URL status |
| Blocked sources | DataDome or Cloudflare challenges | Zenrows' stealth gets through Cloudflare, DataDome, Akamai and similar |
| Markup in the text | Navigation, scripts and styles leak into documents | Markdown output, not raw HTML |
| Duplicate URLs | One page under `www`, trailing-slash and tracking variants | Crawl normalizes URLs and drops duplicates |
| Missing provenance | Unknown source or date | Each Batch result keeps its URL and `external_id` |
| Regional content | Different text by country | Geotargeting reads each market's version |

## How to collect AI training data with Zenrows

1. **Define the sources** and record each one's terms and licence first.
2. **Discover the URLs** with Crawl patterns and no output format.
3. **Fetch at volume** in Batch with Markdown and Adaptive Stealth Mode, escalating only when a page needs it.
4. **Dedupe and package**: hash, filter near-duplicates and quality, write JSONL shards with URL and fetch time.

```bash cURL
# Discover article URLs on one source (URLs only, no page content)
curl -X POST "https://api.zenrows.com/v1/crawls" \
  -H "X-API-Key: YOUR_ZENROWS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "START_URL",
    "max_items": 100000,
    "max_pages": 100000,
    "include_patterns": ["/guides/", "/articles/"],
    "exclude_patterns": ["/tag/", "/search", "/print/"]
  }'
```

```python Python
# pip install requests
import hashlib, json, time
from datetime import datetime, timezone
import requests

API = "https://async.api.zenrows.com/v1"
HEADERS = {"X-API-Key": "YOUR_ZENROWS_API_KEY"}

job = requests.post(f"{API}/jobs", headers=HEADERS, timeout=60, json={
    "type": "regular",
    "status": "closed",
    "zenrows_params": {"mode": "auto", "response_type": "markdown"},
    "tasks": [{"url": u, "external_id": str(i)} for i, u in enumerate(SOURCE_URLS)],
}).json()
job_id = job["job_id"]

while True:  # wait for the run to finish
    run = requests.get(f"{API}/jobs/{job_id}", headers=HEADERS, timeout=60).json()["latest_run"]
    if run["status"] in ("completed", "failed", "stopped"):
        break
    time.sleep(30)

seen, params = set(), {"status": "successful"}
with open("corpus-000.jsonl", "a") as shard:
    while True:
        page = requests.get(f"{API}/jobs/{job_id}/results", headers=HEADERS,
                            params=params, timeout=60).json()
        for row in page["results"]:
            text = requests.get(row["result_url"], timeout=60).text
            digest = hashlib.sha256(text.encode()).hexdigest()
            if digest in seen:
                continue  # exact duplicate
            seen.add(digest)
            shard.write(json.dumps({"id": digest, "url": row["url"], "text": text,
                "fetched_at": datetime.now(timezone.utc).isoformat()}) + "\n")
        if not page.get("next_cursor"):
            break
        params["cursor"] = page["next_cursor"]
```

```bash CLI
npx -y @zenrows/cli init
zenrows crawl create START_URL --include-patterns /guides/ --include-patterns /articles/ --max-pages 1000 --follow
zenrows crawl results CRAWL_ID --out urls.jsonl
# keep one {"url": "..."} per line for Batch
zenrows batch create urls.jsonl --output markdown --wait
zenrows batch results JOB_ID --out corpus.jsonl
```

```text Claude Code (MCP)
# Connect once
claude mcp add zenrows -e ZENROWS_API_KEY=YOUR_ZENROWS_API_KEY -- npx -y @zenrows/mcp

# Then ask:
Use Zenrows to crawl the /guides/ section of START_URL, fetch every guide as Markdown, and save one JSONL record per page with the URL, title and text.
```

## Which Zenrows product fits

| If you need to | Use | Why |
|---|---|---|
| List a source site's URLs | [Crawl](/products/crawl) | Follows in-domain links, keeps matching paths, drops duplicates |
| Fetch millions of documents | [Batch](/products/batch) | Whole URL lists as jobs, Markdown, per-URL results |
| Test a source before a full run | [Fetch](/products/fetch) | One request shows what the corpus will get |
| Turn pages into fields for fine-tuning pairs | [Extract](/products/extract) | JSON fields like question and answer, no selectors |

## What success looks like

| Measure | What good looks like | How to check it |
|---|---|---|
| Corpus size | Tokens per source and in total meet the plan | Token sums per shard and domain |
| Fetch success per source | Usable text for nearly every URL | Success and failure counts per Batch run |
| Duplicate rate | No exact duplicates, few near ones | Drops per dedup stage |
| Provenance | URL, fetch time and licence note on every record | Schema-validate shards before training |
| Text quality | Content, not menus, cookie notices or errors | Scored samples or a quality classifier |
| Refresh time | Full re-collection fits your training schedule | Batch run times against the due date |

## AI training data FAQ

### What is AI training data?

What a model learns from: for language models, text and code, in pre-training (broad corpora) and fine-tuning (small task sets like question and answer pairs). Public web pages are among the largest sources, collected with crawlers and scraping APIs, then cleaned.

### Should I buy AI training data or collect it myself?

Provider datasets are fast but shared, on their schedule. Your own collection sets sources, mix and refresh date, with a URL trail per document. Zenrows collects; you own the corpus.

### How do I collect LLM training data from websites?

Crawl discovers each site's URLs; Batch fetches them as Markdown. Store JSONL records with URL and fetch time, then deduplicate, detect language and filter quality before training.

### How do I deduplicate scraped training data?

In layers: Crawl drops duplicate URLs and tracking variants; hashing removes exact copies (see the Python example); a near-duplicate pass like MinHash on shingles catches syndicated articles and boilerplate differing by a date or byline.

### Is it legal to scrape web data for AI training?

It depends on source, jurisdiction and use. Teams keep to public pages, check terms and robots rules, honour licences like Creative Commons attribution, and avoid or redact personal data. Training copyright is unsettled; ask legal first.

### What format should web training data be in?

Usually JSONL, one document per line: Markdown or plain text plus URL, fetch time, language and licence. Markdown keeps headings, lists and tables for chunking and quality scoring; strip it later if your tokenizer prefers.

### How large should an LLM training dataset be?

Pre-training: billions of tokens, breadth first. Fine-tuning: quality first; a few thousand clean, consistent examples often beat a large noisy set. Start small, hold out an evaluation set, add data where it shows gaps.

### Can I collect image data for vision models too?

Yes. Crawl and Batch collect image URLs, alt text and captions; Fetch downloads the files. See computer vision training data .

## Related use cases

- [Computer vision training data](https://www.zenrows.com/use-cases/computer-vision-training-data.md): Labeled image datasets from product pages and galleries, with alt text, captions and a source URL per file.
- [Chatbot training data](https://www.zenrows.com/use-cases/chatbot-training-data.md): Your website, help center and docs as clean Markdown for a chatbot knowledge base, refreshed on schedule.
- [LLM web scraping for RAG and agents](https://www.zenrows.com/use-cases/llm-web-scraping.md): Live pages as Markdown or JSON for RAG pipelines, grounding and agent tool calls.
- [Sentiment analysis data](https://www.zenrows.com/use-cases/sentiment-analysis-data.md): Review text with ratings, forum threads and comments, cleaned and labeled for sentiment and NLP models.
- [News scraping](https://www.zenrows.com/use-cases/news-scraping.md): Full-text articles, headlines, bylines and dates from publishers, Google News and wires, as clean Markdown or JSON.
- [Web scraping for research](https://www.zenrows.com/use-cases/web-scraping-for-research.md): Article metadata, forum posts, statistics and news text collected for studies, with a reproducible fetch log.

Start free: https://app.zenrows.com/register. Docs: https://docs.zenrows.com

## Structured data



<script type="application/ld+json">
{"@context":"https://schema.org","@graph":[{"@type":"WebPage","@id":"https://www.zenrows.com/use-cases/ai-training-data#webpage","url":"https://www.zenrows.com/use-cases/ai-training-data","name":"AI training data","description":"Collect AI training data from the web: crawl docs, Q&A sites, news and filings into Markdown JSONL with source URLs for LLM pre-training and fine-tuning.","isPartOf":{"@id":"https://www.zenrows.com/#website"},"inLanguage":"en","datePublished":"2026-10-18","dateModified":"2026-10-18","about":{"@type":"Thing","name":"ai training data"},"keywords":"ai training data, llm training data, training data for ai, ai training datasets, llm training dataset, data collection for machine learning, web scraping for machine learning, ai training data providers, buy ai training data","publisher":{"@type":"Organization","name":"Zenrows","url":"https://www.zenrows.com/"}},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://www.zenrows.com/"},{"@type":"ListItem","position":2,"name":"Use cases","item":"https://www.zenrows.com/use-cases"},{"@type":"ListItem","position":3,"name":"AI training data","item":"https://www.zenrows.com/use-cases/ai-training-data"}]},{"@type":"FAQPage","@id":"https://www.zenrows.com/use-cases/ai-training-data#faq","mainEntity":[{"@type":"Question","name":"What is AI training data?","acceptedAnswer":{"@type":"Answer","text":"What a model learns from: for language models, text and code, in pre-training (broad corpora) and fine-tuning (small task sets like question and answer pairs). Public web pages are among the largest sources, collected with crawlers and scraping APIs, then cleaned."}},{"@type":"Question","name":"Should I buy AI training data or collect it myself?","acceptedAnswer":{"@type":"Answer","text":"Provider datasets are fast but shared, on their schedule. Your own collection sets sources, mix and refresh date, with a URL trail per document. Zenrows collects; you own the corpus."}},{"@type":"Question","name":"How do I collect LLM training data from websites?","acceptedAnswer":{"@type":"Answer","text":"Crawl discovers each site's URLs; Batch fetches them as Markdown. Store JSONL records with URL and fetch time, then deduplicate, detect language and filter quality before training."}},{"@type":"Question","name":"How do I deduplicate scraped training data?","acceptedAnswer":{"@type":"Answer","text":"In layers: Crawl drops duplicate URLs and tracking variants; hashing removes exact copies (see the Python example); a near-duplicate pass like MinHash on shingles catches syndicated articles and boilerplate differing by a date or byline."}},{"@type":"Question","name":"Is it legal to scrape web data for AI training?","acceptedAnswer":{"@type":"Answer","text":"It depends on source, jurisdiction and use. Teams keep to public pages, check terms and robots rules, honour licences like Creative Commons attribution, and avoid or redact personal data. Training copyright is unsettled; ask legal first."}},{"@type":"Question","name":"What format should web training data be in?","acceptedAnswer":{"@type":"Answer","text":"Usually JSONL, one document per line: Markdown or plain text plus URL, fetch time, language and licence. Markdown keeps headings, lists and tables for chunking and quality scoring; strip it later if your tokenizer prefers."}},{"@type":"Question","name":"How large should an LLM training dataset be?","acceptedAnswer":{"@type":"Answer","text":"Pre-training: billions of tokens, breadth first. Fine-tuning: quality first; a few thousand clean, consistent examples often beat a large noisy set. Start small, hold out an evaluation set, add data where it shows gaps."}},{"@type":"Question","name":"Can I collect image data for vision models too?","acceptedAnswer":{"@type":"Answer","text":"Yes. Crawl and Batch collect image URLs, alt text and captions; Fetch downloads the files. See computer vision training data ."}}]}]}
</script>
