URL to Markdown API

This Val Town API fetches content from a URL, converts it to markdown, and caches the results for improved performance.

Features

  • Converts web content to clean markdown format
  • Caches results to reduce API calls and improve response time
  • Uses Firecrawl API for reliable web scraping
  • Focuses on main content, filtering out ads and clutter

Endpoints

GET /content/:url

Fetches content from the specified URL and returns it as markdown.

Parameters:

  • :url - URL-encoded URL of the page to fetch

Example:

GET /content/https%3A%2F%2Fwww.example.com

Response:

  • Content-Type: text/markdown
  • Body: Markdown content of the requested URL

Setup Requirements

This API requires a Firecrawl API token to be set as an environment variable:

FIRECRAWL_API_TOKEN=your_api_token_here

Caching

Results are cached for 24 hours to improve performance and reduce API calls to Firecrawl.

Implementation Details

  • Built with Hono framework
  • Uses Val Town's blob storage for caching
  • Integrates with Firecrawl API for web scraping
  • Returns clean markdown content