Schedule Endpoints
Create and manage automated, recurring scrapes via HTTP.
Create schedule
Create a new recurring schedule.
Request body (interval-based)
{
"strategy_id": "550e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com/products",
"interval_seconds": 3600,
"webhook_url": "https://your-app.com/webhooks/meter"
}
Request body (cron-based)
{
"strategy_id": "550e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com/products",
"cron_expression": "0 9 * * *",
"webhook_url": "https://your-app.com/webhooks/meter"
}
| Field | Type | Required | Description |
|---|
strategy_id | string | Yes | Strategy UUID |
url | string | Yes | URL to scrape |
interval_seconds | integer | Conditional | Interval in seconds |
cron_expression | string | Conditional | Cron expression |
webhook_url | string | No | Webhook URL for notifications |
Provide either interval_seconds or cron_expression, not both.
Response
{
"id": "880e8400-e29b-41d4-a716-446655440000",
"strategy_id": "550e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com/products",
"schedule_type": "interval",
"interval_seconds": 3600,
"cron_expression": null,
"enabled": true,
"webhook_url": "https://your-app.com/webhooks/meter",
"next_run_at": "2025-01-15T11:30:00Z",
"last_run_at": null,
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}
Example
# Interval-based
curl -X POST https://api.meter.sh/v1/schedules \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"strategy_id": "550e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com/products",
"interval_seconds": 3600
}'
# Cron-based
curl -X POST https://api.meter.sh/v1/schedules \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"strategy_id": "550e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com/products",
"cron_expression": "0 9 * * *"
}'
List schedules
Get all schedules for the authenticated user.
Response
Array of schedule objects (same format as Create schedule response).
Example
curl https://api.meter.sh/v1/schedules \
-H "Authorization: Bearer sk_live_..."
Update schedule
Update an existing schedule.
PATCH /v1/schedules/{schedule_id}
Request body
All fields are optional. Include only fields to update:
{
"enabled": false,
"interval_seconds": 7200,
"webhook_url": "https://new-domain.com/webhooks"
}
Response
Updated schedule object.
Example
# Disable schedule
curl -X PATCH https://api.meter.sh/v1/schedules/880e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
# Change interval
curl -X PATCH https://api.meter.sh/v1/schedules/880e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"interval_seconds": 7200}'
Delete schedule
Delete a schedule (stops future jobs).
DELETE /v1/schedules/{schedule_id}
Response
{
"message": "Schedule deleted successfully"
}
Example
curl -X DELETE https://api.meter.sh/v1/schedules/880e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer sk_live_..."
Get schedule changes
Get unseen changes for a schedule (pull-based change detection).
GET /v1/schedules/{schedule_id}/changes?mark_seen=true&filter=+keyword
Query parameters
| Parameter | Type | Required | Description |
|---|
mark_seen | boolean | No | Mark changes as seen (default: true) |
filter | string | No | Lucene-style keyword filter for result items |
Keyword filter syntax
The filter parameter uses Lucene-style syntax to filter individual result items:
| Syntax | Meaning | Example |
|---|
+keyword | Required (AND) | +rubio +tariff - items with both |
keyword | Optional (OR) | rubio elon - items with either |
-keyword | Excluded (NOT) | -bitcoin - items without |
"phrase" | Exact phrase | "elon musk" - exact match |
The filter applies to individual items within results, not entire jobs.
Jobs with zero matching items are excluded from the response.
Response
{
"schedule_id": "880e8400-e29b-41d4-a716-446655440000",
"changes": [
{
"job_id": "660e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"results": [...],
"item_count": 12,
"content_hash": "7f3d9a2b4c1e...",
"completed_at": "2025-01-15T10:30:12Z",
"seen": true
}
],
"count": 1,
"marked_seen": true,
"filter_applied": "+rubio +tariff"
}
Example
# Get and mark as seen
curl https://api.meter.sh/v1/schedules/880e8400-e29b-41d4-a716-446655440000/changes \
-H "Authorization: Bearer sk_live_..."
# Preview without marking
curl https://api.meter.sh/v1/schedules/880e8400-e29b-41d4-a716-446655440000/changes?mark_seen=false \
-H "Authorization: Bearer sk_live_..."
# Filter for items containing both "rubio" AND "tariff"
curl "https://api.meter.sh/v1/schedules/880e8400-e29b-41d4-a716-446655440000/changes?filter=%2Brubio+%2Btariff" \
-H "Authorization: Bearer sk_live_..."
# Filter for items containing "rubio" OR "elon"
curl "https://api.meter.sh/v1/schedules/880e8400-e29b-41d4-a716-446655440000/changes?filter=rubio+elon" \
-H "Authorization: Bearer sk_live_..."
# Filter for items with "rubio" but NOT "biden"
curl "https://api.meter.sh/v1/schedules/880e8400-e29b-41d4-a716-446655440000/changes?filter=%2Brubio+-biden" \
-H "Authorization: Bearer sk_live_..."
Webhook payload
When a schedule has a webhook URL, Meter POSTs to it after each job:
{
"job_id": "660e8400-e29b-41d4-a716-446655440000",
"schedule_id": "880e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"results": [...],
"item_count": 12,
"has_changes": true,
"content_hash": "7f3d9a2b4c1e...",
"completed_at": "2025-01-15T10:30:12Z"
}
See the Webhooks Guide for implementation details.
Error responses
See REST API Errors for common error codes.
Next steps
Need help?
Email me at [email protected]