Menu

Extract

Extract quickstart

One page as Markdown, then what a failure looks like, then the labels.

Copy as MarkdownOpen in ChatGPT (opens in a new tab)Open in Claude (opens in a new tab)

1. Read one page

Example
Shell
curl https://api.millionshort.com/v1/extract \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": ["https://example.org/guides/tide-tables"],
    "mode": "live"
  }'

live fetches the page now. The answer has one entry per URL in data.results, in the order sent. A page that worked has status: "ok", its title, and its main content in markdown.

2. Check each URL

The HTTP status is 200 whenever the request itself was valid, even when every URL failed. Look at each entry. One that failed looks like this:

Text
"url": "https://example.org/private",
"status": "error",
"error": {
  "code": "ROBOTS_DISALLOWED",
  "message": "This site's robots.txt does not allow our bot to fetch this page."
}

A URL that fails costs nothing, except a page that does not exist in a browser mode (pricing). Errors lists the codes and what to try next.

3. Choose what comes back

Example
Shell
curl https://api.millionshort.com/v1/extract \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": ["https://example.org/guides/tide-tables"],
    "mode": "live",
    "formats": ["markdown", "metadata", "links"],
    "max_chars": 20000
  }'

formats takes markdown, text, links and metadata. max_chars cuts long content, and truncated says when it did.

4. Read the labels

Every page that comes back says what it is, at no charge: topic, page_type and source_hint, each with a confidence. A program can route a page by them without reading it. See Labels.

Next

The SDKs do not cover this endpoint yet. Call the endpoint over HTTP as above.

This page as Markdown ยท llms.txt