NativePort
← All use cases

Read traveler reviews from TripAdvisor

Collect reviews of a hotel, restaurant, or attraction so your agent can explain the traveler experience.

The problem

A hotel’s overall score can hide recurring complaints about noise, service, or location. An agent needs the review text and dates to explain those patterns. A normal page fetch may capture only the first visible reviews and miss the structure of TripAdvisor’s review interface.

How NativePort helps

NativePort connects your agent to a TripAdvisor review collector on Apify. Give it the place’s URL and a review limit. It returns individual review records that the agent can read together, while retaining links back to the source.

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 TRIPADVISOR_URL to a specific public hotel, restaurant, or attraction page. This example requests up to ten reviews with their original language using the Actor input schema.

python
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/maxcopell~tripadvisor-reviews/run-sync-get-dataset-items",
    headers=HEADERS,
    json={"startUrls": [{"url": os.environ["TRIPADVISOR_URL"]}],
          "maxItemsPerQuery": 10, "scrapeReviewerInfo": False,
          "disableMachineTranslations": True},
    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))

Check that the records belong to the intended property or venue before summarizing them. Review dates and visit dates can describe different moments, so preserve both when available. The requested limit may return fewer records. For jobs that outgrow a synchronous request, use the asynchronous Apify flow; the table below covers this small synchronous example.

Tool costs

Tool used in the examplePrice per call
Apify — TripAdvisor 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.