Create Monitor
Create a new website monitor to track changes.
Endpoint
POST /v1/monitoring
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name for the monitor (max 100 chars) |
url | string | Yes | URL to monitor |
monitorType | string | No | Type of monitoring: full_page, selector, api_response. Default: full_page |
selector | string | No | CSS selector to monitor (required for selector type) |
prompt | string | No | AI prompt for custom change detection |
checkInterval | string | No | Check frequency. Default: hourly |
notifyOnlyOnChanges | boolean | No | Only alert when changes detected. Default: true |
includeScreenshot | boolean | No | Include screenshot with alerts. Default: false |
alertChannels | array | No | Alert channel configurations |
Check Intervals
| Value | Description |
|---|---|
5min | Every 5 minutes |
15min | Every 15 minutes |
30min | Every 30 minutes |
hourly | Every hour |
6hours | Every 6 hours |
12hours | Every 12 hours |
daily | Once per day |
weekly | Once per week |
Alert Channel Object
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Channel type: email, slack, webhook |
email | string | Conditional | Email address (required for email type) |
slackWebhookUrl | string | Conditional | Slack webhook URL (required for slack type) |
webhookUrl | string | Conditional | Webhook URL (required for webhook type) |
webhookHeaders | object | No | Custom headers for webhook |
Example Requests
Full Page Monitor with Email Alert
curl -X POST https://api.scrapebit.com/v1/monitoring \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Competitor Homepage",
"url": "https://competitor.example.com",
"monitorType": "full_page",
"checkInterval": "daily",
"alertChannels": [
{
"type": "email",
"email": "alerts@mycompany.com"
}
]
}'
Price Monitor with Selector
curl -X POST https://api.scrapebit.com/v1/monitoring \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Product Price",
"url": "https://shop.example.com/product/123",
"monitorType": "selector",
"selector": ".product-price, .sale-price",
"checkInterval": "hourly",
"alertChannels": [
{
"type": "email",
"email": "pricing@mycompany.com"
},
{
"type": "slack",
"slackWebhookUrl": "https://hooks.slack.com/services/..."
}
]
}'
Stock Availability Monitor with Webhook
curl -X POST https://api.scrapebit.com/v1/monitoring \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "GPU Stock Alert",
"url": "https://store.example.com/rtx-4090",
"monitorType": "selector",
"selector": ".stock-status, .add-to-cart",
"checkInterval": "5min",
"alertChannels": [
{
"type": "webhook",
"webhookUrl": "https://api.myapp.com/stock-alert",
"webhookHeaders": {
"X-Custom-Token": "my-secret-token"
}
}
]
}'
AI-Powered Content Monitor
curl -X POST https://api.scrapebit.com/v1/monitoring \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "News Page Monitor",
"url": "https://news.example.com/tech",
"monitorType": "full_page",
"prompt": "Alert me if there are any articles about AI regulations or cryptocurrency",
"checkInterval": "hourly",
"alertChannels": [
{
"type": "email",
"email": "news@mycompany.com"
}
]
}'
Response
{
"success": true,
"data": {
"id": "mon_abc123xyz",
"name": "Product Price",
"url": "https://shop.example.com/product/123",
"monitorType": "selector",
"selector": ".product-price",
"checkInterval": "hourly",
"status": "active",
"nextCheckAt": "2025-02-01T15:00:00Z",
"consecutiveErrors": 0,
"notifyOnlyOnChanges": true,
"alertChannels": [
{
"id": "ch_xyz789",
"type": "email",
"email": "alerts@example.com",
"isEnabled": true
}
],
"createdAt": "2025-02-01T14:00:00Z"
}
}
Webhook Payload
When changes are detected, webhooks receive:
{
"event": "monitor.change_detected",
"timestamp": "2025-02-01T15:00:05Z",
"data": {
"monitorId": "mon_abc123xyz",
"monitorName": "Product Price",
"url": "https://shop.example.com/product/123",
"check": {
"id": "chk_def456",
"status": "success",
"changeDetected": true,
"changeSummary": "Price changed from $299.99 to $249.99",
"checkedAt": "2025-02-01T15:00:03Z",
"responseTimeMs": 1523
}
}
}
Error Responses
| Status | Error | Description |
|---|---|---|
| 400 | Validation error | Invalid request body |
| 402 | Insufficient credits | Need at least 1 credit |
| 401 | Unauthorized | Invalid or missing API key |
Try It Out
POST
/v1/monitoringCreate a new website monitor
Your API key is stored locally in your browser