Page content

The content of one web page as Markdown or text, without its menus, with title, headings and word and token counts.

Try it in the dashboard 100 free credits when you sign up, no card.

GET/v1/web/content

Costs 1 credit per request. Only requests that return data are charged.

Parameters

NameTypeDescription
urlrequired string The full address of one page, path and query included, such as https://docs.apify.com/academy. Only that page is read.
formatoptional string markdown keeps headings, lists, quotes, tables, code blocks and links as Markdown. text is the same content without the heading, list and quote marks. One of: markdown, text. Default: markdown.

Example request

curl "https://pipefetch.com/v1/web/content?url=https%3A%2F%2Fdocs.apify.com%2Facademy" \
  -H "x-api-key: YOUR_API_KEY"

Example response

A real answer to the request above. Long texts and lists are shortened here, and the people who wrote comments, reviews or posts are replaced by a stand-in.

200 OK · application/json
{
  "data": {
    "url": "https://docs.apify.com/academy",
    "canonicalUrl": "https://docs.apify.com/academy",
    "title": "Apify Academy | Academy | Apify Documentation",
    "description": "Learn everything about web scraping and automation with our free courses that will turn you into an expert scraper developer.",
    "language": "en",
    "content": "# Apify Academy\n\nCopy for LLM\n\nLearn everything about web scraping and automation with our free courses that will turn you into an expert scraper deve…",
    "wordCount": 241,
    "tokenCount": 364,
    "headings": [
      "Apify Academy",
      "Beginner courses"
    ],
    "needsJavaScript": false
  },
  "credits": {
    "used": 1,
    "remaining": 99
  }
}

Good to know

  • One request reads one page. Links are not followed, and files such as PDFs and images are not read.
  • The page is read as plain HTML and JavaScript is not run. A page that builds its text in the browser comes back with needsJavaScript true and the little text its HTML holds; when it holds none, the request answers 404 needs_javascript.
  • Scripts, styles, forms, buttons and images are dropped, and so are menus: blocks made almost entirely of links, and the short link fragments above the first heading and below the last. This is judged from the one page alone, so a stray label or a line of footer text can remain. Links stay as [text](url) in both formats.
  • tokenCount is an estimate made from the words and punctuation of the content, not the count of a particular tokenizer.
  • robots.txt is respected: a page it closes to crawlers answers 404 not_allowed. A page that does not exist answers 404 page_not_found, an address with almost no text or with a file behind it 404 no_content, a site that refuses automated requests 404 website_blocked and one that does not answer 404 website_unreachable. None of these costs anything.

Errors

Every error has the same shape, and none of them is charged. The full list is in the error reference.

Looking for an overview and use cases? See the Web Page to Markdown API page.