Cookbook
Practical recipes for building browser automations with InverseUI. Learn how to use the Recording API and leverage the upcoming SDK.
Recording API
InverseUI's Recording API allows you to programmatically control browser extension recordings. Currently, we mainly introduce the Python implementation. You can control recordings while running your Python automation scripts (Playwright, Selenium, etc.) to capture user interactions, validate actions, and build reusable automation workflows.
Setup
First, ensure you have the InverseUI Chrome extension installed and your authentication token configured.
Configuration
# config.py
EXTENSION_PATH = "/path/to/InverseUI-Chrome-Extension/"
EXTENSION_ID = "your_extension_id"
# Your authentication token
INVERSEUI_AUTH_TOKEN = "your_auth_token_here"
INVERSEUI_AUTH_COOKIE = {
    "domain": ".inverseui.com",
    "name": "inverseui_auth_token",
    "value": INVERSEUI_AUTH_TOKEN,
    "path": "/",
    "secure": True,
    "httpOnly": False,
    "sameSite": "strict"
}Starting a Recording
Control when to start recording browser actions from your Python automation script.
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
import time
# Set up Chrome with InverseUI extension
options = webdriver.ChromeOptions()
options.add_argument(f'--load-extension=${EXTENSION_PATH}')
options.add_argument('--disable-blink-features=AutomationControlled')
driver = webdriver.Chrome(service=Service(), options=options)
# Add authentication cookie
driver.get("https://inverseui.com")
driver.add_cookie(INVERSEUI_AUTH_COOKIE)
# Start recording via extension API
driver.execute_script("""
    chrome.runtime.sendMessage(
        '${EXTENSION_ID}',
        { action: 'START_RECORDING' },
        (response) => { console.log('Recording started:', response); }
    );
""")
time.sleep(2)  # Wait for recording to start
# Your automation code here
driver.get("https://example.com")
# ... perform actions ...Stopping Recording & Fetching Actions
After your automation completes, stop the recording and retrieve all captured actions.
# Stop the recording
driver.execute_script("""
    chrome.runtime.sendMessage(
        '${EXTENSION_ID}',
        { action: 'STOP_RECORDING' },
        (response) => { console.log('Recording stopped:', response); }
    );
""")
time.sleep(1)
# Fetch captured actions
actions = driver.execute_script("""
    return new Promise((resolve) => {
        chrome.runtime.sendMessage(
            '${EXTENSION_ID}',
            { action: 'GET_ACTIONS' },
            (response) => { resolve(response); }
        );
    });
""")
# Process the captured actions
if actions and 'actions' in actions:
    for action in actions['actions']:
        print(f"Action: ${action['browserAction']}")
        print(f"  Timestamp: ${action['timestamp']}")
        print(f"  XPath: ${action.get('xpath', 'N/A')}")
        print(f"  Content: ${action.get('content', 'N/A')}")
        print()InverseUI Python SDK
Coming Soon
We're building a Python SDK that will make it even easier to work with InverseUI recorded automations.
Planned Features
- •Call Recorded Functions: Execute your recorded browser automations as simple Python functions
 - •AI Agent Mode: Install with 
pip install inverseui[agent]for autonomous agent capabilities - •Seamless Integration: Works alongside your existing Playwright, Selenium, or custom automation code
 
Preview of planned API:
# Future SDK usage (in development)
from inverseui import InverseUI
# Initialize client
client = InverseUI(api_key="your_api_key")
# Call a recorded automation as a function
result = client.call_function(
    "search_airbnb_room",
    city="San Francisco",
    guests=2
)
# Or with AI agent capabilities
from inverseui.agent import Agent
agent = Agent(api_key="your_api_key")
result = agent.run(
    "Find and book the cheapest hotel in NYC for next weekend"
)Want early access? Join our Discord community or contact us.