v1

API Documentation

Everything you need to integrate StripFeed into your application. Convert any URL to clean, token-efficient Markdown with a single API call.

Base URLhttps://stripfeed.dev

1Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Authorization: Bearer sf_live_xxxxxxxxxxxxxxxxxxxx
sf_live_Production

Use for live API calls. Requests count toward your monthly quota.

sf_test_Test

Use for development and testing. Same behavior, separate tracking.

Create and manage API keys in your dashboard. Keys are hashed with SHA-256 before storage.

2Endpoint

GET/api/v1/fetch

Fetch a URL and return its content as clean, token-efficient Markdown. Supports both plain text and JSON response formats.

3Query Parameters

ParameterTypeRequiredDescription
urlstringRequiredURL-encoded target URL. Must be http:// or https://.
modelstringOptionalAI model ID for cost tracking (e.g. claude-sonnet-4, gpt-4o, gemini-2.5-pro). Overrides your default model from Settings. We snapshot the model price at request time so your historical savings stay accurate even if prices change. Pass any string for custom models. Set your default and custom price in Settings.
formatstringOptionalOutput format: markdown (default), json, text (plain text, no formatting), html (clean HTML from Readability).
selectorstringOptionalCSS selector to extract specific elements instead of auto-detecting with Readability. E.g. article, .post-content, #main. Cached separately per URL+selector combination.
cachestringOptionalSet to false to skip cache and force a fresh fetch. The new result is still cached for future requests.
ttlnumberOptionalCustom cache TTL in seconds. Default: 3600 (1 hour). Max: 86400 (24 hours). Set to 0 to cache indefinitely until evicted.

4Response Headers

Every successful response includes these custom headers with processing metrics.

HeaderTypeDescription
X-StripFeed-TokensnumberToken count of the clean Markdown output
X-StripFeed-Original-TokensnumberToken count of the original HTML
X-StripFeed-Savings-PercentnumberPercentage of tokens saved (e.g. 92.3)
X-StripFeed-CachestringCache status: HIT (served from cache) or MISS (freshly processed)
X-StripFeed-Fetch-MsnumberTotal processing time in milliseconds (0 for cache hits)
X-StripFeed-ModelstringAI model used for cost tracking (from request param or your default)
X-StripFeed-FormatstringOutput format used: markdown, json, text, or html
X-StripFeed-SelectorstringCSS selector used (only present when selector param was provided)
X-RateLimit-LimitnumberMaximum requests per second for your API key
X-RateLimit-RemainingnumberRemaining requests in the current rate limit window
X-RateLimit-ResetnumberUnix timestamp when the rate limit resets

5Examples

# Convert a URL to Markdown
curl "https://www.stripfeed.dev/api/v1/fetch?url=https://news.ycombinator.com" \
-H "Authorization: Bearer sf_live_your_key"
# With model for accurate cost tracking
curl "https://www.stripfeed.dev/api/v1/fetch?url=https://news.ycombinator.com&model=claude-sonnet-4" \
-H "Authorization: Bearer sf_live_your_key"
# Get JSON response instead
curl "https://www.stripfeed.dev/api/v1/fetch?url=https://news.ycombinator.com" \
-H "Authorization: Bearer sf_live_your_key" \
-H "Accept: application/json"

6JSON Response Format

Send Accept: application/json to receive a structured JSON response instead of raw Markdown.

{
  "markdown": "# Article Title\n\nClean markdown content...",
  "url": "https://news.ycombinator.com/article",
  "title": "Article Title",
  "tokens": 1250,
  "originalTokens": 16180,
  "savingsPercent": 92.3,
  "cached": true,
  "fetchMs": 0,
  "format": "markdown",
  "model": "claude-sonnet-4"
}

7Batch Endpoint

POST/api/v1/batch

Process multiple URLs in a single request. URLs are fetched in parallel for maximum speed. Max 10 URLs per batch.

Request Body

{
  "urls": [
    "https://news.ycombinator.com",
    "https://react.dev/learn",
    { "url": "https://docs.anthropic.com", "selector": "article" }
  ],
  "model": "claude-sonnet-4"
}

Each item in urls can be a plain string or an object with url and optional selector.

Example

