For the complete documentation index, see llms.txt. This page is also available as Markdown.

Actions

When making a Browser Request, you can specify a list of actions you want us to perform on the requested web page. These actions conform to the following format:

{
    "type": "", //the type of the action
    //other params follow as key value pairs
    "key": value //string, number, etc. 
}

Universal Parameters

All actions have the following parameters:

Name
Type
Required
Description

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

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 the previous action's 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

Type

click

Description

Click on a given element

Read More

Click

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

Scroll

Type

type

Description

Type the provided text into a given element

Read More

Type

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

Wait

Actions with outputs

Type

capture_cookies

Description

Save a JSON object of cookies for the current page

Read More

Capture Cookies

Type

capture_dom

Description

Export the raw DOM page data

Read More

DOM

Type

capture_screenshot

Description

Capture a screenshot of the web page

Read More

Screenshot

Type

capture_snapshot

Description

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

Read More

Snapshot

Type

download_file

Description

Download an online file using Gaffa

Read More

Download File

Type

generate_markdown

Description

Convert the page into markdown

Read More

Markdown

Type

generate_simplified_dom

Description

Generate a simplified version of the DOM

Read More

Simplified DOM

Type

parse_json

Description

Parse online data to a defined JSON schema

Read More

JSON Parsing

Type

print

Description

Print the web page to a PDF

Read More

Print

Last updated