Skip to main content

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

Project description

StripFeed Python SDK

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
)

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")

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)

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.0.0.tar.gz (6.5 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.0.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for stripfeed-1.0.0.tar.gz
Algorithm Hash digest
SHA256 da6280daec3b142ab71fd51b0896d9ff3d51b31cf3822b01e672b6be1c842599
MD5 3447a571dde05bc06a94367046ed3c45
BLAKE2b-256 1941087220576cc2bd6dd723671389c301795dfd8b80334dc27afdd5221bf875

See more details on using hashes here.

File details

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

File metadata

  • Download URL: stripfeed-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94030642cfff3a567b911f541d21f972324d4433c0468913e079b7473b858939
MD5 8e4fabb81713284e3775600578b607e5
BLAKE2b-256 49a6bf0de647fbd4610570899e6c1a844d4ec9de5205a40ca57ae669c521c270

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