TafScraper API docs

Get the data you need from any website, in a few lines of code

Send a URL, get back clean page data: titles, text, links, images, and on request the brand, navigation, contacts and SEO details. Need one thing only, like prices or emails? Contextual Scrape picks it out for you.

Base URL: https://api.tafscraper.com
  1. 1

    Get your API key

    Create one in your dashboard under API Keys.

  2. 2

    Start a scrape

    POST the URL you want to /api/v1/scrape.

  3. 3

    Collect the pages

    Check the job until it says completed.

Quickstart

A scrape runs in the background. You start it, then check on it. If someone already scraped the same URL with the same settings, you get the pages straight away.

curl -X POST https://api.tafscraper.com/api/v1/scrape \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "config": {"max_pages": 10}}'

The cURL call returns a job_id. Check it with curl https://api.tafscraper.com/api/v1/jobs/JOB_ID -H "X-API-Key: YOUR_API_KEY".

Contextual Scrape: ask for exactly what you need

Most of a website is noise for your use case. With Contextual Scrape you say in plain words what you are looking for, and you get back only that, as tidy JSON with the page it came from. No selectors, no parsing.

1. You describe it

“Every product name and price” or “all email addresses and phone numbers”.

2. We read the pages

TafScraper scrapes the site, then AI reads every page against your request.

3. You get the answer

A short summary and a list of findings, each with its source URL.

Example result for “product names and prices”

{
  "summary": "Found 2 products with prices on 1 page.",
  "items": [
    {
      "source_url": "https://shop.example.com/kettles",
      "extracted_info": { "product": "Steel Kettle 1.7L", "price": "€39.90" }
    },
    {
      "source_url": "https://shop.example.com/kettles",
      "extracted_info": { "product": "Glass Kettle", "price": "€44.00" }
    }
  ]
}
  • Where: in your dashboard, open Scraper and choose Contextual Scrape. Write what you need, add the URL, and start. The raw pages stay available too.
  • Cost: 1 purchased credit per scrape. Free credits cover basic scrapes only.
  • Through the API: AI filtering is not available on the API yet. The context field is saved with the job and the job uses a purchased credit, but the API returns the full pages. Until API filtering ships, leave context out and filter the pages in your own code.
  • Tips: name the fields you want (“name, role, email”), keep it to one topic per scrape, and limit max_pages to the part of the site that has the answer.

Your API key

Every request needs your API key in the X-API-Key header. Create and revoke keys in your dashboard. Keep keys on your server; never put them in front-end code.

X-API-Key: sk_your_api_key_here

Credits

New accounts get 5 free credits to try basic scrapes. Purchased credits work for everything.

What each request costs
RequestCost
Basic scrape (one job, up to max_pages pages)1 credit, free or purchased
Contextual Scrape1 purchased credit
Same URL and settings again, answered from cacheFree
Deep Research: fast / standard / heavy1 / 5 / 25 credits

If a job cannot be created, the credit goes back to your balance. See credit packs.

Scrape a website

POST/api/v1/scrape

Starts a scrape of the URL and the pages it links to. Returns the pages at once when they are cached; otherwise returns a job_id to check.

{
  "url": "https://example.com",
  "config": {
    "max_pages": 10,
    "max_depth": 2,
    "delay_ms": 1000,
    "follow_external_links": false,
    "scrape_css_branding": false,
    "structured": false
  }
}

Parameters

urlrequired

The page to start from. Must be a full http:// or https:// address.

config.max_pagesdefault 10, max 100

How many pages to collect in this job.

config.max_depthdefault 2, max 5

How many clicks away from the start page to go.

config.delay_msdefault 1000, min 500

Pause between requests, in milliseconds, so the site is not overloaded.

config.follow_external_linksdefault false

Also follow links to other domains.

config.scrape_css_brandingdefault false

