API Endpoint
GET /llms.txt
Convert a webpage to llms.txt format by providing its URL.The URL of the webpage to convert. Must be a valid HTTP or HTTPS URL.
Example Request
Response Format
The endpoint returns plain text in llms.txt format withContent-Type: text/plain; charset=utf-8.
Example Response
Format Specification
The llms.txt format follows this structure:- Title (H1): The page title or site name
- Description (Blockquote): Meta description or og:description
- Key Information (H2): Up to 100 important links from the page with anchor text
- Contact (H2): Contact information (mailto links or fallback to website URL)
Error Responses
Invalid URL
Fetch Error
Deployment
Use Cases
- LLM Context: Provide structured website information to language models
- AI Assistants: Enable AI to understand website structure and navigation
- Documentation Parsing: Convert documentation sites into LLM-friendly format
- Content Summarization: Extract key information for AI-powered summaries
- Chatbot Training: Generate training data from website content
- RAG Systems: Prepare website data for retrieval-augmented generation
Technical Details
- Built with Hono framework
- Runs on Cloudflare Workers
- Implements llms.txt specification v1.1.1
- Extracts up to 100 key links from the page
- Prioritizes metadata over HTML content for descriptions
- Returns plain text with UTF-8 encoding
Extraction Logic
Title
- Extracts from
<title>tag - Falls back to hostname if no title found
Description
- Checks
<meta name="description">tag - Falls back to
<meta property="og:description">tag - Falls back to generic description with the URL
Key Links
- Extracts links from
<a>tags throughout the page - Includes anchor text with each link
- Limits to 100 links maximum
- Excludes anchor links (#), javascript:, and mailto: links
- Deduplicates by URL
- Resolves relative URLs to absolute URLs
- Truncates long anchor text to 200 characters
Contact Information
- Extracts mailto: links if available
- Falls back to website URL if no contact links found