apyhub
Back
▣ INGESTION KIT · RETRIEVAL KIT

Convert Webpages to Markdown API

What it does

The Webpages to Markdown API converts public web pages to Markdown in one request. Send one or more startUrls, such as https://en.wikipedia.org/wiki/Web_scraping. You get the page title, headings, language, Markdown text, word count, and source details for each page.

Set crawl to true to follow links on the same domain. Use maxDepth from 1 to 5, and maxPages to cap the run. Send timeoutSecs to stop waiting after 3 to 120 seconds. Turn on includeLinks for internal and external links, or includeImages for page images with alt text.

Teams use the Webpages to Markdown API to save pages for search, LLM input, and content checks. They also use it to turn live pages into text that is easier to store and compare.

When a page fails, includeFailed can save the error row too. Set maxCharsPerPage to cut long text for LLM context windows, and use truncated to see when a page was cut.

POST
Web Fetch - URL to Markdown, $1/1k Pages, 3s Runs
https://api.eu.apyhub.com/martin10291/convert-webpages-to-markdown

QUICKSTART

GUIDE

Quickstart

Send one or more public URLs to convert their pages into clean Markdown.

curl -X POST "https://api.eu.apyhub.com/martin10291/convert-webpages-to-markdown" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls":["https://en.wikipedia.org/wiki/Web_scraping"]}'

What you'll get back

Returns a JSON object with billed and count integers, plus an items array of result objects.

Each item includes fields such as url, title, finalUrl, headings, language, markdown, extractor, fetchedAt, truncated, wordCount, statusCode, contentHash, description, publishedDate, and error when present.

{
  "billed": 1,
  "count": 1,
  "items": [
    {
      "url": "https://en.wikipedia.org/wiki/Web_scraping",
      "title": "Web scraping",
      "author": null,
      "finalUrl": "https://en.wikipedia.org/wiki/Web_scraping",
      "headings": ["Web scraping"],
      "language": "en",
      "markdown": "# Web scraping\n...",
      "extractor": "url-to-markdown",
      "fetchedAt": "2026-11-14T00:00:00.000Z",
      "truncated": false,
      "wordCount": 1234,
      "statusCode": 200,
      "contentHash": "abc123",
      "description": null,
      "publishedDate": "2024-01-01"
    }
  ]
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body
When on, the actor also follows links that stay on the same domain as each start URL, up to Max crawl depth and Max pages.
Only used when crawling. 1 = start URLs plus the pages they link to.
Hard limit on pages fetched in one run (also limits what you pay for). Failed pages count too.

About this endpoint

What it does

Converts one or more web pages into Markdown and returns the fetched page records in a JSON response. If crawling is enabled, it also follows links on the same domain up to the configured crawl depth and page limit.

Request Body

ParameterTypeMandatoryDescription
crawlBooleanNoWhen true, also follows links on the same domain as each start URL, up to maxDepth and maxPages. Default: false.
maxDepthIntegerNoUsed only when crawling. Minimum 1, maximum 5. 1 means the start URLs plus the pages they link to. Default: 1.
maxPagesIntegerNoHard limit on pages fetched in one run. Minimum 1, maximum 5000. Also limits what you pay for; failed pages count too. Default: not specified in the schema.
startUrlsString ArrayYesFull URLs to convert to Markdown. Each entry must be an http or https URL. Maximum 100 URLs. Public pages only; no login pages.
timeoutSecsIntegerNoTime to wait for a page response before giving up. Minimum 3, maximum 120. Default: 20.
includeLinksBooleanNoWhen true, adds internalLinks and externalLinks lists to each result. The lists contain absolute URLs, up to 200 each. Default: false.
includeFailedBooleanNoWhen true, failed pages are also saved with an error message and are charged like normal results. When false, failures are only listed in the RUN_SUMMARY record. Default: false.
includeImagesBooleanNoWhen true, adds page images to each result as absolute URL plus alt text, up to 100. Default: false.
maxCharsPerPageIntegerNoTruncates markdown and text after this many characters to fit LLM context windows. 0 means no limit. The truncated flag indicates when a page was cut. Default: 0.

Response

Returns a JSON object with billed and count integer fields, and an items array of result objects. Each item includes page metadata and extracted content such as url, title, finalUrl, markdown, statusCode, and related fields defined by the schema.

ParameterTypeMandatoryDescription
billedIntegerYesUnits charged for this call. Only result rows are billed; not-found, unavailable, and invalid rows are free.
countIntegerYesNumber of rows in items.
itemsObject ArrayYesResult rows returned by the fetch run. Each item contains the fields defined in the item schema.
items[].urlStringNoSource URL for the row.
items[].errorStringNoError information for the row, if present. Nullable in the schema.
items[].titleStringNoPage title.
items[].authorStringNoPage author. Nullable in the schema.
items[].finalUrlStringNoFinal URL after fetch.
items[].headingsString ArrayNoPage headings.
items[].languageStringNoDetected page language.
items[].markdownStringNoMarkdown content extracted from the page.
items[].extractorStringNoExtractor used for the result.
items[].fetchedAtStringNoTime the page was fetched.
items[].truncatedBooleanNoWhether markdown or text was cut by maxCharsPerPage.
items[].wordCountIntegerNoWord count for the fetched content.
items[].statusCodeIntegerNoHTTP status code returned for the page fetch.
items[].contentHashStringNoContent hash for the fetched page.
items[].descriptionStringNoPage description. Nullable in the schema.
items[].publishedDateStringNoPage published date.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.