Adds logo (URL, or an SVG data URI for inline logos), favicon, colors (primary, secondary, tertiary as #rrggbb) and fonts (heading, body and families, best first) to each page.

config.structureddefault false

Adds a site object to each page: brand, navigation, calls to action, sections, FAQ, latest posts, images, contacts and SEO. Same credit cost. See Structured site output.

contextoptional, uses a purchased credit

Saved with the job. AI filtering by context runs in the dashboard only for now; see Contextual Scrape.

Only scrape sites you are allowed to, and keep the delay polite. You are responsible for following each site's terms.

Response: job started

{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "started",
  "message": "Scraping job started for URL: https://example.com",
  "cached": false,
  "data": null
}

Response: served from cache

{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "completed",
  "message": "Data served from cache for URL: https://example.com with matching configuration",
  "cached": true,
  "data": [
    {
      "url": "https://example.com",
      "title": "Example Domain",
      "text_content": ["Example Domain", "This domain is for use in illustrative examples..."],
      "links": ["https://www.iana.org/domains/example"],
      "images": []
    }
  ]
}

Get the results

GET/api/v1/jobs/:job_id

Shows progress while the job runs. When status is completed, the pages are in results. Checking every 2 to 5 seconds is plenty.

{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "completed",
  "message": "Job completed successfully. Scraped 15 pages",
  "progress": { "pages_scraped": 15, "total_links_found": 120, "current_url": null },
  "results": [
    { "url": "https://example.com", "title": "Example Domain", "text_content": ["..."], "links": ["..."], "images": [] }
  ],
  "error": null
}
  • pending: waiting to start
  • running: collecting pages; progress shows how far it got
  • completed: done; the pages are in results
  • failed: stopped; the reason is in error

Structured site output

Want the shape of a site, not just its words? Send config.structured: true. Every page then carries a site object (schema version "2"). Collapsed content, such as closed <details> blocks, is included, and Cloudflare-protected emails are decoded.

curl -X POST https://api.tafscraper.com/api/v1/scrape \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{"url": "https://tinnitaid.com", "config": {"max_pages": 1, "structured": true}}'

Response (shortened)

{
  "url": "https://tinnitaid.com/",
  "title": "Tinnitaid - Calm the noise—anytime, anywhere.",
  "text_content": ["..."],
  "site": {
    "schema_version": "2",
    "brand": { "name": "Tinnitaid", "source": "og:site_name" },
    "primary_nav": [
      { "label": "Articles", "href": "https://tinnitaid.com/blog/", "source": "header_nav", "selector": "..." }
    ],
    "footer_nav": [],
    "primary_cta": {
      "label": "Open App", "href": "https://app.tinnitaid.com", "count": 3,
      "regions": ["hero", "section"], "source": "button_like_link", "selector": "..."
    },
    "sections": [
      { "index": 0, "region": "hero", "heading": "Tinnitaid",
        "subheading": "Calm the noise—anytime, anywhere.",
        "text": "...", "html": "...", "images": ["img_2"], "ctas": ["Open App", "How it works"] }
    ],
    "faq": [
      { "question": "What is Tinnitaid?", "answer_text": "...", "answer_html": "...", "source": "details", "selector": "..." }
    ],
    "latest_posts": [
      { "title": "Can stress worsen tinnitus?", "url": "https://tinnitaid.com/can-stress-worsen-tinnitus/", "excerpt": "..." }
    ],
    "images": [
      { "id": "img_3", "url": "https://tinnitaid.com/wp-content/uploads/...png", "alt": "Kifissia Award",
        "kind": "award_badge", "section_index": 3, "nearest_heading": "Awards / Investors / Partners",
        "region": "section", "status": "ok", "error": null }
    ],
    "contacts": {
      "emails": [{ "value": "[email protected]", "source": "cfemail", "selector": "..." }],
      "phones": []
    },
    "seo": { "title": "...", "description": "...", "canonical": "https://tinnitaid.com/", "og_image": "...", "lang": "en-US" },
    "warnings": []
  }
}
  • Every item says how it was found (source) and where (selector, a CSS path).
  • contacts.phones only lists tel: links and numbers next to words like “phone” that are valid for the site's country. Reference numbers such as DOIs are never reported as phones.
  • Images that cannot be loaded stay in the list with status: "failed" and an error, plus a note in warnings. A js_rendered_suspected warning means the page builds itself in the browser and only its static HTML was read.

Deep Research: a cited report from the live web

Ask a question. TafScraper splits it into focused searches, reads the best sources and writes a report with citations, so you can check every claim.

POST/api/v1/deepresearch

{
  "query": "Impact of synthetic biology on agriculture in 2026",
  "mode": "fast",
  "research_strategy": "Focus on nitrogen fixation and commercial cost curves",
  "report_format": "Executive brief with comparison tables",
  "urls": ["https://example.com/agtech-whitepaper"]
}

queryrequired, 3 to 25,000 characters

The question or topic to research.

mode"fast" | "standard" | "heavy", default "standard"

fast (1 credit): 2 searches, up to 3 sources read. standard (5 credits): 3 searches, up to 5 sources. heavy (25 credits): 5 searches, up to 8 sources, the most thorough.

research_strategyoptional

The angle, focus or hypotheses you want tested.

report_formatoptional

How the report should be laid out.

urlsoptional

Pages you want included in the sources.

Response: task started

{
  "deepresearch_id": "b5e2a251-b53c-4006-98f8-60851f648da5",
  "status": "running",
  "mode": "fast",
  "credits_used": 1,
  "message": "Deep research task started in fast mode (1 credits deducted)",
  "created_at": "2026-10-15T11:38:10.135Z"
}

GET/api/v1/deepresearch/:task_id

Check until status is completed. The report is in output (Markdown) and the sources in sources.

{
  "id": "b5e2a251-b53c-4006-98f8-60851f648da5",
  "query": "Impact of synthetic biology on agriculture in 2026",
  "mode": "fast",
  "status": "completed",
  "credits_used": 1,
  "output": "# Deep Research Report ...\n\n## Executive Summary ...",
  "sources": [
    { "title": "Synthetic Biology in Modern Farming", "url": "https://example.org/synbio-agri", "snippet": "..." }
  ],
  "steps_log": [
    { "step": 1, "title": "Formulating Research Strategy", "status": "completed", "details": "Generated 2 targeted search vectors" }
  ],
  "error": null,
  "created_at": "2026-10-15T11:38:10.128Z",
  "completed_at": "2026-10-15T11:38:25.237Z"
}

Also available: GET /api/v1/deepresearch lists your tasks, and DELETE /api/v1/deepresearch/:task_id cancels one that is still running.

Errors

Errors come back as JSON with a message and the status code, for example {"error": "Invalid API key", "status": 401}.

Error codes and what to do
CodeMeaningWhat to do
400The request is not valid (for example a bad URL), or a contextual job has no purchased creditsFix the field named in error, or buy credits
401Missing or invalid API keyCheck the X-API-Key header
402Not enough creditsTop up
404Job or task not foundCheck the ID
429Too many requestsWait a minute, then retry
500Something failed on our sideRetry; if it keeps happening, tell us

Limits

  • 30 requests per minute per IP address, shared across all /api/v1 endpoints.
  • Up to 100 pages and 5 levels deep per scrape job, with at least 500 ms between requests to the same site.

Questions or a use case that needs more? Talk to us.