Automated monitoring lets your robots check websites regularly for changes without manual intervention. Instead of running tasks manually or setting up monitors through the dashboard, you can programmatically create and manage entire monitoring fleets.
This is powerful for:
Competitive intelligence: Track competitor pricing, products, and content changes.
Inventory monitoring: Get alerts when products come back in stock.
Content tracking: Monitor news sites, job boards, or real estate listings.
Price surveillance: Track price changes across multiple retailers.
Why use the API for monitoring?
Scale: Create monitors for hundreds of URLs programmatically.
Dynamic: Add/remove monitoring based on business logic.
Integration: Connect monitoring alerts directly to your systems.
Automation: Build monitoring into your existing workflows.
Understanding monitor basics
A monitor is essentially a scheduled task that runs your robot automatically and compares results to detect changes.
Key monitor components:
Schedule: How often to check (hourly, daily, custom intervals).
Input parameters: What URLs or data to monitor.
Notifications: When to alert you about changes.
Status: Active or paused.
Step 1: List existing monitors
First, see what monitors you already have:
curl -X GET "https://api.browse.ai/v2/robots/ROBOT_ID/monitors" \
-H "Authorization: Bearer YOUR_SECRET_API_KEY"
Response structure:
{
"statusCode": 200,
"messageCode": "success",
"monitors": {
"totalCount": 3,
"items": [
{
"id": "monitor-uuid-here",
"name": "Daily Price Check",
"status": "active",
"schedule": "FREQ=DAILY;INTERVAL=1;BYHOUR=9",
"notifyOnCapturedTextChange": true,
"createdAt": 1678795867879
}
]
}
}Step 2: Create a new monitor
Create a monitor to check for changes daily:
curl -X POST "https://api.browse.ai/v2/robots/ROBOT_ID/monitors" \
-H "Authorization: Bearer YOUR_SECRET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Competitor Price Monitor",
"schedule": "FREQ=DAILY;INTERVAL=1;BYHOUR=10",
"inputParameters": {
"originUrl": "https://competitor-site.com/products"
},
"notifyOnCapturedTextChange": true,
"notifyOnCapturedScreenshotChange": false
}'
Monitor created successfully:
{
"statusCode": 200,
"messageCode": "success",
"monitor": {
"id": "new-monitor-uuid",
"name": "Competitor Price Monitor",
"status": "active",
"schedule": "FREQ=DAILY;INTERVAL=1;BYHOUR=10",
"notifyOnCapturedTextChange": true,
"createdAt": 1678795867879
}
}Step 3: Understanding monitoring schedules
Monitors use RFC 5545 recurrence rules. Here are some common examples.
Hourly monitoring:
"schedule": "FREQ=HOURLY;INTERVAL=1"
Daily at specific time:
"schedule": "FREQ=DAILY;INTERVAL=1;BYHOUR=9"
Weekdays only:
"schedule": "FREQ=DAILY;INTERVAL=1;BYWEEKDAY=MO,TU,WE,TH,FR;BYHOUR=10"
Multiple times per day:
"schedule": "FREQ=DAILY;INTERVAL=1;BYHOUR=9,13,17"
Weekly monitoring:
"schedule": "FREQ=WEEKLY;INTERVAL=1;BYWEEKDAY=MO;BYHOUR=9"
Step 4: Configure change detection
Control what triggers notifications:
Text change notifications:
{
"notifyOnCapturedTextChange": true,
"notifyOnCapturedScreenshotChange": false
}Screenshot change notifications:
{
"notifyOnCapturedTextChange": false,
"notifyOnCapturedScreenshotChange": true,
"capturedScreenshotNotificationThreshold": 15
}Both types of changes:
{
"notifyOnCapturedTextChange": true,
"notifyOnCapturedScreenshotChange": true,
"capturedScreenshotNotificationThreshold": 10
}Screenshot threshold: Percentage of change required to trigger notification (1-100%)
Step 5: Managing monitor status
Pause a monitor:
curl -X PATCH "https://api.browse.ai/v2/robots/ROBOT_ID/monitors/MONITOR_ID" \
-H "Authorization: Bearer YOUR_SECRET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "paused"
}'
Reactivate a monitor:
curl -X PATCH "https://api.browse.ai/v2/robots/ROBOT_ID/monitors/MONITOR_ID" \
-H "Authorization: Bearer YOUR_SECRET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "active"
}'
Update monitor settings:
curl -X PATCH "https://api.browse.ai/v2/robots/ROBOT_ID/monitors/MONITOR_ID" \
-H "Authorization: Bearer YOUR_SECRET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Monitor Name",
"schedule": "FREQ=HOURLY;INTERVAL=2",
"inputParameters": {
"originUrl": "https://new-url-to-monitor.com"
}
}'
Step 6: Working with monitoring results
Monitor tasks appear in your regular task list but with special identifiers:
curl -X GET "https://api.browse.ai/v2/robots/ROBOT_ID/tasks" \
-H "Authorization: Bearer YOUR_SECRET_API_KEY"
Identifying monitor tasks:
{
"result": {
"id": "task-id",
"runByTaskMonitorId": "monitor-uuid-here",
"runByAPI": false,
"status": "successful",
"capturedTexts": {
"price": "$89.99",
"availability": "In Stock"
}
}
}Filter for monitor tasks only:
# Get tasks from specific monitor
curl -X GET "https://api.browse.ai/v2/robots/ROBOT_ID/tasks" \
-H "Authorization: Bearer YOUR_SECRET_API_KEY" \
| jq '.result.robotTasks.items[] | select(.runByTaskMonitorId == "monitor-uuid")'
Common monitoring patterns
Price tracking across multiple URLs:
import requests
# Create monitors for competitor price tracking
competitors = [
{"name": "Competitor A", "url": "https://competitor-a.com/product"},
{"name": "Competitor B", "url": "https://competitor-b.com/product"},
{"name": "Competitor C", "url": "https://competitor-c.com/product"}
]
for competitor in competitors:
monitor_data = {
"name": f"{competitor['name']} Price Monitor",
"schedule": "FREQ=DAILY;INTERVAL=1;BYHOUR=9",
"inputParameters": {"originUrl": competitor["url"]},
"notifyOnCapturedTextChange": True
}
response = requests.post(
f"https://api.browse.ai/v2/robots/{robot_id}/monitors",
headers={"Authorization": f"Bearer {api_key}"},
json=monitor_data
)
Inventory monitoring:
{
"name": "Stock Availability Monitor",
"schedule": "FREQ=HOURLY;INTERVAL=1",
"inputParameters": {
"originUrl": "https://store.com/product-page"
},
"notifyOnCapturedTextChange": true
}
Content monitoring (news, jobs, etc.):
{
"name": "New Job Listings Monitor",
"schedule": "FREQ=HOURLY;INTERVAL=2;BYWEEKDAY=MO,TU,WE,TH,FR",
"inputParameters": {
"originUrl": "https://jobboard.com/search?location=remote"
},
"notifyOnCapturedTextChange": true
}
