Skip to main content

Get started in three steps

Step 1: Get your API key

Sign up for a Rusty Browser account and generate your API key from the dashboard.
Keep your API key secure. Never commit it to version control or share it publicly.
Store your API key in environment variables:
export RUSTY_BROWSER_API_KEY="your_api_key_here"
Or in your .env file:
RUSTY_BROWSER_API_KEY=your_api_key_here
Add .env to your .gitignore to prevent accidentally committing your API key.

Step 2: Create a browser

All browser activity starts with a browser. Create one with a single request:
curl -X PUT https://api.rustybrowser.com/v1/browsers/ \
  -H "Authorization: Bearer $RUSTY_BROWSER_API_KEY"
const response = await fetch('https://api.rustybrowser.com/v1/browsers/', {
  method: 'PUT',
  headers: {
    'Authorization': `Bearer ${process.env.RUSTY_BROWSER_API_KEY}`
  }
});

const { id } = await response.json();
console.log('browser ID:', id);
import os
import requests

response = requests.put(
    'https://api.rustybrowser.com/v1/browsers/',
    headers={'Authorization': f"Bearer {os.getenv('RUSTY_BROWSER_API_KEY')}"}
)

browser_id = response.json()['id']
print('Browser ID:', browser_id)

Step 3: Control the browser

With a browser ID, you can navigate, interact, and extract data:
curl -X POST https://api.rustybrowser.com/v1/browsers/{id}/fetch-text/ \
  -H "Authorization: Bearer $RUSTY_BROWSER_API_KEY"
curl -X POST https://api.rustybrowser.com/v1/browsers/{id}/screenshot/ \
  -H "Authorization: Bearer $RUSTY_BROWSER_API_KEY"
curl -X POST https://api.rustybrowser.com/v1/browsers/{id}/instruct/ \
  -H "Authorization: Bearer $RUSTY_BROWSER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "instruction": "Click the sign in button and fill in the login form" }'

Step 4: Close the browser

Always close browsers when you’re done to stop billing:
curl -X DELETE https://api.rustybrowser.com/v1/browsers/{id}/ \
  -H "Authorization: Bearer $RUSTY_BROWSER_API_KEY"
Browsers bill by the hour (50 tokens/hr on PAYG). Always close browsers when finished.

Next steps

Pricing

Understand token costs and subscription plans

Browsers

Browser lifecycle and best practices

All Commands

Navigate, click, type, scroll, screenshot, and more

AI Instructions

Drive the browser with natural language