Only this pageAll pages
Powered by GitBook
1 of 28

Documentation

Loading...

Loading...

Loading...

Loading...

Features

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

API Reference

Loading...

Loading...

Loading...

Loading...

Introduction

What is Gaffa?

Gaffa is a powerful API for browser automation which allows you to control real web browsers at scale through a simple interface with no configuration necessary. We'll handle the complexities of managing infrastructure like virtual machines, proxies and caching so you can focus on building powerful and reliable web automation and AI applications!

Key features

Gaffa is ready to power your web automations:

  • Simplicity - there's no need to learn another new framework, Gaffa is accessible through a simple REST API - just tell it what site you want to visit and what actions you want to perform and it will be carried out as soon as you send the request.

  • Real browsers - headless browsers are popular but we make it simple to control real cloud-hosted browsers at scale which render JavaScript sites exactly as they would on a local machine, are harder to detect when doing scraping and allow full observability. We're also planning to allow you to go beyond just being able to control web browsers!

  • Proxies - you can easily choose to route your traffic through a network of residential proxy IP addresses to help avoid bot-detection on sites you are trying to automate.

  • Scalable - whether you want to control a single cloud browser or 100s in parallel with Gaffa you can do that easily without one thought about infrastructure management.

Ready to work with Gaffa?

Stay up to date

Powerful data processing - once you've accessed your desired site you can export your data in a constantly growing number of formats. If you want the to feed into a large language model or to feed into a vision modal we can help.

We'll be sporadically announcing updates and new features in our newsletter - .

API Playground

Start experimenting with the Gaffa API right now.

Get Started

The simple steps to get you started using Gaffa in your apps.

API Reference

Explore the API and docs for the finer details

page content in markdown
an image
Get Started
sign up here

Get Started

An introduction to the Gaffa Browser API. Learn how you can get started building fast, powerful web automations!

1

Create an account

Accessing the open web

When you're ready to use Gaffa on the open web you'll need to choose a plan suitable for your needs and pay at which point the full internet will be available for you to automate.

2

Making your first browser request

Gaffa API Playground examples

Here are all the sample requests we've created for use in the API Playground.

3

Building your own browser requests

Credits and Pricing

Browser Requests

Browser requests are charged in terms of credits based on the following factors:

  • Request length: Billed at 1 credit per 30 seconds the request takes to run on the browser.

    • If screen recording is enabled, this is doubled to 2 credits per 30 seconds.

  • Proxy bandwidth usage: All requests that use a proxy_location parameter use our network of residential proxies and are billed at 1500 credits per 1GB of bandwidth used.

Each successful request will deduct the corresponding number of credits from your monthly allowance. Be sure to use as many of your monthly credits as you want as they don't roll over month to month.

Welcome to the Gaffa documentation site! You'll find everything you need here to get started using API including , you can use to interact with our cloud browsers and you can run right away in our API Playground.

Gaffa is currently in it's very early stages, so we'd love to hear how we can improve our docs and API to make life easier for our users. If you have any questions or comments please or us . To stay up to date with latest developments, features and news on mission to support the development of revolutionary AI Agents, sign up to sporadic updates.

You can sign up to create a Gaffa account . After signing up you'll immediately be able to use the API to start using our which has a number of pre-built automations for simulating a range of scenarios.

In order to avoid scaling issues for our existing customers we are currently operating a queuing system for new accounts. Simply join the queue when prompted on your and we'll let you know when you have access. If you want to jump the queue, you can fill out a short survey to help us better understand our users and we'll approve your account sooner!

The easiest way to make your first Gaffa is to start using our where you can see several pre-made and interactive browser request examples of automations we've built against our test site which simulates some common scraping and web automation scenarios. You can run these examples without a paid account and also edit them easily to experiment - once you have a paid account you can also use the playground to build your automations for other sites.

Once you have a paid account and are ready to start building your own browser requests you'll want to read about all the other you can use for your solution as well as how you can easily use , as well as the .

View our current pricing plans on the Gaffa

interactive API definitions
a comprehensive list of actions
breakdowns of our example requests
email us
the support tool on our site
newsletter
here
API Playground
our demo site
account dashboard
browser request
API Playground

Print to PDF

Export a web page to PDF and wait for elements to load with the Gaffa API.

