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

# Grow Therapy provider search

> Search Grow Therapy for therapists by location, insurance, and specialty — with cached reruns.

This tutorial builds a provider search tool for [Grow Therapy](https://www.growtherapy.com) — a therapy marketplace that handles insurance credentialing for providers. We combine [structured output](/cloud/agent/structured-output) with [deterministic rerun](/cloud/agent/cache-script) to build a fast, repeatable search pipeline.

## What you'll build

A script that:

1. Searches Grow Therapy's provider directory with filters (location, insurance, specialty)
2. Extracts therapist profiles with ratings and availability
3. Caches the search so you can sweep across geographies or specialties instantly

***

## Setup

<CodeGroup>
  ```python Python theme={null}
  import asyncio
  import json
  from pydantic import BaseModel
  from browser_use_sdk.v3 import AsyncBrowserUse

  client = AsyncBrowserUse()
  ```

  ```typescript TypeScript theme={null}
  import { BrowserUse } from "browser-use-sdk/v3";
  import { z } from "zod";

  const client = new BrowserUse();
  ```
</CodeGroup>

## 1. Define the output schema

<CodeGroup>
  ```python Python theme={null}
  class Provider(BaseModel):
      name: str
      title: str
      specialties: list[str]
      insurance_plans: list[str]
      rating: float | None = None
      next_available: str | None = None

  class ProviderSearch(BaseModel):
      providers: list[Provider]
      total_found: int | None = None
      location: str
      specialty: str
  ```

  ```typescript TypeScript theme={null}
  const ProviderSearch = z.object({
    providers: z.array(z.object({
      name: z.string(),
      title: z.string(),
      specialties: z.array(z.string()),
      insurancePlans: z.array(z.string()),
      rating: z.number().nullable(),
      nextAvailable: z.string().nullable(),
    })),
    totalFound: z.number().nullable(),
    location: z.string(),
    specialty: z.string(),
  });
  ```
</CodeGroup>

## 2. Create a workspace

<CodeGroup>
  ```python Python theme={null}
  workspace = await client.workspaces.create(name="grow-therapy-search")
  ```

  ```typescript TypeScript theme={null}
  const workspace = await client.workspaces.create({ name: "grow-therapy-search" });
  ```
</CodeGroup>

## 3. Search for providers

<CodeGroup>
  ```python Python theme={null}
  result = await client.run(
      "Go to growtherapy.com and search for therapists in {{New York}} "
      "who specialize in {{anxiety}} and accept insurance. "
      "Return the first 5 provider profiles as JSON.",
      workspace_id=str(workspace.id),
      output_schema=ProviderSearch,
  )

  for p in result.output.providers:
      print(f"{p.name} ({p.title})")
      print(f"  Specialties: {', '.join(p.specialties)}")
      print(f"  Rating: {p.rating}")
      print(f"  Next available: {p.next_available}")
      print()
  ```

  ```typescript TypeScript theme={null}
  const result = await client.run(
    "Go to growtherapy.com and search for therapists in {{New York}} " +
    "who specialize in {{anxiety}} and accept insurance. " +
    "Return the first 5 provider profiles as JSON.",
    { workspaceId: workspace.id, schema: ProviderSearch },
  );

  for (const p of result.output.providers) {
    console.log(`${p.name} (${p.title})`);
    console.log(`  Specialties: ${p.specialties.join(", ")}`);
    console.log(`  Rating: ${p.rating}`);
    console.log(`  Next available: ${p.nextAvailable}`);
  }
  ```
</CodeGroup>

## 4. Sweep across locations and specialties

After the first run caches the search flow, sweep across different parameters at \$0 LLM cost:

<CodeGroup>
  ```python Python theme={null}
  locations = ["Los Angeles", "Chicago", "Houston", "Miami"]
  specialties = ["depression", "trauma", "ADHD"]

  for location in locations:
      for specialty in specialties:
          result = await client.run(
              f"Go to growtherapy.com and search for therapists in {{{{{location}}}}} "
              f"who specialize in {{{{{specialty}}}}} and accept insurance. "
              f"Return the first 5 provider profiles as JSON.",
              workspace_id=str(workspace.id),
              output_schema=ProviderSearch,
          )
          count = len(result.output.providers)
          print(f"{location} / {specialty}: {count} providers found")
  ```

  ```typescript TypeScript theme={null}
  const locations = ["Los Angeles", "Chicago", "Houston", "Miami"];
  const specialties = ["depression", "trauma", "ADHD"];

  for (const location of locations) {
    for (const specialty of specialties) {
      const result = await client.run(
        `Go to growtherapy.com and search for therapists in {{${location}}} ` +
        `who specialize in {{${specialty}}} and accept insurance. ` +
        `Return the first 5 provider profiles as JSON.`,
        { workspaceId: workspace.id, schema: ProviderSearch },
      );
      console.log(`${location} / ${specialty}: ${result.output.providers.length} providers`);
    }
  }
  ```
</CodeGroup>

***

## Summary

| Step                                        | What happens                                                                  | Cost             |
| ------------------------------------------- | ----------------------------------------------------------------------------- | ---------------- |
| First search                                | Agent navigates Grow Therapy, caches the flow                                 | \~\$0.10         |
| 12 cached sweeps (4 cities x 3 specialties) | Script reruns with new params                                                 | **\$0 LLM each** |
| Site layout change                          | [Auto-healing](/cloud/agent/cache-script#auto-healing) regenerates the script | \~\$0.10         |

<Info>
  Therapy platforms have dynamic UIs that can change frequently. [Auto-healing](/cloud/agent/cache-script#auto-healing) ensures your cached scripts stay working without manual maintenance.
</Info>

## Next steps

* [Structured output](/cloud/agent/structured-output) — Learn more about extracting typed data with Pydantic and Zod schemas.
* [Human in the loop](/cloud/agent/human-in-the-loop) — Let a human review or interact with the browser mid-task, useful for auth flows or approving results before continuing.
* [Deterministic rerun](/cloud/agent/cache-script) — Deep dive into how caching and auto-healing work.
