Define a schema for the data you want, and the agent returns it as a typed object — not raw text. Use this whenever you need to process the result programmatically.
from browser_use_sdk import AsyncBrowserUse
from pydantic import BaseModel
class Product(BaseModel):
name: str
price: float
rating: float
class ProductList(BaseModel):
items: list[Product]
client = AsyncBrowserUse()
result = await client.run(
"Get the top 3 results for 'wireless headphones' on Amazon",
output_schema=ProductList,
)
for p in result.output.items:
print(f"{p.name}: ${p.price} ({p.rating}★)")
~8-12 steps with Browser Use 2.0. See Pricing for cost per model.
Keep schemas flat when possible. Nested schemas work but add extraction complexity for the agent.