Convert to Markdown

Export a web page to markdown format - useful feeding into LLM apps.

Infinitely Scroll

Scroll the bottom of a page that infinitely loads items and record the interaction.

Capture Screenshot

Interact with a page and capture the a screenshot of the whole page.

Form Completion

Fill out a form in a human-like way and record the interaction

homepage

Changelog

April 2025

02.04.2025

  • Subscriptions and Credits

    • You can now buy "pay as you go" credits to be used without a subscription, or to complement the credits in your subscription for larger one-off jobs.

  • Actions

March 2025

17.03.2025

  • Proxies

  • Actions

  • Settings

  • Stealth

    • We've developed some new browser technology which makes Gaffa's browser look even more like human-initiated website traffic.

Capture DOM

Type: capture_dom

This action will capture and return the raw dom of the site which you can then extract data from on your end.

Parameters

Usage

Capture the raw DOM of the current page

"actions": [
    {
      "type": "capture_dom"
    }
]

Example Output

Click

Type: click

Request that the browser clicks a particular element on the page.

Parameters

Name
Type
Required
Description

selector

string

timeout

integer

The maximum amount of time the browser should wait for the element defined by the selector to appear. Default: 5000 (5s)

Usage

Click an element on the page

The following code will wait 1 second and then continue with the next action, if provided.

"actions": [
    {
      "type": "click",
      "selector": "a.header__logo"
    }
]

Wait for a particular element to appear

The following code will wait for the logo to appear for a maximum of 5 seconds and it will continue with the list of actions

"actions": [
      {
        "type": "wait",
        "selector": "a.header__logo",
          "timeout": 5000,
          "continueOnFail": true
      }
]

Generate Markdown

Type: generate_markdown

The markdown output format can export the data of the page (an article, table etc.) in a human and LLM readable format which removes unnecessary styling data and other "junk" that is only relevant for the site to work properly.

Parameters

Usage

The following converts the current page to markdown:

"actions": [
    {
        "type": "generate_markdown"
    }
]

Example Output

Generate Simplified DOM

Type: generate_simplified_dom

When you're looking at the DOM of a web page, there's a lot of unnecessary data that can be discarded if you are only interested in the page's elements or looking to export the data into a LLM. The generate_simplified_dom output format processes the HTML in the following way:

  • Removes all links in the head

  • Removes all script nodes and links to scripts

  • Removes all style nodes

  • Remove style attributes from all elements

  • Remove all links to stylesheets

  • Remove all noscript elements outside of the body

  • Finds all hrefs with query strings and removes the query strings

  • Important meta tags are kept, all others are removed

  • Remove all alternate links

  • Remove all SVG paths

  • Remove empty text nodes and excessive spacing

Parameters

Usage

The following JSON captures the DOM of the page and simplifies it.

"actions": [
    {
        "type": "generate_simplified_dom"
    }
]

We are actively working to improve this and to make this process more configurable - let us know if there's something you think we can improve.

Example Output

Print

Type: print

Request that the browser prints the page to a PDF.

Parameters

Name
Type
Required
Description

size

string

The size of paper the page should be printed to. Default: A4 Accepted: ["A4"]

margin

integer

The margin of the page in pixels when the page is printed to PDF. Default: 20

orientation

string

Should execution of further actions continue or throw an error if this action fails. Default: portrait Accepted: ["portrait", "landscape"]

continue_on_fail

boolean

Should execution of further actions continue or throw an error if this action fails. Default: true

Usage

Print a page in landscape to PDF

The following JSON prints the page to a PDF in landscape with margins of 20px.

"actions": [
    {
        "type": "print",
        "page_size": "A4",
        "orientation": "landscape",
        "margin": 20
    }
]

Example Output

Type

Type: type

Request that the browser type a particular bit of text into a field.

Parameters

Name
Type
Required
Description

selector

string

text

string

The text the browser should enter into the text field.

timeout

integer

The maximum amount of time the browser should wait for the element that needs to be typed in to appear. Default: 5000 (5s)

Sites that use more advanced bot detection often use keyboard events to detect unusual activity on their site, rather than immediately dropping all characters of the text into a field our platform types the text in a human-like manner.

Usage

Type into a text box

The following action will type into a particular text field.

"actions": [
      {
            "name": "type",
            "selector": "#postform-text",
            "text": "Hello world!"
      }
]

