Skip to main content

Getting Started with BQL

To begin using BQL:

  1. Sign up for a Browserless account (free plan available).

  2. Get your API Key from the account dashboard.

  3. Access the BQL web editor: https://account.browserless.io/bql.

  4. Use built-in code export feature of the BQL IDE that converts your GraphQL queries into multiple programming languages.

Requirements

BrowserQL does not require any additional CLI tools, local runtime, or libraries other.

BQL Connection URL Builder

Connection URL:

https://production-sfo.browserless.io/chromium/bql?token=YOUR_TOKEN

Code Snippet:

const response = await fetch('https://production-sfo.browserless.io/chromium/bql?token=YOUR_TOKEN', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    query: `mutation MyQuery($url: String!) {
      goto(url: $url) {
        status
      }
      # Add more BQL operations here
    }`,
    variables: { url: 'https://example.com' }
  }),
});
tip

Don't worry if you're new to GraphQL! BQL's syntax is intuitive, and you can learn as you go. The examples throughout this documentation will teach you everything you need. To start with that we just listed some important stuff below.

GraphQL Basics for BQL

BrowserQL uses GraphQL as its query language. If you're new to GraphQL, here are the key concepts you need to know:

Mutations vs Queries

  • Mutations: Actions that change state (like navigating, clicking, typing). In BQL, everything is a mutation because all actions happen inside the browser.
  • Queries: Read-only operations (not used in BQL since browser automation requires actions).

Basic GraphQL Syntax

Every BQL script follows this pattern:

mutation ScriptName {
actionName(arguments) {
responseFields
}
}

Key GraphQL Concepts in BQL

  • Arguments: Parameters you pass to actions (like url: "https://example.com")
  • Response Fields: Data you want back (like status, time, text)
  • Aliases: Custom names for actions (like firstClick: click(...))

Learn More About GraphQL

Next Steps

Ready to start building with BrowserQL? Explore these key areas to maximize your browser automation capabilities: