Skip to main content

Official Python SDK for StripFeed - convert any URL to clean Markdown

Project description

StripFeed Python SDK

PyPI version License: MIT

Official Python SDK for StripFeed - convert any URL to clean, token-efficient Markdown for AI agents, RAG pipelines, and LLM workflows.

Install

pip install stripfeed

Quick Start

from stripfeed import StripFeed

sf = StripFeed("sf_live_your_api_key")

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

# Just the Markdown string
md = sf.fetch_markdown("https://news.ycombinator.com")

With Options

result = sf.fetch(
    "https://example.com",
    selector="article",           # CSS selector (Pro)
    format="json",                # json, text, html (Pro)
    model="claude-sonnet-4-6",    # cost tracking
    cache=False,                  # bypass cache
    ttl=7200,                     # custom cache TTL
    max_tokens=5000,              # truncate to token budget
)

Batch (Pro plan)

result = sf.batch(
    [
        "https://example.com",
        {"url": "https://docs.anthropic.com", "selector": "article"},
    ],
    model="claude-sonnet-4-6",
)

for item in result["results"]:
    print(f"{item['url']}: {item['tokens']} tokens")

Check Usage

usage = sf.usage()
print(f"Plan: {usage['plan']}")
print(f"Used: {usage['usage']} / {usage['limit']}")
print(f"Remaining: {usage['remaining']}")

Error Handling

from stripfeed import StripFeed, StripFeedError

try:
    result = sf.fetch("https://example.com")
except StripFeedError as e:
    print(f"API error {e.status}: {e}")

Configuration

sf = StripFeed(
    "sf_live_your_api_key",
    base_url="https://custom.api/v1",  # optional
    timeout=10,                         # optional, default 30s
)

Methods

  • sf.fetch(url, **options) - Fetch URL, return full result dict (markdown, tokens, metadata)
  • sf.fetch_markdown(url, **options) - Fetch URL, return only Markdown string
  • sf.batch(urls, model=None) - Fetch up to 10 URLs in parallel (Pro plan)
  • sf.usage() - Check current monthly API usage and plan limits

Requirements

  • Python 3.9+
  • No external dependencies

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stripfeed-1.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stripfeed-1.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file stripfeed-1.1.0.tar.gz.

File metadata

  • Download URL: stripfeed-1.1.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for stripfeed-1.1.0.tar.gz
Algorithm Hash digest
SHA256 24aef01bfd686011908d5ff651b7413ccbd13b37af630dac344ac226c26e66fd
MD5 c5fd8b4e349e49c61bd8daafe47b23f8
BLAKE2b-256 31662b0b2dc1af9435425b6aed6a385b7c4d6b6feac6c6c164d84ee4fa631753

See more details on using hashes here.

File details

Details for the file stripfeed-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: stripfeed-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for stripfeed-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5e377416fef7e31288000e3c17628e1d6218489b2305a601e5422002d75b44d
MD5 440acb5f6c0579e1f9c78ca7976d2806
BLAKE2b-256 af514891adbe3f500771e3a89734e2553e3c461ef395f134cbc21d4d3cf40120

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page