Wait for an element to appear before typing

The following code will wait a maximum of 10 seconds for the email input to appear in the field and then type in the provided email.

"actions": [
      {
         "name": "type",
         "selector": "form input[name="email"]",
         "text": "test@test.com"
         "timeout": 10000
      }
]

Export Web Page to PDF

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.

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

API Request

{
  "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"
      }
    ]
  }
}

Actions

Read the full documentation for these actions here.

Response

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

GET v1/browser/request/{id}

The following endpoint allows you to query browser request for your account by ID.

API Authentication

We use API Keys for authenticating requests to our API. In this document we'll explain how you can manage and use the keys for your account.

Creating Keys

You can create as many keys as wish but always remember to treat the key as a secret and do not reveal in public blog posts or GitHub repositories. If someone uses your key to make requests with your leaked key we won't be responsible!

Deleting Keys

If you are worried you have exposed your Gaffa API key or just want to periodically rotate your keys you can create another key and then delete your old keys. Deleted keys will immediately stop working for new requests to the API but past browser requests made using old keys will still be available.

Authenticating Requests

Our API is secured with a customer header X-API-Key whose value should be any current API key in your account. That's all you need to add to your request!

Capture Screenshot

Type: capture_screenshot

Takes a screenshot of the current page. You can choose to take a full screen screenshot showing the whole page or just the current view.

Parameters

Usage

The following captures the current section of the page currently visible in the browser.

Example Output

An example screenshot in fullscreen mode.

Capture Snapshot

Type: capture_snapshot

This output type will return a HTML file which captures a static version of the page state. The page will load offline and can be saved to your local machine.

This will:

  • Load and embed all images on the page.

  • Embed all css files

Currently, Javascript will be disabled and interactivity might not worked as expected but this feature should be useful for preserving the page state as it was and allowing you to view it offline.

Parameters

Usage

The following captures the current section of the page currently visible in the browser.

Example Output

Here's an example that shows an offline snapshot of a site

API Playground Examples

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.

POST v1/browser/request

The following endpoint creates a browser request and either runs it synchronously or returns immediately with an ID so you can check it status later using this endpoint.

GET v1/browser/requests

The following endpoint allows you to query for multiple browser requests, either by status or a list of particular ids, submitting a request with neither of these will return all requests for your account.

actions
other endpoints that are part of the API

Keep up to date with Gaffa's changes. To be the first to hear about changes subscribe to our .

We've adjusted the plans and credits slightly, take a look at the .

We've edited the , and actions to better support finding elements to interact with or wait for inside iframes with no extra configuration necessary.

We have added support for another European location,

action no longer removes classes.

default timeout now 5 seconds

removed timeout and add new functionality using wait_time, max_scroll_time, scroll_speed and interval

default timeout now 5 seconds

default timeout now 5 seconds

caps media downloads to prevent excess data usage.

added to cap the duration of requests.

For common AI scenarios you may find this returns too much data so we have provided a action which distills the DOM to only the important elements.

See .

The that defines the page element that the browser should click on.

See .

Gaffa exports with comments removed and unknown tags ignored.

See .

See .

See .

The that defines the page element that the browser should click on.

See .

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 .

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.

For more information on browser requests, .

Once your account is approved, you will need to create an API key to send your requests to our API. Go to your account and create a new key with a name. Once the key is created, copy the value and you will immediately be free to start using it to make requests.

Name
Type
Required
Description

See .

See

You can start using these in the once you've created an account.

For more information on browser requests, .

For more information on browser requests, .

newsletter
updated subscriptions
Click
Type
Wait
Simplified DOM
Click
Scroll
Type
Wait
generate_simplified_dom
GitHub flavoured markdown
demo site.
Gaffa API Playground
POST endpoint
Wait
Print
see here
Dashboard > API Keys

size

string

The size of paper the page should be printed to. Default: view Accepted: ["view", "fullscreen"]

"actions": [
    {
        "type": "capture_screenshot",
        "size": "view"
    }
]
"actions": [
    {
        "type": "capture_snapshot",
    }
]
selector
selector
API Playground
see here
see here

Wait

Type: wait

Request that the browser waits a given amount of time or for a particular item to appear on the page.

Parameters

Name
Type
Required
Description

