NativePort
← All use cases

Read websites that block ordinary requests

Retrieve public pages protected by browser checks so your agent has the content it needs.

The problem

Your agent can understand a product page only after it receives the page. A basic web request may get a browser challenge, an empty page, or a block instead. Asking the model to try harder does not give that request a browser fingerprint or make the missing content appear.

How NativePort helps

NativePort connects your agent to Scrapfly, which handles browser rendering and anti-bot checks when retrieving a public page. The agent gets the retrieved content to work with, while you use your existing NativePort account and balance. Success still depends on the target site; this does not grant access to private accounts.

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 TARGET_URL to the public page you need. Enable rendering for pages whose content loads with JavaScript. These options can affect the request cost.

python
import os
import requests

BASE = "https://api.nativeport.ai"
HEADERS = {"Authorization": f"Bearer {os.environ['NATIVEPORT_API_KEY']}"}

response = requests.get(BASE + "/scrapfly", headers=HEADERS, params={
    "url": os.environ["TARGET_URL"],
    "asp": "true",
    "render_js": "true",
}, timeout=120)
response.raise_for_status()
result = response.json()
print(result["result"]["content"])

Inspect the returned content before passing it to the agent: a successful HTTP response alone does not prove the requested page was retrieved. See the Scrapfly request options.

Tool costs

Tool used in the examplePrice per call
Scrapfly — rendered page with anti-bot protection $0.00015825 / credit (usage-based)

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.