The problem
A product page opened from one country may show a different price or stock message from the same page opened elsewhere. Your agent cannot make a reliable international comparison if it only sees one local version.
How NativePort helps
NativePort uses ScraperAPI to open a product page from the countries you want to compare. Your agent can read the local price and availability shown on each version and keep the source alongside its findings.
For example, it can compare the US and UK versions of one product page. It still needs to check the currency, product variant and delivery details before calling one offer cheaper.
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/compare-prices-across-countries/ 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 PRODUCT_URL to the same public product page for both countries. Set PRICE_SELECTOR and AVAILABILITY_SELECTOR to CSS selectors verified on that retailer’s page. This deliberately extracts fields from the returned HTML; it does not assume every retailer shares one page structure. See ScraperAPI country targeting.
import json
import os
from pathlib import Path
import requests
from bs4 import BeautifulSoup
headers = {"Authorization": f"Bearer {os.environ['NATIVEPORT_API_KEY']}"}
url = os.environ["PRODUCT_URL"]
selectors = {"price": os.environ["PRICE_SELECTOR"],
"availability": os.environ["AVAILABILITY_SELECTOR"]}
rows = []
for country in ("us", "gb"):
response = requests.get("https://api.nativeport.ai/scraperapi", headers=headers,
params={"url": url, "country_code": country}, timeout=120)
response.raise_for_status()
soup = BeautifulSoup(response.text, "html.parser")
row = {"url": url, "country": country}
for name, selector in selectors.items():
node = soup.select_one(selector)
row[name] = (node.get("content") or node.get_text(" ", strip=True)) if node else None
row["reported_credits"] = response.headers.get("sa-credit-cost")
rows.append(row)
Path(f"product-{country}.html").write_text(response.text, encoding="utf-8")
Path("country-comparison.json").write_text(json.dumps(rows, indent=2), encoding="utf-8")
print(json.dumps(rows, indent=2))A missing field is unknown, not “out of stock.” Some sites choose a market from cookies, account settings or a separate country URL, so a country-routed request alone may not change the offer. Verify that each response is a real product page. Preserve displayed currencies and tax/shipping context; the snippet performs no currency conversion.
Tool costs
| Tool used in the example | Price per call |
|---|---|
| ScraperAPI — one page request per country | $0.00051695 / credit (usage-based) |
The example makes two basic requests, one from the US and one from the UK. Each basic request normally uses one credit at the rate shown above. The actual credits reported by the provider control the charge; rendering or premium options can use more credits.
Prices in USD. Usage-based tools have no fixed per-call price. View pricing.