time

integer

The time in milliseconds that the browser should wait.

selector

string

timeout

integer

The maximum amount of time the browser should wait for the provided selector to appear. Default: 5,000 (5s)

Usage

Wait for a particular amount of time

The following code will wait 1 second and then continue with the next action, if provided.

"actions": [
      {
        "name": "wait",
        "time": 1000,
      }
]

Wait for a particular element to appear

The following code will wait for a table to appear on the page for a maximum of 5 seconds. If the table has not appeared after 5 seconds the next action will be executed, if provided.

"actions": [
      {
        "name": "wait",
        "selector": "table",
        "timeout": 5000,
        "continueOnFail": true
      }
]

Capture a Full Height Screenshot

An example request that uses Gaffa to dismiss a modal, scroll to the bottom of a page and then capture a full height screenshot.

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.

API Request

{
  "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"
      }
    ]
  }
}

Actions

Response

The export full height screenshot of the page showing all items.

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.

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

{
  "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.

Actions

Universal Parameters

All actions have the following parameters:

Action Execution

Actions are carried out in the order they are submitted. Every action type has a continue_on_fail parameter which defaults to false, this means that if any action fails the execution of the browser request ends and an error will be returned. Setting continue_on_fail to true ensures that all actions are carried out, regardless of previous action results and an error will not be returned.

Custom Id

As shown above, you can submit a customId with each action you submit to the API. We'll include this Id in the outputs from the browser request so you can find a certain action's output and/or status easily in the response.

Response Format

When a browser request has completed, information on an action's execution

Supported Actions

The Gaffa API supports the following actions detailed below. Click the "read more" buttons to read more information about each type.

Actions without outputs

Actions with outputs

Scroll

Type: scroll

Request that the browser scrolls to a certain point on the page or, in the case of pages with infinite scrolling, scrolls for a particular amount of time.

Parameters

Scroll Speed & Interval

Gaffa gives you a flexibility about how fast you scroll down the page which can be really useful to get around restrictions enforced by some sites which detect and limit fast scrolling. By experimenting with scroll_speed and interval you will be able to create the perfect scrolling action for your scenario. The speed settings are as follows:

  • instant- the page will smoothly scroll to the desired position immediately, useful for sites with no rate limits or loading events caused by scroll actions.

  • medium - human-like scrolling at a normal speed to the desired position. Gaffa will scroll in much the same way as you would using a mouse.

  • slow- human-like scrolling at a very slow speed to the desired position. The speed is comparable to scrolling whilst reading a page.

intervalallows you to adjust the scroll speed further by inserting pauses between scroll events.

We've found some sites with infinite scrolling and strict rate limits respond better to immediate speed scroll events to the bottom of the page with large intervalsbetween these scrolls to keep within rate limits.

Wait Time

If wait_time is set to 0 and Gaffa arrives at the desired location then Gaffa will immediately mark the action as succeeded. However, if another value is set then the page will be monitored for the desired amount of time to check for further expansions. If, during this period, the page expands again then Gaffa will continue scrolling to the desired location and the wait will reset.

This can be really useful if you find that the site takes some time to load more items when you reach the bottom of the page and more will be loaded after the action has suceeded.

Usage

Scroll a particular percentage down the page

The following code will scroll half way down the page.

Scroll an infinitely scrolling webpage

The following code will scroll to the bottom of the page and then keep scrolling when new content loads for a maximum of 25 seconds, waiting 1 second for new content and scrolling at a slow pace with 1 second between scroll actions.

Infinitely Scroll an Ecommerce Site

An example request that uses Gaffa to infinitely scroll down a simulated ecommerce site whilst recording the interaction.

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.

API Request

Actions

Response

Here's a video showing Gaffa scrolling the page for 20 seconds as more items load.

Read More

Read more about screen recording here. (TODO)

Automated Form Filling

An example request that uses Gaffa to automate the completion of a form and waits for a success modal to appear.

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.

API Request

Actions

Response

Here's a video showing Gaffa filling out the page and waiting for the success modal.

Read More

Read more about screen recording here (TODO).

The that defines the page element that the browser should wait to appear.

See .

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 .

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

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 .

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.

When you can specify a list of actions you wish for us to carry out on the requested web page. These actions conform to the following format:

Name
Type
Required
Description
Name
Type
Required
Description

See .

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 .

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.

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 .

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

demo site.
Gaffa API Playground
POST endpoint
Wait
Click
Scroll
Capture Screenshot
demo site.
Gaffa API Playground
POST endpoint
Wait
Generate Markdown
{
    "type": "", //the type of the action
    //other params follow as key value pairs
    "key": value //string, number etc. 
}

type

string

The type name of the action.

continue_on_fail

boolean

Should execution of further actions continue or throw an error if this action fails. Default: false

customId

string

A customId to help you find the action in the response. Default: null

{
    "id": "", //a unique id given to the action by Gaffa
    "type": "capture_screenshot", //the type of the action
    "query": "", //a representation of the action in querystring format
    "timestamp": "", //the UTC timestamp the action was executed
    "output": "" //if the action has an output you will find a url for this here,
    "error": "" //if the requesst fails the error message will be returned here
}
universal parameters
universal parameters
universal parameters
universal parameters
universal parameters
universal parameters
universal parameters
universal parameters
universal parameters
"actions": [
      {
        "name": "scroll",
        "percentage": 50,
      }
]
"actions": [
      {
        "name": "scroll",
        "percentage": 100,
        "scroll_speed": "slow",
        "max_scroll_time": 25000,
        "interval": 1000,
        "wait_time": 1000
      }
]
{
  "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
      }
    ]
  }
}
{
  "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
      }
    ]
  }
}
13KB
GaffaDOMSample.txt
5KB
GaffaMarkdownExample.md
selector
making a Browser Request
demo site.
Gaffa API Playground
POST endpoint
Wait
Click
Scroll
Get Started
demo site.
Gaffa API Playground
POST endpoint
Type
Click
Wait
universal parameters
6KB
GaffaSimplifiedDOMSample.txt
51KB
GaffaPrintPdfExample.pdf
pdf
51KB
GaffaPrintPdfExample.pdf
pdf
Type

