API Reference

Turn any URL or file into clean, agent-ready markdown over a simple HTTP API. The same core powers the web app — one endpoint, one credit per conversion.

Authentication

All requests require an API key. Create one in Settings → API Keys and send it as a bearer token (or an x-api-key header). Keys are rate-limited to 60 requests/minute; credits are the real spend cap.

Authorization: Bearer <your-api-key>
# or
x-api-key: <your-api-key>

Base URL: https://markstream.dev

Convert a source

POST/api/v1/convert

Converts one source to markdown and returns the result inline. Charges 1 credit on success; failed conversions are automatically refunded. The request body is selected by Content-Type: JSON for a URL, multipart for a file.

Send application/json with a url field. Facebook and SimilarWeb URLs are routed to dedicated scrapers automatically.

curl -X POST https://markstream.dev/api/v1/convert \
  -H 'Authorization: Bearer <your-api-key>' \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://example.com/article"}'

Example response

{
  "id": "V1StGXR8_Z5jdHi6B-myT",
  "status": "completed",
  "title": "Example Article",
  "sourceType": "url",
  "sourceUrl": "https://example.com/article",
  "provider": "jina",
  "markdown": "# Example Article\n\nClean markdown content…",
  "contentChars": 4821,
  "creditsCharged": 1,
  "createdAt": 1733011200000
}

Get a conversion

GET/api/v1/conversions/:id

Fetch a past conversion (owned by the key's account), including its full markdown. Returns the same shape as the convert response.

curl https://markstream.dev/api/v1/conversions/V1StGXR8_Z5jdHi6B-myT \
  -H 'Authorization: Bearer <your-api-key>'

Response shape

FieldTypeDescription
idstringUnique conversion id
statusstring"completed"
titlestring | nullExtracted title or filename
sourceTypestring"url" or "file"
sourceUrlstring | nullSet for URL sources
providerstringConverter used (jina / cloudflare / tools-api)
markdownstringThe converted markdown
contentCharsnumberLength of the markdown
creditsChargednumberCredits spent (1)
createdAtnumberUnix timestamp (ms)

Supported sources

  • Any web page — rendered to clean markdown, boilerplate stripped.
  • Facebook & SimilarWeb — login-walled marketing sources, routed to dedicated scrapers automatically by URL.
  • Files — PDF, Word (.docx), Excel (.xlsx/.xls), CSV, and images. Scanned/image PDFs are OCR'd. Max 10 MB; HTML uploads are rejected (use the URL form).

Errors & status codes

Errors are JSON: { "error": string, "code": string }. A failed conversion never costs a credit.

StatusMeaning
200Success — returns the conversion result
400Bad input (invalid JSON / URL, or missing file)
401Missing or invalid API key
402Insufficient credits
404Conversion not found
413File too large (over 10 MB)
415Unsupported or blocked file type
422Conversion failed (code = error category)
429Rate limit exceeded (60 req/min)
500Unexpected server error

Ready to start?

New accounts get free credits to try every source type.

Create your API key