> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extractbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Query

Defines all available queries to retrieve information from the web environment.
The primary query is `page`, which serves as the entry point to interact with web pages.

## Definition

```graphql theme={null}
object Query {
  page(
    url: URL
    content: String
    options: PageOptions
  ): Page!
}
```

## Fields

### `page`

[Page!](/reference/graphql/objects/page)

Accesses a page by navigating to a URL, loading HTML content, or returning the current page.
This is the primary entry point for interacting with web pages,
so you may want to create a page as the first step in your query or mutation.

* If `url` is provided, navigates to that URL.
* If `content` is provided, creates a new page with that HTML content.
* If neither `url` nor `content` is provided, returns the currently active page, if any.

Page options can be specified to configure aspects like viewport, user agent, headers, etc.

## Examples

<CodeGroup>
  ```graphql Navigate to URL theme={null}
  query {
    page(
      url: "https://example.com",
      options: { userAgent: "MyCustomBrowser/1.0" }
    ) {
      content
    }
  }
  ```

  ```graphql Load HTML theme={null}
  query {
    page(
      content: "<h1>Hello World</h1>",
      options: { viewport: { width: 800, height: 600 } }
    ) {
      screenshot
    }
  }
  ```

  ```graphql Get current page theme={null}
  query {
    page {
      screenshot
      markdown
    }
  }
  ```
</CodeGroup>

#### Arguments

* **`url`**: [URL](/reference/graphql/scalars/url) - The URL to navigate the page to. If specified, the browser will attempt to load this URL.
  Example: `"https://example.com"`
* **`content`**: [String](/reference/graphql/scalars/string) - HTML content to set for the page. If specified, a new page is created with this content.
  This is useful for testing static HTML snippets or pages constructed on-the-fly.
  Example: `"<html><body><h1>Test Page</h1></body></html>"`
* **`options`**: [PageOptions](/reference/graphql/inputs/page-options) - Options to configure the page's behavior and environment.
  These include settings for viewport, user agent, geolocation, HTTP headers, JavaScript enablement, and more.
  See `PageOptions` for detailed configuration.
