> ## 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.

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

```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
```

## Arguments

**page** `Page` *required*

The Playwright page to check

**timeout\_s** `int`

Screenshot timeout in seconds. Defaults to 10.

**model** `str`

AI model to use for the check. Accepts any vision-capable model supported by
Anthropic, OpenAI, or Google. Defaults to "claude-haiku-4-5-20251001".

**api\_key** `str`

Optional API key for the AI service (if provided, will not be billed to your
account). Defaults to None.

## Returns: `bool`

True if page is loaded, False if still loading


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.