Monitor page changes

Schedule a public-page check and compare the reported content against the previous successful run.

  • Change monitoring
  • Scheduled Scrape
  • Page diff
View as Markdown

Save a Scrape recipe for the page, then schedule recurring runs. The first complete successful run establishes a baseline. Subsequent complete runs compare their output with the previous successful baseline. A failed or partial run leaves the baseline in place.

Use Web Context → Workflows in the dashboard or the API below. The API key needs web:workflows:write, web:workflows:run, and web:scrape to create and enable the monitor. Add web:workflows:read to read history and notifications.

Create a daily monitor

Run in Bash with curl and jq. Set DATASEA_API_KEY and MONITOR_URL first. This creates an enabled schedule that can spend up to one credit per daily run. Run the setup once and save the returned schedule ID.

Bash
set -euo pipefail
: "${DATASEA_API_KEY:?Set DATASEA_API_KEY}"
: "${MONITOR_URL:?Set MONITOR_URL to the public page to monitor}"
api="https://api.datasea.io"
post() {
  curl -fsS --max-time 30 "${api}${1}" -H "X-API-Key: $DATASEA_API_KEY" \
    -H "Content-Type: application/json" --data-binary @-
}

recipe=$(jq -n --arg url "$MONITOR_URL" '{
  name: "Release notes", operation: "scrape", requests: [{
    url: $url, options: {formats: ["markdown"], render: "never", cache: {mode: "bypass"}}
  }]
}' | post /v1/recipes)
recipe_id=$(jq -er ".data.id" <<<"$recipe")
printf "Recipe ID: %s\n" "$recipe_id"

jq -n --arg recipeId "$recipe_id" '{
  name: "Daily release notes", $recipeId, intervalHours: 24, maxCredits: 1, enabled: true,
  selectedFields: ["/outputs/markdown"]
}' | post /v1/schedules | jq -e '.data'

Choose what to compare

This monitor bypasses the derived-output cache and compares /outputs/markdown on each new acquisition. Use a content-focused page to reduce noise from navigation, dates, or promotions. For structured pricing, a JSON Pointer such as /outputs/json/data/rows compares the extracted values when the recipe requests JSON. Raise the credit cap to cover JSON extraction before enabling that version.

Use one of the supported UTC intervals (1, 6, 24, or 168 hours). The schedule skips overlapping runs. Check occurrence history for skipped, failed, baseline, unchanged, and changed outcomes. If a baseline expires under result retention, the next complete run starts a new baseline.

Read change history and notifications

Set SCHEDULE_ID to the ID from setup. Follow data.nextCursor for older occurrences. Change alerts also appear in the dashboard and in the unread notifications API.

Bash
curl -fsS "https://api.datasea.io/v1/schedules/$SCHEDULE_ID/history" \
  -H "X-API-Key: $DATASEA_API_KEY" | jq ".data"

curl -fsS https://api.datasea.io/v1/notifications \
  -H "X-API-Key: $DATASEA_API_KEY" | jq ".data.items"

Illustrative change evidence

This hand-written example shows the history item’s diff field after a fictional release note changed. A changed run creates an in-app notification. Job webhooks cover individual job events.

JSON
[
  {
    "source": "0:https://example.com/release-notes",
    "kind": "changed",
    "before": {
      "/outputs/markdown": { "present": true, "value": "# Release notes\n\nVersion 1.3 is available." }
    },
    "after": {
      "/outputs/markdown": { "present": true, "value": "# Release notes\n\nVersion 1.4 is available." }
    }
  }
]

Credits and schedule controls

The sample’s maxCredits: 1 is an upper bound per occurrence. Each delivered Markdown-only check with browser rendering disabled settles 1 credit, including a check with unchanged content. Use the occurrence’s runId with GET /v1/batches/{id} to find its job IDs. Read final usage.settledCredits on GET /v1/jobs/{jobId} (requires web:jobs:read) for actual charges. The account’s daily and monthly caps also apply.

Pause from Workflows to stop future checks or delete the schedule with DELETE /v1/schedules/{id}. To update it with PUT /v1/schedules/{id}, supply its current version and the full schedule configuration with enabled: false to pause. Already submitted jobs remain in history.

Additional resources