pagefluxer.
API QUICKSTART

Your first monitor,
from your own tools.

Create a text monitor with curl, then read changes and request a check. These examples use a shell such as Bash or Git Bash; Windows PowerShell has different quoting rules.

1. Create a scoped Pro token

Sign in to PageFluxer with a Pro account, open Dashboard → API access, and create a token with all five scopes for this tutorial. For a real integration, grant only the scopes it needs. Set the token as PAGEFLUXER_API_TOKEN without checking it into source control.

export PAGEFLUXER_API_BASE="https://pagefluxer.com/api/v1"
# Provide PAGEFLUXER_API_TOKEN through your shell or secret manager.
curl --fail-with-body "$PAGEFLUXER_API_BASE/usage" \
  -H "Authorization: Bearer $PAGEFLUXER_API_TOKEN"

2. Load a cloud preview

PageFluxer must be able to read the public page itself. Your browser’s login and cookies are not transferred. HTML is a good first choice; choose browser when the content requires JavaScript.

curl --fail-with-body "$PAGEFLUXER_API_BASE/previews" \
  -H "Authorization: Bearer $PAGEFLUXER_API_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"url":"https://example.com/","load_mode":"html"}'

Copy data.id. The preview’s element list helps identify stable selectors. It expires in 15 minutes and uses the same preview allowance as the website.

3. Create the monitor

# Replace PREVIEW_ID with data.id from the preview response.
curl --fail-with-body "$PAGEFLUXER_API_BASE/monitors" \
  -H "Authorization: Bearer $PAGEFLUXER_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: example-homepage-2026-10-04-001" \
  --data '{
    "preview_id": "PREVIEW_ID",
    "name": "Example homepage",
    "interval_minutes": 60,
    "targets": [{
      "id": "content", "label": "Page content", "kind": "text",
      "selection": {"scope": "page"}, "rule": "changed"
    }],
    "notifications": {"email_enabled": true, "webhook_enabled": false}
  }'

A 201 response returns the monitor ID and its Location. Save the ID in your integration. If the request times out, retry with exactly the same body and idempotency key. The first confirmed capture establishes a baseline without an alert.

Watch for a price below $30 instead

Preview a product page you can access, then substitute this target. Replace #price with the selector confirmed by that preview and choose the correct currency. Evaluate the target before saving with POST /previews/PREVIEW_ID/evaluate and a body containing targets.

{
  "id": "price",
  "label": "Product price",
  "kind": "price",
  "selection": {
    "scope": "selector",
    "selector": "#price"
  },
  "rule": "below",
  "currency": "USD",
  "decimal": ".",
  "threshold": "30.00"
}

The rule alerts when the condition becomes true, not on every check while the price stays below the threshold.

4. Read changes

curl --fail-with-body "$PAGEFLUXER_API_BASE/changes?limit=20" \
  -H "Authorization: Bearer $PAGEFLUXER_API_TOKEN"

# Use a retained change's data[].id:
curl --fail-with-body "$PAGEFLUXER_API_BASE/changes/CHANGE_ID" \
  -H "Authorization: Bearer $PAGEFLUXER_API_TOKEN"

A stable page may return an empty list. Changes are recorded after later captures differ from the baseline. Follow next_cursor, deduplicate IDs, and treat captured before/after content as plain untrusted text. For event-driven integrations, enable your configured Pro webhook and follow the signature verification guide.

5. Request an asynchronous check

# Replace MONITOR_ID with the created data.id.
# Wait at least the plan minimum since its previous capture (Pro HTML: 5 min).
curl --fail-with-body "$PAGEFLUXER_API_BASE/monitors/MONITOR_ID/checks" \
  -H "Authorization: Bearer $PAGEFLUXER_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: example-manual-check-001" --data '{}'

# Poll the returned Location no more than once per minute:
curl --fail-with-body "$PAGEFLUXER_API_BASE/checks/CHECK_ID" \
  -H "Authorization: Bearer $PAGEFLUXER_API_TOKEN"

202 means queued, not completed. The worker’s timing, account allowance and website backoff apply. Respect Retry-After on 429. The status response tells you whether the check succeeded, failed, was cancelled or expired; success does not necessarily mean a change occurred.

6. Pause when you’re done

curl --fail-with-body --request PATCH \
  "$PAGEFLUXER_API_BASE/monitors/MONITOR_ID" \
  -H "Authorization: Bearer $PAGEFLUXER_API_TOKEN" \
  -H "Content-Type: application/json" --data '{"status":"paused"}'

Set status to active to resume. Paused monitors still occupy a monitor slot and keep history subject to retention. DELETE the monitor only if you also want to remove its history. Revoke the tutorial token when no longer needed.

Before shipping your integration

Handle 401/403 without a retry loop, respect rate limits, reuse idempotency keys for uncertain creation results, and keep tokens in server-side secrets. Reading usage or saved history does not trigger a page load.