The problem
A handful of recent reviews may hide older patterns in customer feedback. Your agent needs a larger, dated collection to investigate how complaints or praise have changed over time.
How NativePort helps
NativePort connects your agent to Apify to collect more of the reviews available for a chosen company and download them in manageable batches. Your agent can preserve their dates and sources before comparing periods.
For example, it can collect up to 100 Trustpilot reviews instead of stopping at ten. The result is a larger available sample, not a guarantee that every review ever posted can be recovered.
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/collect-review-history/ 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.
Set TRUSTPILOT_URL to the company’s public review page. Save the code as collect.py, run python collect.py start once and python collect.py check later. Keep review-run.json between invocations. The Actor input uses maxItems to bound collection; dataset pagination downloads the results already collected and does not expand the crawl.
import json
import os
from pathlib import Path
import sys
import requests
BASE = "https://api.nativeport.ai"
HEADERS = {"Authorization": f"Bearer {os.environ['NATIVEPORT_API_KEY']}"}
state = Path("review-run.json")
def call(method, path, **kwargs):
response = requests.request(method, BASE + path, headers=HEADERS, timeout=90, **kwargs)
response.raise_for_status()
return response.json()
if len(sys.argv) != 2 or sys.argv[1] not in {"start", "check"}:
raise SystemExit("Usage: python collect.py start|check")
if sys.argv[1] == "start":
if state.exists():
raise SystemExit("Saved run exists. Use check; do not start a duplicate job.")
run = call("POST", "/apify/v2/acts/theagents~trustpilot-reviews/runs",
json={"startUrls": [os.environ["TRUSTPILOT_URL"]], "maxItems": 100})["data"]
state.write_text(json.dumps({"id": run["id"]}), encoding="utf-8")
print("Run saved:", run["id"])
else:
run_id = json.loads(state.read_text(encoding="utf-8"))["id"]
run = call("GET", f"/apify/v2/actor-runs/{run_id}")["data"]
if run["status"] in {"FAILED", "TIMED-OUT", "ABORTED"}:
raise SystemExit(f"Run ended with {run['status']}; inspect it before retrying")
if run["status"] != "SUCCEEDED":
raise SystemExit(f"Still {run['status']}; run check again later")
dataset = run["defaultDatasetId"]
output = Path("review-history.jsonl")
temporary = output.with_suffix(".tmp")
offset = 0
with temporary.open("w", encoding="utf-8") as handle:
while True:
items = call("GET", f"/apify/v2/datasets/{dataset}/items",
params={"limit": 100, "offset": offset})
if not isinstance(items, list):
raise RuntimeError("Expected a dataset page")
for item in items:
handle.write(json.dumps(item, ensure_ascii=False) + "\n")
offset += len(items)
if len(items) < 100:
break
temporary.replace(output)
print(f"Saved {offset} records to {output}")Inspect actual review dates and the Actor’s output fields before claiming coverage of a period. Keep stable review IDs to deduplicate repeated exports, and retain original date strings. Older or deleted reviews may be inaccessible. Ask for a date range and collection budget before increasing the cap. A timed-out start must be reconciled before retrying.
Tool costs
| Tool used in the example | Price per call |
|---|---|
| Apify — one Trustpilot review run capped at 100 records | Priced from Apify's reported cost for the request or run (usage-based) |
The example starts one collection run with a limit of 100 reviews. Actor execution and result charges determine its settled cost. Status checks and dataset downloads are free. Increasing the limit can increase the cost; it does not guarantee a complete history.
Prices in USD. Usage-based tools have no fixed per-call price. View pricing.