# webscrapingapi.dev — full text for language models
> webscrapingapi.dev is a free web scraping API for developers and AI agents. Send a URL and get back HTML, plain text, Markdown, JSON extracted with CSS selectors, or page metadata. Site-specific endpoints return clean JSON for sites the service already knows. When a site cannot be scraped with a plain request, users post it on the board and the maintainer builds an endpoint for it or explains why it cannot be done. Everything is free: 50,000 credits per account per day, no card.
This file is the long form of https://webscrapingapi.dev/llms.txt. Machine-readable API description: https://webscrapingapi.dev/openapi.json. Human documentation: https://webscrapingapi.dev/docs. Built and run by Jaeyoung (https://webscrapingapi.dev/about).
# Facts and limits
- Base URL: https://api.webscrapingapi.dev
- Authentication: API key in the `X-API-Key` header (also `Authorization: Bearer` or `?api_key=`). Keys start with `wsa_` and are created in the dashboard at https://app.webscrapingapi.dev.
- Free quota: 50,000 credits per account per day, resets 00:00 UTC. A plain fetch costs 1 credit, a JavaScript render 5, metadata and site endpoints 1. Answers served from the shared store cost 0.
- Rate limit: 60 requests per minute per key; up to 5 keys per account.
- Limits: 30 s max timeout, 5 MB max body, 2 MB of HTML parsed (a larger page is cut before parsing and comes back with truncated: true, because a DOM costs about fifty times the source size), 50 extract fields. Private and reserved network addresses are refused.
- Logging: hostname, status, timing, credits and key per request, kept 30 days. A plain request's page is not stored; jobs and max_age requests keep results 30 days, shared with anyone who asks for the same target.
- Refunds: only failures on our side refund the credit: RENDER_UNAVAILABLE, RENDER_TOO_SLOW, INTERNAL_ERROR and SITE_PARSE_FAILED. Whatever the target did is charged: FETCH_FAILED, TIMEOUT, SITE_BLOCKED, and a /v1/scrape page that comes back with blocked. A request we refuse (BAD_REQUEST, URL_BLOCKED) is never charged.
- No CAPTCHA solving and no anti-bot bypass. Sites that cannot be reached reliably are marked "Not possible" on the board.
# Generic endpoints
## GET or POST https://api.webscrapingapi.dev/v1/scrape
Parameters — GET query or POST body (headers only in a POST body). An option name the API does not know is refused with 400 instead of being ignored.
- url (string, required): http or https URL. Private and reserved addresses are rejected with `URL_BLOCKED`.
- render (boolean | `auto`): `true`: run the page in headless Chrome and return the DOM after JavaScript (5 credits). Images, fonts and media are not loaded. `auto`: fetch statically first (1 credit); only if the page turns out to be an app shell with almost no text is it rendered, for 5 credits in total. The response says what happened in `autoRender` (`not-needed`, `app-shell`, `thin-content`, `blocked`, `quota-exceeded`, `unavailable`, `render-failed`). Bot walls and error pages are never rendered.
- waitFor (string): With `render`: wait until this CSS selector exists.
- wait (number (ms)): With `render`: extra wait after load, up to 10000.
- timeout (number (ms)): 1000–30000. Default 15000. In a job, rendering gets up to 60 s whatever this says.
- format (`html` | `text` | `markdown` | `json`): Default `html` (`markdown` in a job). `text` strips tags and keeps paragraph breaks. `markdown` keeps headings, lists, tables, code and absolute links — made for feeding a model. `json` requires `extract`.
- selector (string): Return only this element (html, text or markdown formats). Overrides `main`.
- main (boolean): text and markdown only. Default `true`: keep the main content and drop navigation, headers, footers, sidebars, cookie banners, share and "related" blocks. Set `false` for the whole body. Same idea as Firecrawl's `onlyMainContent`.
- links (`inline` | `refs` | `none`): markdown only. Default `inline`: `[text](url)`. `refs`: the text stays, a footnote mark `[^n]` follows it and every URL appears once at the end as `[^n]: url` (GFM footnote syntax, so the numbers never collide with a page's own `[1]` citations). Prose reads without URLs; the size only drops when URLs repeat. `none`: text only, the smallest output.
- images (`alt` | `inline` | `none`): markdown only. Default `alt`: only the description, as `(image: alt)`. `inline`: ``. `none`: removed.
- exclude (string or array): text and markdown. CSS selectors removed before extraction, up to 20, e.g. `.promo, #newsletter`. Applied on top of `main`.
- max_chars (number (≥ 200)): text and markdown. Cut at a paragraph boundary (an open code fence is closed) and set `truncated: true`. The front matter and the references list are not counted.
- front_matter (boolean): markdown only. Prepend a YAML block with the `meta` values that exist plus `url`, the way LangChain and LlamaIndex loaders read it.
- profile (`article` | `discussion` | `listing` | `product`): text and markdown. Pin the page type instead of letting the server detect it (`pageType.by` becomes `param`). Each type has its own skeleton (see Markdown output). Ignored with `selector` or `main=false`.
- extract (object): Field → rule map: a CSS selector string, or `{ selector, attr, all, html }`. Up to 50 fields. In GET, pass it as a JSON string.
- headers (object (POST)): Custom request headers, in a POST body only. Allowed: user-agent, accept, accept-language, cookie, referer. Not with `max_age` (`400`): a page fetched with your own headers is never shared. In a job such a target is private (see Jobs).
- raw (boolean): Respond with the body itself (text/html, text/markdown or text/plain) instead of the JSON envelope — handy with curl. Status and final URL come back in `X-Scrape-*` headers. With `format=json` the envelope stays.
- max_age (number (seconds)): Accept a *shared* result: if anyone — a job or another caller — fetched the same URL with the same format, rendering and extraction rules within this many seconds (30 days at most), you get that copy for 0 credits with `source: "shared"` and `age`. Otherwise the page is fetched live and stored for the next caller. Omit it to always fetch fresh (nothing is stored). Not with `headers`. In a job, `max_age` is set on the whole job.
PDF URLs (by content type or %PDF- signature) are read with pdf.js: text/markdown give the document text (pages separated by a blank line), html wraps it in
, json extraction is unavailable, meta comes from the document info, stats.pages is the page count; up to 5 MB and 300 pages; no OCR.
Response: { url, finalUrl, statusCode, contentType, title, rendered, html | text | markdown, data, truncated, meta, stats, converter, pageType, autoRender?, blocked?, elapsedMs, credits }. meta = { title, description, author, publishedAt, modifiedAt, lang, canonical, siteName, image } read from JSON-LD, Open Graph and meta/time tags (null when absent, dates ISO 8601). stats = { chars, words, tokens } of the returned body (tokens is an estimate within about 15%). converter = version of the conversion rules that produced the response; it changes only when the same HTML would come out differently. pageType = { type: article | discussion | listing | product, by: param | jsonld | microdata | og | heuristic | default }: the kind of page the server decided it fetched — param when the request pinned it with profile=, jsonld/microdata/og when the page declares it (JSON-LD @type, schema.org itemtype, og:type), heuristic when the URL shape and the page shape agree (a /products/ address and a price with an add-to-cart button; an /item?id= address and a column of comments), default when nothing is conclusive (treated as an article). Conservative by design. Listing pages (type listing) are converted as "# title" and then one line per item, "- [title](url) — summary · meta", the summary being the item's own text up to 200 characters and the meta, in fixed order and only when present, score · author · date (YYYY-MM-DD from