from pathlib import Path
import os
from browshot import BrowshotClient

client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
response = client.simple("https://example.com/", { "country": "in", "device": "iphone_15_pro" })
if response["code"] != 200:
    raise RuntimeError(f"Capture failed: HTTP {response['code']}")
Path("capture.png").write_bytes(response["png"])
