### Install StripFeed Python SDK Source: https://github.com/stripfeed/stripfeed-python/blob/main/README.md Installs the StripFeed Python SDK using pip. This is the first step to using the SDK in your Python projects. ```bash pip install stripfeed ``` -------------------------------- ### Quick Start: Fetch URL Content with StripFeed SDK Source: https://github.com/stripfeed/stripfeed-python/blob/main/README.md Demonstrates the basic usage of the StripFeed Python SDK to fetch content from a URL. It shows how to initialize the SDK with an API key and retrieve the Markdown content along with token usage statistics. ```python 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") ``` -------------------------------- ### Install StripFeed Python SDK in Development Mode Source: https://github.com/stripfeed/stripfeed-python/blob/main/CLAUDE.md Installs the StripFeed Python SDK in development mode, including necessary dependencies for testing and development. This command is typically run from the project's root directory. ```bash pip install -e ".[dev]" ``` -------------------------------- ### Error Handling for StripFeed API Requests Source: https://github.com/stripfeed/stripfeed-python/blob/main/README.md Provides an example of how to handle potential `StripFeedError` exceptions that may occur during API calls. It demonstrates using a try-except block to catch errors and print the status code and error message. ```python from stripfeed import StripFeed, StripFeedError try: result = sf.fetch("https://example.com") except StripFeedError as e: print(f"API error {e.status}: {e}") ``` -------------------------------- ### fetch_markdown() - Get Only Markdown String Source: https://context7.com/stripfeed/stripfeed-python/llms.txt A convenience method that fetches a URL and returns only the clean Markdown string, omitting all metadata. ```APIDOC ## fetch_markdown() - Get Only Markdown String Convenience method that fetches a URL and returns only the clean Markdown string, without metadata. Ideal when you just need the content. ### Method GET ### Endpoint `/v1/fetch` (internally uses fetch with format='markdown') ### Parameters #### Query Parameters - **url** (string) - Required - The URL to fetch and convert. - **selector** (string) - Optional - CSS selector to extract specific elements (Pro plan). - **cache** (boolean) - Optional - Bypass cache for fresh content (default: true). - **ttl** (integer) - Optional - Custom cache TTL in seconds (max: 86400). - **max_tokens** (integer) - Optional - Truncate output to fit token budget. ### Request Example ```python from stripfeed import StripFeed sf = StripFeed("sf_live_your_api_key") # Get just the Markdown string md = sf.fetch_markdown("https://news.ycombinator.com") print(md) # "# Hacker News\n\n1. [Article Title](https://...)..." # With options md = sf.fetch_markdown( "https://docs.anthropic.com", selector="article", max_tokens=3000, cache=False, ) ``` ### Response #### Success Response (200) - **markdown** (string) - Clean Markdown content. #### Response Example ``` # Hacker News 1. [Article Title](https://...) ... ``` ``` -------------------------------- ### Batch Fetch URLs with StripFeed SDK (Pro Plan) Source: https://github.com/stripfeed/stripfeed-python/blob/main/README.md Demonstrates the `sf.batch()` method for fetching multiple URLs concurrently, available on the Pro plan. It shows how to pass a list of URLs or dictionaries with URL and selector options, and how to iterate through the results to access token usage per URL. ```python 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") ``` -------------------------------- ### Client Initialization Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Initialize the StripFeed client with your API key. Optional configurations for custom base URL and timeout are also supported. ```APIDOC ## Client Initialization Initialize the StripFeed client with your API key and optional configuration for custom base URL and timeout settings. ```python from stripfeed import StripFeed # Basic initialization sf = StripFeed("sf_live_your_api_key") # With custom configuration sf = StripFeed( "sf_live_your_api_key", base_url="https://custom.api/v1", # Optional custom endpoint timeout=10, # Optional timeout in seconds (default: 30) ) ``` ``` -------------------------------- ### Configure StripFeed SDK Client Source: https://github.com/stripfeed/stripfeed-python/blob/main/README.md Demonstrates how to initialize the `StripFeed` client with custom configurations, including an alternative `base_url` for the API endpoint and a custom `timeout` value for requests. The default timeout is 30 seconds. ```python sf = StripFeed( "sf_live_your_api_key", base_url="https://custom.api/v1", timeout=10, ) ``` -------------------------------- ### Configure StripFeed Fetch Options Source: https://github.com/stripfeed/stripfeed-python/blob/main/README.md Illustrates how to use various options with the `sf.fetch()` method, such as specifying a CSS selector, choosing an output format, tracking model costs, bypassing cache, setting a custom cache TTL, and truncating output to a maximum token count. ```python result = sf.fetch( "https://example.com", selector="article", format="json", model="claude-sonnet-4-6", cache=False, ttl=7200, max_tokens=5000, ) ``` -------------------------------- ### Initialize StripFeed Client Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Initializes the StripFeed client with an API key. Optional parameters allow for custom API base URLs and request timeouts. ```python from stripfeed import StripFeed # Basic initialization sf = StripFeed("sf_live_your_api_key") # With custom configuration sf = StripFeed( "sf_live_your_api_key", base_url="https://custom.api/v1", # Optional custom endpoint timeout=10, # Optional timeout in seconds (default: 30) ) ``` -------------------------------- ### Batch Fetch with String URLs Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Demonstrates how to perform a batch fetch of web content using a list of string URLs and process the results. ```APIDOC ## POST /batch ### Description Fetches content from multiple URLs in a batch. Supports basic string URLs or objects with custom selectors. ### Method POST ### Endpoint /batch ### Parameters #### Query Parameters - **model** (string) - Optional - Specifies the model to use for processing, useful for tracking costs. #### Request Body - **urls** (array) - Required - A list of URLs to fetch. Each item can be a string URL or an object with `url` and `selector` properties. - **url** (string) - Required - The URL to fetch. - **selector** (string) - Optional - A CSS selector to extract specific content from the page. ### Request Example ```json { "urls": [ "https://example.com", {"url": "https://docs.anthropic.com", "selector": "article"}, {"url": "https://openai.com/api", "selector": "main"} ], "model": "claude-sonnet-4-6" } ``` ### Response #### Success Response (200) - **total** (integer) - The total number of URLs processed. - **success** (integer) - The number of URLs successfully fetched. - **failed** (integer) - The number of URLs that failed to fetch. - **results** (array) - A list of results for each URL. - **url** (string) - The URL that was processed. - **status** (integer) - The HTTP status code of the response. - **tokens** (integer) - The number of tokens generated for the content. - **savingsPercent** (float) - The percentage of savings achieved. - **error** (string) - An error message if the fetch failed. #### Response Example ```json { "total": 3, "success": 2, "failed": 1, "results": [ { "url": "https://example.com", "status": 200, "tokens": 1500, "savingsPercent": 10.5 }, { "url": "https://docs.anthropic.com", "status": 200, "tokens": 3000, "savingsPercent": 15.2 }, { "url": "https://openai.com/api", "status": 404, "error": "Not Found" } ] } ``` ``` -------------------------------- ### Run Tests for StripFeed Python SDK Source: https://github.com/stripfeed/stripfeed-python/blob/main/CLAUDE.md Executes the test suite for the StripFeed Python SDK using pytest. This command verifies the functionality and stability of the SDK. ```bash pytest ``` -------------------------------- ### Fetch URL Content in Different Formats (JSON, Text, HTML) Source: https://github.com/stripfeed/stripfeed-python/blob/main/README.md Shows how to use the `format` parameter in the `sf.fetch()` method to retrieve content in JSON, plain text, or clean HTML. Each format provides specific data fields, including metadata like token counts and processing times. ```python # Get structured JSON with all metadata fields result = sf.fetch("https://news.ycombinator.com", format="json") print(result["markdown"]) print(result["html"]) print(result["text"]) print(result["title"]) print(result["tokens"]) print(result["originalTokens"]) print(result["savingsPercent"]) print(result["cached"]) print(result["fetchMs"]) print(result["truncated"]) # Get plain text with all Markdown formatting stripped result = sf.fetch("https://news.ycombinator.com", format="text") print(result["text"]) # Get clean HTML (after Readability extraction) result = sf.fetch("https://news.ycombinator.com", format="html") print(result["html"]) ``` -------------------------------- ### fetch() - Convert URL to Markdown Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Fetches a URL and converts it to clean Markdown with full metadata. Supports various options including CSS selectors, output formats, and caching controls. ```APIDOC ## fetch() - Convert URL to Markdown Fetches a URL and converts it to clean Markdown with full metadata including token counts, savings percentage, and caching information. Supports multiple output formats and Pro plan features like CSS selectors. ### Method GET ### Endpoint `/v1/fetch` ### Parameters #### Query Parameters - **url** (string) - Required - The URL to fetch and convert. - **selector** (string) - Optional - CSS selector to extract specific elements (Pro plan). - **format** (string) - Optional - Output format: "markdown", "json", "text", "html" (default: "markdown"). - **model** (string) - Optional - AI model ID for cost tracking. - **cache** (boolean) - Optional - Bypass cache for fresh content (default: true). - **ttl** (integer) - Optional - Custom cache TTL in seconds (max: 86400). - **max_tokens** (integer) - Optional - Truncate output to fit token budget. ### Request Example ```python from stripfeed import StripFeed sf = StripFeed("sf_live_your_api_key") # Basic fetch with full result result = sf.fetch("https://news.ycombinator.com") print(result["markdown"]) print(result["title"]) print(result["tokens"]) print(result["originalTokens"]) print(result["savingsPercent"]) print(result["cached"]) print(result["fetchMs"]) # With all options (Pro plan features) result = sf.fetch( "https://example.com", selector="article", # CSS selector to extract specific elements format="json", # Output format: "markdown", "json", "text", "html" model="claude-sonnet-4-6", # AI model ID for cost tracking cache=False, # Bypass cache for fresh content ttl=7200, # Custom cache TTL in seconds (max: 86400) max_tokens=5000, # Truncate output to fit token budget ) # Check if content was truncated if result.get("truncated"): print("Content was truncated to fit max_tokens limit") ``` ### Response #### Success Response (200) - **markdown** (string) - Clean Markdown content. - **title** (string) - Page title. - **tokens** (integer) - Token count of clean output. - **originalTokens** (integer) - Token count of original HTML. - **savingsPercent** (float) - Percentage of tokens saved. - **cached** (boolean) - True if served from cache. - **fetchMs** (integer) - Processing time in milliseconds. - **truncated** (boolean) - True if content was truncated due to `max_tokens`. - **html** (string) - Clean HTML content (if format is "html" or "json"). - **text** (string) - Plain text content (if format is "text" or "json"). #### Response Example ```json { "markdown": "# Hacker News\n\n1. [Article Title](https://...)...", "title": "Hacker News", "tokens": 150, "originalTokens": 1500, "savingsPercent": 90.0, "cached": false, "fetchMs": 500, "truncated": false } ``` ``` -------------------------------- ### Output Formats Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Fetch content in different formats including JSON, plain text, and clean HTML, depending on your use case. ```APIDOC ## Output Formats Fetch content in different formats depending on your use case. The format parameter controls what fields are populated in the response. ### Method GET ### Endpoint `/v1/fetch` ### Parameters #### Query Parameters - **url** (string) - Required - The URL to fetch and convert. - **format** (string) - Required - Output format: "markdown", "json", "text", "html". ### Request Example ```python from stripfeed import StripFeed sf = StripFeed("sf_live_your_api_key") # JSON format - returns all metadata fields result = sf.fetch("https://example.com", format="json") print(result["markdown"]) print(result["html"]) print(result["text"]) print(result["title"]) print(result["tokens"]) # Plain text format - strips all Markdown formatting result = sf.fetch("https://example.com", format="text") print(result["text"]) # No headings, bold, links, etc. # HTML format - returns clean HTML after Readability extraction result = sf.fetch("https://example.com", format="html") print(result["html"]) # Clean
HTML ``` ### Response #### Success Response (200) - **markdown** (string) - Clean Markdown content. - **html** (string) - Clean HTML content (if format is "html" or "json"). - **text** (string) - Plain text content (if format is "text" or "json"). - **title** (string) - Page title. - **tokens** (integer) - Token count. - Other metadata fields may be present depending on the format. #### Response Example (format='json') ```json { "markdown": "# Example Domain\n\nThis domain is for use in illustrative examples in documents. You may use this\ncontent freely.", "html": "

Example Domain

This domain is for use in illustrative examples in documents. You may use this content freely.

", "text": "Example Domain\n\nThis domain is for use in illustrative examples in documents. You may use this content freely.", "title": "Example Domain", "tokens": 50, "originalTokens": 200, "savingsPercent": 75.0, "cached": false, "fetchMs": 300 } ``` ``` -------------------------------- ### Fetch URL to Markdown with Metadata Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Fetches content from a URL, converts it to Markdown, and returns comprehensive metadata. Supports various output formats and advanced options like CSS selectors and cache control. ```python from stripfeed import StripFeed, StripFeedError sf = StripFeed("sf_live_your_api_key") # Basic fetch with full result result = sf.fetch("https://news.ycombinator.com") print(result["markdown"]) print(result["title"]) print(result["tokens"]) print(result["originalTokens"]) print(result["savingsPercent"]) print(result["cached"]) print(result["fetchMs"]) # With all options (Pro plan features) result = sf.fetch( "https://example.com", selector="article", # CSS selector to extract specific elements format="json", # Output format: "markdown", "json", "text", "html" model="claude-sonnet-4-6", # AI model ID for cost tracking cache=False, # Bypass cache for fresh content ttl=7200, # Custom cache TTL in seconds (max: 86400) max_tokens=5000, # Truncate output to fit token budget ) # Check if content was truncated if result.get("truncated"): print("Content was truncated to fit max_tokens limit") ``` -------------------------------- ### usage() - Check API Usage Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Queries your current monthly API usage, plan limits, and when the usage counter resets. ```APIDOC ## GET /usage ### Description Retrieves information about your current API usage, including plan details, requests used, limits, and reset times. ### Method GET ### Endpoint /usage ### Parameters None ### Request Example ```python from stripfeed import StripFeed sf = StripFeed("sf_live_your_api_key") usage = sf.usage() ``` ### Response #### Success Response (200) - **plan** (string) - The current subscription plan (e.g., "free", "pro"). - **usage** (integer) - The number of requests used this month. - **limit** (integer) - The monthly request limit for the current plan. - **remaining** (integer) - The number of requests remaining for the month. - **resetsAt** (string) - An ISO 8601 formatted timestamp indicating when the usage counter resets. #### Response Example ```json { "plan": "pro", "usage": 1250, "limit": 100000, "remaining": 98750, "resetsAt": "2026-04-01T00:00:00.000Z" } ``` ``` -------------------------------- ### Build StripFeed Python SDK Distribution Packages Source: https://github.com/stripfeed/stripfeed-python/blob/main/CLAUDE.md Builds the source distribution (sdist) and wheel package for the StripFeed Python SDK. This command is used to prepare the SDK for distribution. ```bash python -m build ``` -------------------------------- ### Check API Usage with StripFeed SDK Source: https://github.com/stripfeed/stripfeed-python/blob/main/README.md Shows how to use the `sf.usage()` method to retrieve information about the current API plan, monthly usage, usage limit, and remaining quota. This is useful for monitoring consumption. ```python usage = sf.usage() print(f"Plan: {usage['plan']}") print(f"Used: {usage['usage']} / {usage['limit']}") print(f"Remaining: {usage['remaining']}") ``` -------------------------------- ### Batch Fetch Web Content with Selectors and Model Tracking Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Fetches content from a list of URLs, allowing specific CSS selectors to target content within pages. It also supports tracking costs by specifying the model used for processing. ```python result = sf.batch( [ "https://example.com", {"url": "https://docs.anthropic.com", "selector": "article"}, {"url": "https://openai.com/api", "selector": "main"}, ], model="claude-sonnet-4-6", # Track costs per model ) ``` -------------------------------- ### Utilize TypedDict Response Types for Autocompletion Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Shows how to import and use `TypedDict` response types exported by the SDK for enhanced IDE autocompletion and static type checking. This improves code quality and maintainability. ```python from stripfeed import ( StripFeed, StripFeedError, FetchResult, BatchResult, BatchResultItem, UsageResult, ) sf = StripFeed("sf_live_your_api_key") # Type hints work with responses result: FetchResult = sf.fetch("https://example.com") batch_result: BatchResult = sf.batch(["https://a.com", "https://b.com"]) usage: UsageResult = sf.usage() ``` -------------------------------- ### Batch Fetch Web Content with String URLs Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Fetches content from a list of URLs in batches. It returns a summary of total, successful, and failed requests, along with detailed results for each URL including token count and savings percentage for successful fetches. ```python result = sf.batch([ "https://example.com", "https://docs.anthropic.com", "https://openai.com/api", ]) print(f"Total: {result['total']}") print(f"Success: {result['success']}") print(f"Failed: {result['failed']}") for item in result["results"]: if item.get("status") == 200: print(f"{item['url']}: {item['tokens']} tokens, saved {item['savingsPercent']}%") else: print(f"{item['url']}: Error - {item.get('error')}") ``` -------------------------------- ### Fetch Only Markdown String Source: https://context7.com/stripfeed/stripfeed-python/llms.txt A convenience method to fetch a URL and return only the clean Markdown content as a string, omitting all metadata. Useful for direct content integration. ```python from stripfeed import StripFeed sf = StripFeed("sf_live_your_api_key") # Get just the Markdown string md = sf.fetch_markdown("https://news.ycombinator.com") print(md) # With options md = sf.fetch_markdown( "https://docs.anthropic.com", selector="article", max_tokens=3000, cache=False, ) ``` -------------------------------- ### batch() - Process Multiple URLs Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Process up to 10 URLs in parallel with a single API call. This feature requires a Pro plan. ```APIDOC ## batch() - Process Multiple URLs Process up to 10 URLs in parallel with a single API call. Requires Pro plan. Returns aggregated results with success/failure counts. ### Method POST ### Endpoint `/v1/batch` ### Parameters #### Request Body - **urls** (array of strings) - Required - An array containing up to 10 URLs to process. - **selector** (string) - Optional - CSS selector to apply to all URLs. - **format** (string) - Optional - Output format for all URLs: "markdown", "json", "text", "html" (default: "markdown"). - **cache** (boolean) - Optional - Bypass cache for fresh content (default: true). - **ttl** (integer) - Optional - Custom cache TTL in seconds (max: 86400). - **max_tokens** (integer) - Optional - Truncate output to fit token budget for all URLs. ### Request Example ```python from stripfeed import StripFeed, StripFeedError sf = StripFeed("sf_live_your_api_key") urls_to_process = [ "https://news.ycombinator.com", "https://example.com", "https://docs.anthropic.com" ] try: results = sf.batch(urls_to_process, format="json", max_tokens=2000) for url, result in results.items(): if result.get("error"): print(f"Error processing {url}: {result['error']}") else: print(f"Successfully processed {url}: Title - {result.get('title')}, Tokens - {result.get('tokens')}") except StripFeedError as e: print(f"An API error occurred: {e}") ``` ### Response #### Success Response (200) - **results** (object) - An object where keys are the input URLs and values are the processing results for each URL. Each result object contains the same fields as the `fetch` method response, or an `error` field if processing failed for that specific URL. #### Response Example ```json { "results": { "https://news.ycombinator.com": { "markdown": "# Hacker News...", "title": "Hacker News", "tokens": 150, "originalTokens": 1500, "savingsPercent": 90.0, "cached": false, "fetchMs": 500 }, "https://example.com": { "markdown": "# Example Domain...", "title": "Example Domain", "tokens": 50, "originalTokens": 200, "savingsPercent": 75.0, "cached": true, "fetchMs": 100 }, "https://docs.anthropic.com": { "error": "Failed to fetch content. Status code: 404" } } } ``` ``` -------------------------------- ### Batch Process Multiple URLs Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Processes up to 10 URLs concurrently in a single API call, requiring a Pro plan subscription. Returns aggregated results, including counts of successful and failed fetches. ```python from stripfeed import StripFeed, StripFeedError sf = StripFeed("sf_live_your_api_key") ``` -------------------------------- ### TypedDict Response Types Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Explains the availability of exported `TypedDict` response types for enhanced IDE autocompletion and type checking. ```APIDOC ## Typed Response Types ### Description The StripFeed SDK provides exported `TypedDict` classes for its response objects. These enhance developer experience by enabling IDE autocompletion, static type checking, and improved code clarity. ### Available Types - **FetchResult**: Represents the response structure for the `fetch()` method. - **BatchResult**: Represents the overall response structure for the `batch()` method. - **BatchResultItem**: Represents the structure of an individual item within the `BatchResult.results` list. - **UsageResult**: Represents the response structure for the `usage()` method. ### Method All SDK methods that return structured data. ### Parameters None ### Request Example ```python from stripfeed import ( StripFeed, StripFeedError, FetchResult, # Result from fetch() BatchResult, # Result from batch() BatchResultItem, # Individual item in BatchResult.results UsageResult, # Result from usage() ) sf = StripFeed("sf_live_your_api_key") # Type hints work with responses result: FetchResult = sf.fetch("https://example.com") batch_result: BatchResult = sf.batch(["https://a.com", "https://b.com"]) usage: UsageResult = sf.usage() # Accessing typed data print(result.markdown) print(batch_result.results[0].url) print(usage.plan) ``` ### Response #### Success Response Responses from methods like `fetch()`, `batch()`, and `usage()` will conform to their respective `TypedDict` structures, allowing for type-safe access to data. ``` -------------------------------- ### Handle API Errors with StripFeedError Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Demonstrates how to catch and handle `StripFeedError` exceptions raised by the SDK for API-related issues. It provides specific handling for common HTTP status codes like 401, 429, 403, and 502, offering user-friendly messages. ```python from stripfeed import StripFeed, StripFeedError sf = StripFeed("sf_live_your_api_key") try: result = sf.fetch("https://example.com") print(result["markdown"]) except StripFeedError as e: if e.status == 401: print("Invalid API key") elif e.status == 429: print("Rate limit exceeded - try again later") elif e.status == 403: print("Feature requires Pro plan") elif e.status == 502: print("Target URL unreachable") else: print(f"API error {e.status}: {e}") # Handling batch errors gracefully try: result = sf.batch(["https://a.com", "https://b.com"]) for item in result["results"]: if item.get("status") != 200: print(f"Failed: {item['url']} - {item.get('error')}") except StripFeedError as e: print(f"Batch request failed: {e}") ``` -------------------------------- ### Error Handling Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Details on how the StripFeed SDK handles API errors using `StripFeedError` and provides guidance for different error scenarios. ```APIDOC ## Error Handling ### Description The StripFeed SDK raises `StripFeedError` exceptions for API-related errors. This section outlines common error statuses and how to handle them, including specific guidance for batch requests. ### Method All SDK methods that interact with the API (e.g., `fetch`, `batch`). ### Parameters None ### Request Example (Single Fetch) ```python from stripfeed import StripFeed, StripFeedError sf = StripFeed("sf_live_your_api_key") try: result = sf.fetch("https://example.com") print(result["markdown"]) except StripFeedError as e: if e.status == 401: print("Invalid API key") elif e.status == 429: print("Rate limit exceeded - try again later") elif e.status == 403: print("Feature requires Pro plan") elif e.status == 502: print("Target URL unreachable") else: print(f"API error {e.status}: {e}") ``` ### Request Example (Batch Fetch) ```python from stripfeed import StripFeed, StripFeedError sf = StripFeed("sf_live_your_api_key") try: result = sf.batch(["https://a.com", "https://b.com"]) for item in result["results"]: if item.get("status") != 200: print(f"Failed: {item['url']} - {item.get('error')}") except StripFeedError as e: print(f"Batch request failed: {e}") ``` ### Response #### Error Response (StripFeedError) - **status** (integer) - The HTTP status code of the error. - **message** (string) - A descriptive error message. #### Response Example (within `except` block) ``` # For status 401: Invalid API key # For status 429: Rate limit exceeded - try again later # For a general API error: API error 500: Internal Server Error ``` ``` -------------------------------- ### Check API Usage Source: https://context7.com/stripfeed/stripfeed-python/llms.txt Queries the StripFeed API to retrieve current monthly usage statistics, including the plan type, requests used, monthly limit, remaining requests, and the timestamp when the usage counter resets. ```python from stripfeed import StripFeed sf = StripFeed("sf_live_your_api_key") usage = sf.usage() print(f"Plan: {usage['plan']}") # "free", "pro", etc. print(f"Used: {usage['usage']}") # Requests used this month print(f"Limit: {usage['limit']}") # Monthly request limit print(f"Remaining: {usage['remaining']}") # Requests remaining print(f"Resets: {usage['resetsAt']}") # ISO timestamp of reset date ``` -------------------------------- ### Commit with Specific Author in Git Source: https://github.com/stripfeed/stripfeed-python/blob/main/CLAUDE.md Forces a Git commit to use a specific committer name and email, overriding the global Git configuration. This is used to ensure all commits adhere to the project's authoring policy. ```bash GIT_COMMITTER_NAME="Claude" GIT_COMMITTER_EMAIL="noreply@anthropic.com" git commit --author="Claude " -m "message" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.