In the following pages you can view all the pre-built requests we've built to show what is possible with the Gaffa web automation API.
You can start using these in the API Playground once you've created an account.
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 pre-built to show you Gaffa's capabilities against our demo site. You can run this request right now in the Gaffa API Playground.
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.
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.
{
"url": "https://demo.gaffa.dev/simulate/article?loadTime=3¶graphs=10&images=3",
"proxy_location": null,
"async": false,
"max_cache_age": 0,
"settings": {
"record_request": false,
"actions": [
{
"type": "wait",
"selector": "article"
},
{
"type": "generate_markdown"
}
]
}
}
Here's an example of the PDF returned by the request after waiting for the article to load.
An example request that uses Gaffa to automate the completion of a form and waits for a success modal to appear.
The following example is a request we've pre-built to show you Gaffa's capabilities against our demo site. You can run this request right now in the Gaffa API Playground.
Filling forms is tedious, Gaffa can be used to fill out a form in a human-like manner so you can spend time doing much more interesting things.
The request below uses the POST endpoint to open the demo site on the form simulator page with some sections pre-filled (for speed). After typing in the required information and clicking submit, Gaffa waits for the success dialog to show before returning a video of the interaction.
{
"url": "https://demo.gaffa.dev/simulate/form?loadTime=3&showModal=false&modalDelay=0&formType=address&firstName=John&lastName=Doe&address1=123%20Main%20Street&city=London&country=UK",
"proxy_location": null,
"async": false,
"max_cache_age": 0,
"settings": {
"record_request": true,
"actions": [
{
"type": "type",
"selector": "#email",
"text": "johndoe@example.com"
},
{
"type": "type",
"selector": "#state",
"text": "CA"
},
{
"type": "type",
"selector": "#zipCode",
"text": "12345"
},
{
"type": "click",
"selector": "button[type='submit']"
},
{
"type": "wait",
"selector": "[role=\"dialog\"] h2:has-text(\"Success!\")",
"timeout": 10000
}
]
}
}
Here's a video showing Gaffa filling out the page and waiting for the success modal.
Read more about screen recording here (TODO).
An example request that uses Gaffa to convert an HTML page to a PDF. There are lots of HMTL to PDF API's but Gaffa handles it easily, as well as doing much more.
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's print to PDF feature allows you to export web pages as PDF files easily. Unlike the standard "Print to PDF" in your local browser, Gaffa's feature waits for specific items to load, uses proxies, and scales with your product's growth. Enhance your customer experience and streamline your PDF export process
The request below uses the to open the demo site on the table page, wait for the table to load and then print the webpage to a PDF in size A4 with a margin of 20 and using the portrait orientation.
Read the full documentation for these actions here.
Here's an example of the PDF returned by the request after waiting for the table to load.
{
"url": "https://demo.gaffa.dev/simulate/table?loadTime=3&rowCount=20",
"proxy_location": null,
"async": false,
"max_cache_age": 0,
"settings": {
"record_request": false,
"actions": [
{
"type": "wait",
"selector": "table"
},
{
"type": "print",
"size": "A4",
"margin": 20,
"orientation": "portrait"
}
]
}
}
An example request that uses Gaffa to dismiss a modal, scroll to the bottom of a page and then capture a full height screenshot.
The following example is a request we've pre-built to show you Gaffa's capabilities against our demo site. You can run this request right now in the Gaffa API Playground.
Gaffa can also capture screenshots at any point during your interaction for use in your app or just to work out exactly was being shown at a given point in time. You can capture just what is shown as if you were looking at the screen or the full height of the page.
The request below uses the POST endpoint to open the demo site on the ecommerce page with 20 items, wait for and dismiss the dialog, scroll to the bottom of the page and capture a full height screenshot.
{
"url": "https://demo.gaffa.dev/simulate/ecommerce?loadTime=3&showModal=true&modalDelay=0&itemCount=20",
"proxy_location": null,
"async": false,
"max_cache_age": 0,
"settings": {
"record_request": false,
"actions": [
{
"type": "wait",
"selector": "div[role=\"dialog\"]",
"timeout": 10000
},
{
"type": "click",
"selector": "[data-testid=\"accept-all-button\"]"
},
{
"type": "wait",
"selector": "[data-testid^=\"product-1\"]",
"timeout": 5000
},
{
"type": "scroll",
"percentage": 100
},
{
"type": "capture_screenshot",
"size": "fullscreen"
}
]
}
}
The export full height screenshot of the page showing all items.
An example request that uses Gaffa to infinitely scroll down a simulated ecommerce site whilst recording the interaction.
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 automates infinite scrolling on dynamic pages like e-commerce storefronts. Set a duration, and Gaffa will capture all content as it scrolls. Each session can be recorded as a video for playback, letting you debug or review the interaction.
The request below uses the to open the demo site on the ecommerce site simulator with an infinitely scrolling storefront. It will wait for and dismiss a dialog box, wait for a product to load and then scroll down the page for a maximum of 20 seconds - if new items load it will keep scrolling.
Here's a video showing Gaffa scrolling the page for 20 seconds as more items load.
Read more about screen recording here. (TODO)
{
"url": "https://demo.gaffa.dev/simulate/ecommerce?loadTime=3&showModal=true&modalDelay=0&itemCount=infinite",
"proxy_location": null,
"async": false,
"max_cache_age": 0,
"settings": {
"record_request": true,
"actions": [
{
"type": "wait",
"selector": "div[role=\"dialog\"]",
"timeout": 10000
},
{
"type": "click",
"selector": "[data-testid=\"accept-all-button\"]"
},
{
"type": "wait",
"selector": "[data-testid^=\"product-1\"]",
"timeout": 5000
},
{
"type": "scroll",
"percentage": 100,
"max_scroll_time": 20000
}
]
}
}