Everything you need to integrate StripFeed into your application. Convert any URL to clean, token-efficient Markdown with a single API call.
https://stripfeed.devAll API requests require a valid API key passed in the Authorization header as a Bearer token.
sf_live_ProductionUse for live API calls. Requests count toward your monthly quota.
sf_test_TestUse for development and testing. Same behavior, separate tracking.
Create and manage API keys in your dashboard. Keys are hashed with SHA-256 before storage.
/api/v1/fetchFetch a URL and return its content as clean, token-efficient Markdown. Supports both plain text and JSON response formats.
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Required | URL-encoded target URL. Must be http:// or https://. |
model | string | Optional | AI 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. |
format | string | Optional | Output format: markdown (default), json, text (plain text, no formatting), html (clean HTML from Readability). |
selector | string | Optional | CSS selector to extract specific elements instead of auto-detecting with Readability. E.g. article, .post-content, #main. Cached separately per URL+selector combination. |
cache | string | Optional | Set to false to skip cache and force a fresh fetch. The new result is still cached for future requests. |
ttl | number | Optional | Custom cache TTL in seconds. Default: 3600 (1 hour). Max: 86400 (24 hours). Set to 0 to cache indefinitely until evicted. |
Every successful response includes these custom headers with processing metrics.
| Header | Type | Description |
|---|---|---|
X-StripFeed-Tokens | number | Token count of the clean Markdown output |
X-StripFeed-Original-Tokens | number | Token count of the original HTML |
X-StripFeed-Savings-Percent | number | Percentage of tokens saved (e.g. 92.3) |
X-StripFeed-Cache | string | Cache status: HIT (served from cache) or MISS (freshly processed) |
X-StripFeed-Fetch-Ms | number | Total processing time in milliseconds (0 for cache hits) |
X-StripFeed-Model | string | AI model used for cost tracking (from request param or your default) |
X-StripFeed-Format | string | Output format used: markdown, json, text, or html |
X-StripFeed-Selector | string | CSS selector used (only present when selector param was provided) |
X-RateLimit-Limit | number | Maximum requests per second for your API key |
X-RateLimit-Remaining | number | Remaining requests in the current rate limit window |
X-RateLimit-Reset | number | Unix timestamp when the rate limit resets |
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"
}/api/v1/batchProcess multiple URLs in a single request. URLs are fetched in parallel for maximum speed. Max 10 URLs per batch.
{
"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.
{
"results": [
{ "url": "...", "markdown": "...", "tokens": 1250, "status": 200 },
{ "url": "...", "markdown": "...", "tokens": 890, "status": 200 }
],
"total": 2,
"success": 2,
"failed": 0,
"model": "claude-sonnet-4"
}Use StripFeed directly from Claude Code, Cursor, Windsurf, or any MCP-compatible client. No code needed.
{
"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.
The official TypeScript SDK provides a typed wrapper around the StripFeed API. Zero dependencies, works with Node.js 18+.
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");
The official Python SDK provides a simple wrapper around the StripFeed API. Zero dependencies, works with Python 3.9+.
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")
Errors return a JSON body with an error field describing the issue.
| Status | Meaning | What to Do |
|---|---|---|
| 401 | Missing or invalid API key | Check your Authorization header format and key validity. |
| 422 | Invalid URL format | Ensure the url parameter is a valid http:// or https:// URL. |
| 429 | Rate limit exceeded | Wait for the Retry-After period or upgrade your plan. |
| 502 | Target URL unreachable | The target server is down or blocking requests. Try again later. |
| 504 | Target URL timed out | The target server took too long (10s limit). Try a different URL. |
{
"error": "Missing or invalid Authorization header"
}Requests are rate-limited based on your plan. There are two layers of rate limiting.
Each plan has a monthly request limit. When exceeded, the API returns 429.
A sliding window rate limiter prevents burst abuse. Each API key is limited to 20 requests per second.
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.
| Control | Behavior |
|---|---|
?cache=false | Skip cache, force fresh fetch. Result is still cached for future requests. |
?ttl=7200 | Custom TTL in seconds. Max 86400 (24h). Default 3600 (1h). |
?selector=... | Selector requests are cached separately per URL+selector combination. |
Create a free account and get your API key in seconds.