click

Description

Click on a given element

Read More
Type

scroll

Description

Scroll to a particular point on the page or, in the case of pages with infinite scrolling, scroll until a given time has elapsed.

Read More
Type

type

Description

Type the provided text into a given element

Read More
Type

wait

Description

Wait for a given time to elapse or an element to appear on page before proceeding to the next action.

Read More
Type

capture_dom

Description

Export the raw DOM page data

Read More
Type

capture_screenshot

Description

Capture a screenshot of the web page

Read More
Type

generate_markdown

Description

Convert the page into markdown

Read More
Type

generate_simplified_dom

Description

Generate a simplified version of the DOM

Read More
Type

capture_snapshot

Description

Create a completely static version of the web page which can be accessed offline

Read More
Type

print

Description

Print the web page to a PDF

Read More

percentage

integer

The percentage the page should scroll up or down (+/-) Range: [-100 - 0 - 100] Default: 100 (% - scroll to bottom)

wait_time

integer

max_scroll_time

integer

The maximum amount of time the page should be scrolled for, in milliseconds. After this time passes, the action will be cancelled. This doesn't cause the action to fail. Default: 20,000 (20s)

scroll_speed

string

interval

integer

After arriving at the desired scroll location this the time Gaffa should monitor for changes to the page height before marking the action as succeeded. Read more . Default: 0

The speed which the page should scroll to the desired point. You can read more about this . Default: medium Accepted: [slow, medium, instant]

The amount of time, in milliseconds, that scrolling should pause between scroll events. Read more about this . Default: 0

below
below
below
518KB
GaffaSnapshotSample.mhtml
Gaffa's full height screenshot
Click
Scroll
Type
Wait
DOM
Screenshot
Markdown
Simplified DOM
Snapshot
Print
proxy servers
our cache
France
max_media_bandwidth
time_limit
5KB
GaffaMarkdownExample.md

Browser Requests

Making web automation requests has never been so simple.

Browser Requests are our first main product and allow you to send the Gaffa API a URL and a list of actions you want to be carried out, including any outputs you want from the page. We'll carry out the request on our cloud browsers and return you the response with no need to worry about proxies, IP rotation, web automation frameworks and scaling.

There's absolutely zero configuration needed and you can interact with Gaffa from any program that can send web requests. We think it's by far the simplest way to automate simple web tasks and the good news is, we're just getting started and have much more planned.


