API Documentation
Complete reference for integrating Supaklin into your applications.
Quick Start
Installation
Install the Python SDK via pip
pip install supaklinBasic Usage
from supaklin import Supaklin
client = Supaklin(api_key="sk_live_your_api_key")
result = client.clean(
text="Your raw text content here",
url="https://example.com"
)
print(result.text)API Reference
POSTGET
/api/v1/cleanClean raw text or HTML by removing UI boilerplate
Authentication
Header
Value
Required
AuthorizationBearer sk_live_your_api_key
RequiredContent-Typeapplication/json
RequiredThe legacy X-API-Key header is also supported.
Request Body
Field
Type / Description
Required
textstring
Raw text to clean. Max 100,000 characters.
urlstring
Source URL of the text (e.g., "https://reddit.com/r/tech/post").
categoriesstring[]
Which boilerplate categories to remove. Options:
"Navigation", "Interactive", "Promotional", "Chrome". Default: all.Response (200 OK)
Field
Type / Description
clean_textstring
The cleaned output text.
tokens_usedinteger
Total tokens consumed (input + output).
warningstring | null
Optional warning (e.g., new domain detected).
Error Responses
All errors follow a consistent format:
{
"error": {
"message": "API key required. Get one at https://supaklin.com",
"type": "authentication_error",
"code": 401
}
}401authentication_error
Missing API key.
403authentication_error
Invalid or inactive API key.
422invalid_request_error
Missing required fields or validation error.
429rate_limit_error
Insufficient token balance or rate limit exceeded.
Code Examples
Python SDK
Recommended for Python applications
from supaklin import Supaklin
client = Supaklin(api_key="sk_live_your_api_key")
result = client.clean(
text="Header Menu Home About Contact Main Content Article Text Footer Copyright 2024",
url="https://example.com"
)
print(f"Cleaned: {result.text}")
print(f"Tokens: {result.metadata['tokens_used']}")