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
  • Universal Parameters
  • Response Format
  • Supported Actions
  • Actions without outputs
  • Actions with outputs
Export as PDF
  1. Features
  2. Browser Requests

Actions

PreviousBrowser RequestsNextCapture DOM

Last updated 3 months ago

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:

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

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

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

Type
Description
Read More
Type
Description
Read More
Type
Description
Read More
Type
Description
Read More
Type
Description
Read More
Type
Description
Read More
Type
Description
Read More
Type
Description
Read More
Type
Description
Read More
Type
Description
Read More
making a Browser Request

click

Click on a given element

scroll

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

type

Type the provided text into a given element

wait

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

capture_dom

Export the raw DOM page data

capture_screenshot

Capture a screenshot of the web page

generate_markdown

Convert the page into markdown

generate_simplified_dom

Generate a simplified version of the DOM

capture_snapshot

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

print

Print the web page to a PDF

Click
Scroll
Type
Wait
DOM
Screenshot
Markdown
Simplified DOM
Snapshot
Print