Skip to main content

Schedule Endpoints

Create and manage automated, recurring scrapes via HTTP.

Create schedule

Create a new recurring schedule.
POST /v1/schedules

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"
}
FieldTypeRequiredDescription
strategy_idstringYesStrategy UUID
urlstringYesURL to scrape
interval_secondsintegerConditionalInterval in seconds
cron_expressionstringConditionalCron expression
webhook_urlstringNoWebhook 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.
GET /v1/schedules

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

ParameterTypeRequiredDescription
mark_seenbooleanNoMark changes as seen (default: true)
filterstringNoLucene-style keyword filter for result items

Keyword filter syntax

The filter parameter uses Lucene-style syntax to filter individual result items:
SyntaxMeaningExample
+keywordRequired (AND)+rubio +tariff - items with both
keywordOptional (OR)rubio elon - items with either
-keywordExcluded (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]