CaptureKit

Fetch the page content

Call the content endpoint for a page.

Call GET /v1/content with the url parameter, and include_markdown=true to get the Markdown.

import os
import requests

API_KEY = os.environ["CAPTUREKIT_API_KEY"]


def get(path, params):
    response = requests.get(f"https://api.capturekit.dev{path}", headers={"x-api-key": API_KEY}, params=params)
    if not response.ok:
        raise SystemExit(f"Error {response.status_code}: {response.text}")
    return response.json()


result = get("/v1/content", {"url": "https://stripe.com/docs/payments", "include_markdown": "true"})
print(result)