Gaffa
  • Introduction
  • Get Started
  • Credits and Pricing
  • Changelog
  • Features
    • Browser Requests
      • Actions
        • Capture DOM
        • Capture Screenshot
        • Capture Snapshot
        • Click
        • Generate Markdown
        • Generate Simplified DOM
        • Print
        • Scroll
        • Type
        • Wait
      • API Playground Examples
        • Export Web Page to PDF
        • Convert Web Page to Markdown
        • Infinitely Scroll an Ecommerce Site
        • Capture a Full Height Screenshot
        • Automated Form Filling
  • API Reference
    • API Authentication
    • POST v1/browser/request
    • GET v1/browser/request/{id}
    • GET v1/browser/requests
Powered by GitBook
On this page
  • API Request
  • Actions
  • Response
Export as PDF
  1. Features
  2. Browser Requests
  3. API Playground Examples

Convert Web Page to Markdown

An example request that uses Gaffa to convert a web page page to markdown. This could be used to export web page reports or to print the content of a page in a readable format.

PreviousExport Web Page to PDFNextInfinitely Scroll an Ecommerce Site

Last updated 5 months ago

The following example is a request we've pre-built to show you Gaffa's capabilities against our You can run this request right now in the .

Gaffa converts web pages to clean markdown, stripping away styling, scripts, and images. This optimizes content for LLM applications by reducing token usage while preserving essential information.

API Request

The request below uses the to open the demo site on the article simulator, wait for the article to load and then generate a markdown from the page's content which you can download for use in your program.

{
  "url": "https://demo.gaffa.dev/simulate/article?loadTime=3&paragraphs=10&images=3",
  "proxy_location": null,
  "async": false,
  "max_cache_age": 0,
  "settings": {
    "record_request": false,
    "actions": [
      {
        "type": "wait",
        "selector": "article"
      },
      {
        "type": "generate_markdown"
      }
    ]
  }
}

Actions

Response

Here's an example of the PDF returned by the request after waiting for the article to load.

demo site.
Gaffa API Playground
POST endpoint
Wait
Generate Markdown
5KB
GaffaMarkdownExample.md