Skip to main content

Quick Start

Get started with BrowserQL in minutes by following these steps:

  1. Sign Up

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

  2. Get API Key

    Get your API Key from the account dashboard.

    API Key Dashboard

  3. Access IDE

  4. Run Your First Query

    Copy and paste this example query into the IDE to scrape the first headline from Hacker News, and click play:

    mutation ScrapeHN {
    goto(url: "https://news.ycombinator.com", waitUntil: firstMeaningfulPaint) {
    status
    time
    }
    firstHeadline: text(selector: ".titleline") {
    text
    }
    }

    Click Run in the IDE to execute this query.

    Breaking this down, we're:

    • Defining we want to run a mutation and naming our script as ScrapeHN

    • Instructing a browser to goto the Hacker News site, and wait for the firstMeaningfulPaint event to fire

    • Asking to return both the time it took and the HTTP-code's status once the waitUntil has fired

    • Giving our action an alias, in this case firstHeadline

    • Extracting the text of a specified selector

  5. Check Output

    The result will be a JSON response:

    {
    "data": {
    "viewport": {
    "width": 1366,
    "height": 768,
    "time": 2
    },
    "goto": {
    "status": 200,
    "time": 1467
    },
    "firstHeadline": {
    "text": "Rust cross-platform GPUI components (github.com/longbridge)"
    }
    }
    }
tip

Don't worry if you're new to GraphQL! BQL's syntax is intuitive, and you can learn as you go. Check out the Language Basics section to understand GraphQL concepts in BQL.

Exporting Your Query

You can export your BrowserQL queries and run them programmatically in your application. Learn how to export and use queries in your code.

Next Steps

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