Example request

{
  "url": "https://demo.gaffa.dev/simulate/table?loadTime=3&rowCount=20",
  "proxy_location": null,
  "async": false,
  "max_cache_age": 0,
  "max_media_bandwidth": null,
  "settings": {
    "record_request": false,
    "actions": [
      {
        "type": "wait",
        "selector": "table"
      },
      {
        "type": "print",
        "size": "A4",
        "margin": 20,
        "orientation": "portrait"
      }
    ]
  }
}

Proxy servers

Gaffa makes proxying your traffic through a global network of residential proxies super simple. Setting proxy_location in your request will allow you to utilize one of our partner third party proxy services to gain local access to a site.

Not setting a proxy_location will mean the request does not use a proxy server and will use a generic datacenter IP.

Available Locations

Proxy Server Location
Country Code

United States

us

Ireland

ie

Singapore

sg

France

fr

At the moment all our servers are in one location but we aim to introduce local machines to our proxy locations for a more realistic end-user load times. If this would interest you please contact support.

IP Types

Currently all our IP addresses are residential IP addresses which are procured through reputable third parties.

IP Rotation

IP rotation is an essential part of any web data, scraping or automation task. In Gaffa, each browser request is treated as unique. We regularly rotate the IP addresses used so you should assume that each request will be carried out from a different IP address from the last.

We are working to supporter a greater range of IP address scenarios, like static IPs in the future, as well as more trusted proxies for requests that require enhanced levels of security (logins etc.)

Restrictions

Whilst we'll do our best to provide access to as wide a range of sites as possible we may have to restrict access to certain sites to prevent abuse of our service or of other services. Our proxy partners may also enforce restrictions on certain sites and categories of sites which we don't have any control over.


Caching

When we were building Gaffa we noticed that a lot of pre-existing scraping tools don't allow users to easily share their scraped web data with each other, despite many users requesting the same web pages on the same sites. Not only is this a waste of a user's allowance, it also puts a burden on the site owners who are serving the same data to different users for the same purpose. Because of this in Gaffa we have created a service-wide cache.

How it works

When making a browser request you can provide a MaxCacheAge parameter which is a number in seconds equal or greater than 0. This values denotes the maximum age of data you would accept from the API. If another user of our service has requested the same URL with exactly the same parameters and actions as you in this chosen timeframe then the response will be returned to you immediately and the response will not be carried out on one of our browsers. If there are multiple identical requests in the given timeframe then the most recent will be returned. This will save you time waiting for the response, as well as credits, because requests returned from the cache don't use any bandwidth.


Screen Recording

By specifying record_request you can ask Gaffa to screen record your automation and return a video in the response allowing you to view the magic happening or to debug your automation.


Max Media Bandwidth

If you are using Gaffa on a site with lots of images and videos and more interested in the text data on the page, you can cap how much data a page loads in MB using the max_media_bandwidth setting. This makes your automation faster and prevents spending credits on data you aren't interested in. With the max_media_bandwidth value set, Gaffa monitors data being downloaded by the page and when downloaded data exceeds the given number of MB, all further downloads of images or video will be cancelled. max_media_bandwidth defaults to null meaning downloads are not capped.

Setting a value of 0 will cause no images to load which can work on some sites but on others this could lead to the site thinking you are using an ad blocker.


Time Limit

Using the setting time_limit caps the maximum running time of the request in milliseconds. If this time expires all incomplete actions will be cancelled and the request will return an error. This cap has to be less than the maximum request running time dictated by your plan and if not set, will default to this value.


Actions


Stealth

We believe your AI Agents should be able to use the internet exactly how humans would. Gaffa can help you get access to sites with some of the most challenging anti-bot restrictions using a combination of proxies, human-like behavior, captcha solving and a custom browser implementation. We handle and maintain all of that so you can focus on building your solution!


Examples


API Endpoints

Running a new browser request is as simple as sending the following . Below, you can see the url () and a list of actions which instruct Gaffa to wait for a table to load and print the page to PDF.

You can read more about this particular example and how you can run it right now in our API Playground

In order to access public sites and use proxy servers you'll need to sign up for a but after that you'll be able to build automations for any site you wish.

Recording requests comes at an .

We currently support ten different types of actions which you can read more about .

We've created a number of sample browser requests you can read about or you can jump straight into the to start running them right now.

Check out our API reference for more details about the endpoints available, particularly .

POST body to our endpoint
our demo site
here
paid account
additional cost
here
here
API Playground
those you can use to query for past requests by id or status
Gaffa scrolling to the bottom of a simulated ecommerce page!
Gaffa can help automatically fill out your forms!

Get a browser request by ID

get

This endpoint retrieves a browser request by its ID.

Authorizations
Path parameters
idstringRequired

The unique identifier of the browser request to retrieve.

Query parameters
idstringRequired

The unique identifiers of the browser request to retrieve.

Responses
200
The browser request
application/json
404
Browser request not found
application/json
get
GET /v1/browser/requests/{id} HTTP/1.1
Host: api.gaffa.dev
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "id": "text",
  "url": "text",
  "proxy_location": "text",
  "state": "text",
  "credit_usage": 1,
  "error": "text",
  "error_reason": "text",
  "actual_url": "text",
  "http_status_code": 100,
  "from_cache": true,
  "started_at": "2025-06-04T04:43:09.523Z",
  "completed_at": "2025-06-04T04:43:09.523Z",
  "running_time": "text",
  "page_load_time": "text",
  "actions": [
    {
      "id": "text",
      "type": "text",
      "query": "text",
      "custom_id": "text",
      "timestamp": "2025-06-04T04:43:09.523Z",
      "output": "text",
      "reference": "text",
      "error": "text"
    }
  ],
  "video": "text"
}

Create a new browser request

post

This endpoint loads the required URL in our browser and then performs the selected actions.

Authorizations
Body
proxy_locationstring | nullableOptional

The location of the proxy server that your request will be routed through, null means no proxy is used

Default: null
urlstringOptional

The url you want our browsers to visit on your behalf

asyncbooleanOptional

Whether the request should be processed asynchronously, synchronous requests can be maximum 60 seconds long.

Default: true
max_cache_ageinteger · int32 | nullableOptional

The maximum age of a cached result in seconds. 0 means the cache will never be used

Default: 0
Responses
200
The browser request response detailing the state and output of the request
application/json
408
The browser request timed out - an example error
application/json
post
POST /v1/browser/requests HTTP/1.1
Host: api.gaffa.dev
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 334

"{\"proxy_location\":null,\"url\":\"https://demo.gaffa.dev/simulate/table?loadTime=3&rowCount=20\",\"async\":false,\"max_cache_age\":0,\"settings\":{\"record_request\":false,\"actions\":[{\"type\":\"wait\",\"selector\":\"table\"},{\"type\":\"print\",\"size\":\"A4\",\"margin\":20}],\"time_limit\":60000,\"max_media_bandwidth\":null}}"
{"data":{"id":"brq_V2P6PqrZpycFtbc7mtXE4tsNbeg2N6","url":"https://demo.gaffa.dev/simulate/table?loadTime=3&rowCount=20","proxy_location":null,"state":"completed","credit_usage":1,"error":null,"error_reason":null,"actual_url":null,"http_status_code":200,"from_cache":false,"started_at":"2024-11-22T14:33:38.7762685+00:00","completed_at":"2024-11-22T14:33:42.7135779+00:00","running_time":null,"page_load_time":"00:00:00.1902889","actions":[{"id":"act_V2P6Q3fSHhBWAhf4BQJxj9oYbQF1V9","type":"wait","query":"wait?selector=table&timeout=20000&continue_on_fail=True","custom_id":null,"timestamp":"2024-11-22T14:33:38.9665719+00:00","output":null,"reference":null,"error":null},{"id":"act_V2P6Q6BuQhoYDAVkQMVSKkkwmUrArb","type":"print","query":"print?size=A4&margin=20&orientation=portrait&continue_on_fail=True","custom_id":null,"timestamp":"2024-11-22T14:33:42.3025888+00:00","output":"https://storage.gaffa.dev/brq/pdf/brq_V2P6PqrZpycFtbc7mtXE4tsNbeg2N6/....","reference":null,"error":null}],"video":null},"error":null,"httpCode":0}

Get multiple browser requests

get

This endpoint retrieves browser requests in bulk by id or status.

Authorizations
Query parameters
idsstringOptional

