Use this file to discover all available pages before exploring further.
PinchTab’s multi-instance architecture enables running multiple isolated Chrome browsers simultaneously, each with their own cookies, history, profiles, and configurations.
Create 5 headless instances for concurrent scraping:
#!/bin/bashURLs=( "https://example.com/page1" "https://example.com/page2" "https://example.com/page3" "https://example.com/page4" "https://example.com/page5")INSTANCES=()echo "Creating 5 headless instances..."# Create instances (in parallel for speed)for i in {1..5}; do curl -s -X POST http://localhost:9867/instances/launch \ -H "Content-Type: application/json" \ -d '{"mode":"headless"}' > /tmp/inst_$i.json &donewait# Parse instance IDsfor i in {1..5}; do ID=$(jq -r '.id' /tmp/inst_$i.json) INSTANCES+=("$ID") echo "Created instance $i: $ID"done# Wait for instances to initialize (lazy Chrome start)sleep 2echo "Navigating all instances concurrently..."# Navigate all instances and capture tab IDsTABS=()for i in "${!INSTANCES[@]}"; do ID="${INSTANCES[$i]}" URL="${URLS[$i]}" RESPONSE=$(curl -s -X POST "http://localhost:9867/instances/$ID/tabs/open" \ -H "Content-Type: application/json" \ -d "{\"url\":\"$URL\"}") TAB_ID=$(echo "$RESPONSE" | jq -r '.id') TABS+=("$TAB_ID")doneecho "All pages loaded. Getting snapshots..."# Get snapshots using tab IDsfor i in "${!TABS[@]}"; do TAB="${TABS[$i]}" curl -s "http://localhost:9867/tabs/$TAB/snapshot" > "snapshot-$i.json" &donewait# Cleanupecho "Stopping instances..."for ID in "${INSTANCES[@]}"; do curl -s -X POST "http://localhost:9867/instances/$ID/stop" &donewaitecho "Done! Scraped ${#URLS[@]} pages in parallel."
Benefits:
5 headless instances = 5x faster scraping than sequential
No cookie/history interference between sites
Each instance gets isolated Chrome process and temporary profile
Ports automatically allocated (9868-9872) and reused on stop
All API calls go through orchestrator proxy for consistency
Chrome uses lazy initialization: it starts when first needed, not at instance creation.
POST /instances/launch → Instance created immediately ↓ status: "starting" (orchestrator monitor probes /health) ↓ First /health probe triggers Chrome initialization (8-20 seconds) ↓ Chrome starts, TabManager initializes ↓ Monitor's health check succeeds ↓ status: "running" (instance ready for requests)→ Ready for navigation requests
Why lazy init? Reduces memory overhead for ephemeral instances, initialization happens automatically on first request.
Wait for ready state:
# Create instanceINST=$(curl -s -X POST http://localhost:9867/instances/launch | jq -r '.id')# Poll until running (Chrome will initialize during health checks)while [ "$(curl -s http://localhost:9867/instances/$INST | jq -r '.status')" != "running" ]; do sleep 0.5done# Now safe to usecurl -X POST http://localhost:9867/instances/$INST/tabs/open \ -d '{"url":"https://example.com"}'