The problem
A company’s overall rating cannot tell an agent whether customers are describing slow deliveries, billing confusion, or a good support experience. The agent needs individual reviews and their context. It cannot reconstruct that evidence from the company name or a search snippet.
How NativePort helps
NativePort lets the agent use a Trustpilot review collector through Apify. Supply the company’s review-page URL and receive records it can organize by topic. Company replies, when present in the output, help the agent distinguish a complaint from the response it received.
Technical implementation
Use Python 3 with requests installed (python -m pip install requests). Set NATIVEPORT_API_KEY in your environment to your NativePort key. Run the snippets on your server, where your key stays private.
Set TRUSTPILOT_URL to the company’s public review page, such as https://www.trustpilot.com/review/apify.com. This example requests a maximum of ten records using the collector’s documented inputs.
import json
import os
import requests
BASE = "https://api.nativeport.ai"
HEADERS = {"Authorization": f"Bearer {os.environ['NATIVEPORT_API_KEY']}"}
response = requests.post(
BASE + "/apify/v2/acts/theagents~trustpilot-reviews/run-sync-get-dataset-items",
headers=HEADERS,
json={"startUrls": [os.environ["TRUSTPILOT_URL"]], "maxItems": 10},
timeout=180,
)
response.raise_for_status()
reviews = response.json()
if not isinstance(reviews, list):
raise RuntimeError("Expected a dataset of review records")
print(json.dumps(reviews, indent=2, ensure_ascii=False))Confirm the company domain before using the output. Keep review identifiers and dates so repeated collections can be deduplicated. A small sample does not establish the experience of every customer. The collector documentation describes its page limits; larger jobs can use the asynchronous Apify flow, with a different billing basis from the synchronous example below.
Tool costs
| Tool used in the example | Price per call |
|---|---|
| Apify — Trustpilot Reviews Scraper, one bounded run | $0.01055 / call |
Prices in USD. Usage-based tools have no fixed per-call price. View pricing.
Let your agent build it
You don’t need to write this code yourself. Copy this page’s link and paste it into your agent. Ask it to follow the guide and implement the feature for you.