The unique identifiers of the browser requests to retrieve.

Example: {"value":"brq_V2P6PqrZpycFtbc7mtXE4tsNbeg2N6,brq_V2P6X38RDRMRyYcNJ82qPSH5eFfQRD"}
statusstringOptional

The statuses of the browser requests to filter by. Valid values: pending, running, completed, failed

Example: {"value":"completed,running"}
pageSizeinteger · int32Optional

Items to return per page (default: 30).

Example: {"value":20}
pageinteger · int32Optional

Page number of the pagination (default: 1).

Example: {"value":1}
Responses
200
A collection of browser requests that match the criteria
application/json
400
Invalid query parameters
application/json
get
GET /v1/browser/requests HTTP/1.1
Host: api.gaffa.dev
X-API-Key: YOUR_API_KEY
Accept: */*
{"data":{"total_pages":1,"total_records":2,"results":[{"id":"brq_V2PUfFA8AQPAQ5VEsewpxdGUSZkgKP","url":"https://demo.gaffa.dev/simulate/table?loadTime=3&rowCount=20","proxy_location":null,"state":"completed","credit_usage":4,"error":null,"error_reason":null,"actual_url":null,"http_status_code":200,"from_cache":false,"started_at":"2024-11-22T16:31:13.128103+00:00","completed_at":"2024-11-22T16:31:47.020851+00:00","running_time":null,"page_load_time":"00:00:03.4705813","actions":[{"id":"act_V2PUfETiTdXwzEgAW2NPURnATW7we9","type":"wait","query":"wait?selector=.loadingSelector&timeout=20000&continue_on_fail=True","custom_id":null,"timestamp":"2024-11-22T16:31:16.6080484+00:00","output":null,"reference":null,"error":null},{"id":"act_V2PUfBreQxHR2SNqGXuPzzWoiyRsrm","type":"print","query":"print?size=A4&margin=20&orientation=landscape&continue_on_fail=True","custom_id":null,"timestamp":"2024-11-22T16:31:40.5760333+00:00","output":"https://storage.gaffa.dev/brq/pdf/brq_V2PUfFA8AQPAQ5VEsewpxdGUSZkgKP/act_V2PUfBreQxHR2SNqGXuPzzWoiyRsrm.pdf","reference":null,"error":null}],"video":"https://storage.gaffa.dev/brq/video/brq_V2PUfFA8AQPAQ5VEsewpxdGUSZkgKP.mp4"},{"id":"brq_V2NmHY9FsvPQEGbfVBSeV6UCp2SXjC","url":"https://demo.gaffa.dev/simulate/article?loadTime=3&paragraphs=10&images=3","proxy_location":null,"state":"completed","credit_usage":1,"error":null,"error_reason":null,"actual_url":null,"http_status_code":200,"from_cache":false,"started_at":"2024-11-22T12:52:48.708264+00:00","completed_at":"2024-11-22T12:52:54.25994+00:00","running_time":null,"page_load_time":"00:00:00.8094888","actions":[{"id":"act_V2NmHijnQa9iPDNcvhjS2GGFt5se8j","type":"wait","query":"wait?selector=article&timeout=20000&continue_on_fail=True","custom_id":null,"timestamp":"2024-11-22T12:52:49.5690537+00:00","output":null,"reference":null,"error":null},{"id":"act_V2NmHgs27VJKB49YavtK4CcyErdfvD","type":"generate_markdown","query":"generate_markdown?continue_on_fail=True","custom_id":null,"timestamp":"2024-11-22T12:52:52.8353136+00:00","output":"https://storage.gaffa.dev/brq/md/brq_V2NmHY9FsvPQEGbfVBSeV6UCp2SXjC/act_V2NmHgs27VJKB49YavtK4CcyErdfvD.md","reference":null,"error":null}],"video":null},{"id":"brq_V2HvS2cw4Z2wonqEAwbxoxjrkmRdEM","url":"https://demo.gaffa.dev/simulate/article","proxy_location":null,"state":"failed","credit_usage":0,"error":null,"error_reason":null,"actual_url":null,"http_status_code":null,"from_cache":false,"started_at":null,"completed_at":null,"running_time":null,"page_load_time":null,"actions":null,"video":null}],"page":1,"page_size":30},"error":null,"httpCode":0}