curl -X POST "https://www.stripfeed.dev/api/v1/batch" \
-H "Authorization: Bearer sf_live_your_key" \
-H "Content-Type: application/json" \
-d '{"urls": ["https://news.ycombinator.com", "https://react.dev"]}'

Response

{
  "results": [
    { "url": "...", "markdown": "...", "tokens": 1250, "status": 200 },
    { "url": "...", "markdown": "...", "tokens": 890, "status": 200 }
  ],
  "total": 2,
  "success": 2,
  "failed": 0,
  "model": "claude-sonnet-4"
}

8MCP Server

Use StripFeed directly from Claude Code, Cursor, Windsurf, or any MCP-compatible client. No code needed.

# Claude Code
claude mcp add stripfeed -- npx -y @stripfeed/mcp-server
# Cursor / VS Code (add to .cursor/mcp.json)
{
  "mcpServers": {
    "stripfeed": {
      "command": "npx",
      "args": ["-y", "@stripfeed/mcp-server"],
      "env": {
        "STRIPFEED_API_KEY": "sf_live_your_key"
      }
    }
  }
}

The MCP server exposes two tools: fetch_url and batch_fetch. Your AI assistant can use them to read any webpage as clean Markdown. See the full setup guide on GitHub or install from npm.

9TypeScript SDK

The official TypeScript SDK provides a typed wrapper around the StripFeed API. Zero dependencies, works with Node.js 18+.

# Install
npm install stripfeed
import StripFeed from "stripfeed";

const sf = new StripFeed("sf_live_your_api_key");

// Full result with metadata
const result = await sf.fetch("https://docs.anthropic.com");
console.log(result.markdown);
console.log(`Tokens: ${result.tokens} (saved ${result.savingsPercent}%)`);

// Just the Markdown string
const md = await sf.fetchMarkdown("https://docs.anthropic.com");
Methods

fetch(url, opts?)

fetchMarkdown(url, opts?)

batch(urls, opts?)

parseHeaders(headers)

Requirements

Node.js 18+

Zero dependencies

Full TypeScript types

10Python SDK

The official Python SDK provides a simple wrapper around the StripFeed API. Zero dependencies, works with Python 3.9+.

# Install
pip install stripfeed
from stripfeed import StripFeed

sf = StripFeed("sf_live_your_api_key")

# Full result with metadata
result = sf.fetch("https://docs.anthropic.com")
print(result["markdown"])
print(f"Tokens: {result['tokens']} (saved {result['savingsPercent']}%)")

# Just the Markdown string
md = sf.fetch_markdown("https://docs.anthropic.com")
Methods

fetch(url, **opts)

fetch_markdown(url, **opts)

batch(urls, model=None)

Requirements

Python 3.9+

Zero dependencies

Type hints included

11Errors

Errors return a JSON body with an error field describing the issue.

StatusMeaningWhat to Do
401Missing or invalid API keyCheck your Authorization header format and key validity.
422Invalid URL formatEnsure the url parameter is a valid http:// or https:// URL.
429Rate limit exceededWait for the Retry-After period or upgrade your plan.
502Target URL unreachableThe target server is down or blocking requests. Try again later.
504Target URL timed outThe target server took too long (10s limit). Try a different URL.
// Example error response
{
  "error": "Missing or invalid Authorization header"
}

12Rate Limiting

Requests are rate-limited based on your plan. There are two layers of rate limiting.

Monthly Quota

Each plan has a monthly request limit. When exceeded, the API returns 429.

Free200 req/mo
Pro100,000 req/mo
Burst Limit

A sliding window rate limiter prevents burst abuse. Each API key is limited to 20 requests per second.

Max burst20 req/sec
WindowSliding 1s

Caching

StripFeed automatically caches processed results for 1 hour (default). Cached responses are instant (0ms processing time) and still count toward your monthly quota. Check the X-StripFeed-Cache header to see if a response was served from cache.

ControlBehavior
?cache=falseSkip cache, force fresh fetch. Result is still cached for future requests.
?ttl=7200Custom TTL in seconds. Max 86400 (24h). Default 3600 (1h).
?selector=...Selector requests are cached separately per URL+selector combination.

Ready to get started?

Create a free account and get your API key in seconds.