arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

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.

The following example is a request we've prebuilt to demonstrate Gaffa's capabilities on our demo site.arrow-up-right You can run this request right now in the Gaffa API Playgroundarrow-up-right.

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

hashtag
API Request

The request below uses the POST endpoint 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.

hashtag
Actions

hashtag
Response

Here's an example of the PDF returned by the request after the article has loaded.

Waitchevron-right
Generate Markdownchevron-right
file-download
5KB
GaffaMarkdownExample.md
arrow-up-right-from-squareOpen
{
  "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"
      }
    ]
  }
}