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

# is_page_loaded

<Tip>This function uses AI and incurs costs.</Tip>

Uses AI vision to determine if a webpage has finished loading by analyzing a screenshot.
Detects loading spinners, blank content, or incomplete page states.

```python theme={null}
async def is_page_loaded(
    page: Page,
    *,
    model: str,
    timeout_s: int,
    api_key: str | None,
) -> bool
```

## Examples

<CodeGroup>
  ```python Check Page Loading theme={null}
  from typing import TypedDict
  from playwright.async_api import Page
  from intuned_browser.ai import is_page_loaded
  class Params(TypedDict):
      pass
  async def automation(page: Page, params: Params, **_kwargs):
      # Wait for page to finish loading
      await page.goto('https://sandbox.intuned.dev/')
      page_loaded = await is_page_loaded(page)
      if page_loaded:
          # Continue with scraping or interactions
          print("Page is loaded")
      else:
          # Wait longer or retry
          await page.wait_for_timeout(5000)
  ```

  ```python Loading Loop theme={null}
  from typing import TypedDict
  from playwright.async_api import Page
  from intuned_browser.ai import is_page_loaded
  class Params(TypedDict):
      pass
  async def automation(page: Page, params: Params, **_kwargs):
      # Keep checking until page loads
      await page.goto("https://example.com")
      attempts = 0
      while attempts < 10:  # We will retry up to 10 times with a 2-second delay between attempts.
          page_loaded = await is_page_loaded(
              page,
              model="claude-sonnet-4-5",
              timeout_s=5
          )
          if page_loaded:
              break  # If the page is loaded, break the loop.
          await page.wait_for_timeout(2000)  # Wait for 2 seconds before the next attempt.
          attempts += 1
  ```
</CodeGroup>

## Arguments

<ResponseField name="page" type="Page" required>
  The Playwright page to check
</ResponseField>

<ResponseField name="timeout_s" type="int">
  Screenshot timeout in seconds. Defaults to 10.
</ResponseField>

<ResponseField name="model" type="str">
  AI model to use for the check. Defaults to "claude-haiku-4-5-20251001".
</ResponseField>

<ResponseField name="api_key" type="str">
  Optional API key for the AI service (if provided, will not be billed to your
  account). Defaults to None.
</ResponseField>

## Returns: `bool`

True if page is loaded, False if still loading
