Docs

Extract Content API

Turn any article, blog post, or landing page into clean Markdown, HTML, or JSON in a single call. The API powers SEO tooling, AI prompt engineering, and knowledge ingestion pipelines.

Available on RapidAPI

Access & Authentication

Subscribe to the Content Extraction API on RapidAPI to obtain your key. RapidAPI injects the key into the X-RapidAPI-Key and X-RapidAPI-Host headers automatically when you use their code snippets. When calling the Worker endpoint directly, supply your RapidAPI key in the Authorization: Bearer <token> header.

RapidAPI Headers

  • X-RapidAPI-Key: your key
  • X-RapidAPI-Host: extract-content.p.rapidapi.com

Direct Worker

  • Authorization: Bearer <token>
  • Optional docs key when browsing internal docs

Endpoint

Method Path Description
POST / GET /extract-content Fetch content from a URL or accept raw HTML and return formatted output.
POST / GET /api/job-extractor/extract-content Legacy path with the same behavior.
GET /extract-content/health Simple uptime probe.

Use Content-Type: application/json for request bodies, or send form data / query parameters.

Request Parameters

Name Type Description
url string Public page URL to fetch and extract. Mutually exclusive with html.
html string Raw HTML to parse locally. Mutually exclusive with url. Optional baseUrl ensures relative links resolve.
baseUrl string Origin to apply to relative links when uploading HTML directly.
readable boolean Apply Reader-Mode extraction before returning content.
output enum html, json, md, or jsonmd. Defaults to html for GET and html for POST unless specified.
includeOriginal boolean Only valid with output=json. When true, attaches originalHtml from the fetched source.

Responses

Success (JSON)

{
  "success": true,
  "data": {
    "html": "<article>…</article>",
    "markdown": "# Heading...",
    "stats": { "wordCount": 1270 },
    "sourceUrl": "https://example.com/post",
    "readableApplied": true,
    "originalHtml": "<!doctype html>…"
  }
}

Error

{
  "success": false,
  "error": "Invalid URL format",
  "details": {}
}

Markdown outputs return a text/markdown body, while html responses stream HTML. The jsonmd option combines Markdown plus stats inside JSON for easy agent consumption.

Quick Start

RapidAPI snippet (Node.js)

import fetch from 'node-fetch';

const url = 'https://extract-content.p.rapidapi.com/extract-content';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-RapidAPI-Key': process.env.RAPIDAPI_KEY,
    'X-RapidAPI-Host': 'extract-content.p.rapidapi.com'
  },
  body: JSON.stringify({
    url: 'https://example.com/blog-post',
    readable: true,
    output: 'jsonmd'
  })
};

const response = await fetch(url, options);
const result = await response.json();

cURL

curl -X POST https://extract-content.p.rapidapi.com/extract-content \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key: <your-key>" \
  -H "X-RapidAPI-Host: extract-content.p.rapidapi.com" \
  -d '{
    "url": "https://example.com",
    "readable": true,
    "output": "json"
  }'