The problem
Reading a webpage once does not tell your agent what changed since the last visit. Without a saved earlier version, it may miss a new price, an updated policy or a revised announcement.
How NativePort helps
NativePort uses Crawlbase to retrieve the current page so your agent can compare it with the version it saved before. Your agent can focus on the part you care about and show you the text that was added or removed.
For example, it can check a public pricing section each morning. The agent or your application sets the schedule and keeps the earlier copy; NativePort supplies the page for each check.
Let your agent build it
You don’t need to write this code yourself. Copy the prompt and paste it into your agent. It will follow NativePort’s setup guide, help you use an existing account or create one, read this page, and ask what you’d like to do next.
View prompt
Help me use NativePort for this use case. 1. Read https://nativeport.ai/SKILL.md and follow its instructions to learn how to use NativePort. Save or update the skill if your environment supports it. 2. Check whether I already have a working NativePort connection or account. Reuse it if available. Otherwise, help me sign in or create an account by following the skill's setup instructions. Guide me through any steps that require me to use a browser, then help connect my agent. Keep credentials private. 3. Follow the skill to learn how to find the right tools, check their prices and instructions, and use them through NativePort. 4. Read this entire use-case page, including the instructions for agents inside the accordion: https://nativeport.ai/use-cases/monitor-webpage-changes/ Once setup is complete and you have read the page, briefly explain what you can help me do and ask me what I would like to do next. Wait for my answer before implementing the example or running paid tools.
Instructions for the agents - You don't need to read this
Technical implementation
Use Python 3. Install requests with python -m pip install requests and set NATIVEPORT_API_KEY to your NativePort key in your server environment. Keep the key out of browser code.
Install beautifulsoup4. Set TARGET_URL and CONTENT_SELECTOR to a stable page section, such as main. Save this code as check_page.py and run it once per scheduled check in the same working directory. The first run saves a baseline; later runs compare against it. This uses the basic Crawlbase route, without JavaScript rendering.
import difflib
import hashlib
import os
from pathlib import Path
import requests
from bs4 import BeautifulSoup
url = os.environ["TARGET_URL"]
selector = os.environ["CONTENT_SELECTOR"]
response = requests.get("https://api.nativeport.ai/crawlbase",
headers={"Authorization": f"Bearer {os.environ['NATIVEPORT_API_KEY']}"},
params={"url": url}, timeout=120)
response.raise_for_status()
# Crawlbase can report target-page failures in headers despite an HTTP 200.
for name in ("pc_status", "original_status"):
status = response.headers.get(name)
if status and not 200 <= int(status) < 300:
raise RuntimeError(f"Target fetch failed: {name}={status}")
soup = BeautifulSoup(response.text, "html.parser")
section = soup.select_one(selector)
if section is None:
raise RuntimeError("Monitored section missing; keeping the previous snapshot")
for node in section.select("script, style, noscript"):
node.decompose()
current = "\n".join(line.strip() for line in section.get_text("\n").splitlines() if line.strip())
if not current:
raise RuntimeError("Empty monitored section; keeping the previous snapshot")
key = hashlib.sha256((url + "\n" + selector).encode()).hexdigest()[:20]
snapshot = Path(f"snapshot-{key}.txt")
if snapshot.exists():
previous = snapshot.read_text(encoding="utf-8")
changes = "\n".join(difflib.unified_diff(previous.splitlines(), current.splitlines(),
fromfile="previous", tofile="current", lineterm=""))
print(changes or "No text changes in the selected section")
else:
print("Baseline saved; run again later to compare")
temporary = snapshot.with_suffix(".tmp")
temporary.write_text(current, encoding="utf-8")
temporary.replace(snapshot)Avoid overlapping runs for the same snapshot. Check for consent screens or challenge pages before accepting a new baseline. Dates, rotating banners and personalized text can cause noisy changes; narrow the selector accordingly. Notifications and AI summaries are optional follow-up work, not performed by this snippet.
Tool costs
| Tool used in the example | Price per call |
|---|---|
| Crawlbase — one basic page fetch per check | $0.005275 / call |
Each run makes one basic Crawlbase call at the price shown above. Saving a baseline and checking again requires two runs. Storage, scheduling and local comparison run in your own environment; no AI-summary call is included.
Prices in USD. Usage-based tools have no fixed per-call price. View pricing.