The problem
A single search gives your agent only one view of a topic. Comparing several searches requires it to collect the results consistently and keep track of which question produced each link, instead of mixing everything into one untraceable list.
How NativePort helps
NativePort connects your agent to DataForSEO to collect Google results for each search you want to compare. Your agent receives the result titles and links together with their original search, so it can identify recurring sources and investigate gaps.
For example, it can compare results for three coffee-buying questions in the same country and language, then give you a source list organized by question.
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-search-results/ 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.
The example makes three separate live Google organic searches, with a depth of ten each. The NativePort route supports these live responses, not DataForSEO’s queued task flow.
import json
import os
from pathlib import Path
import requests
BASE = "https://api.nativeport.ai"
HEADERS = {"Authorization": f"Bearer {os.environ['NATIVEPORT_API_KEY']}"}
def live(path, task):
response = requests.post(BASE + path, headers=HEADERS,
json=[task], timeout=120)
response.raise_for_status()
data = response.json()
if data.get("status_code") != 20000:
raise RuntimeError(data.get("status_message", "Provider error"))
tasks = data.get("tasks") or []
if len(tasks) != 1 or tasks[0].get("status_code") != 20000:
raise RuntimeError(f"Task did not succeed: {tasks}")
return tasks[0].get("result") or []
queries = ["best coffee grinder for home", "quiet coffee grinder", "coffee grinder maintenance"]
collected = []
for query in queries:
results = live("/dataforseo/v3/serp/google/organic/live/advanced", {
"keyword": query, "location_code": 2840,
"language_code": "en", "depth": 10,
})
organic = [item for result in results for item in (result.get("items") or [])
if item.get("type") == "organic"]
collected.append({"query": query, "location_code": 2840, "language_code": "en",
"results": [{"title": item.get("title"), "url": item.get("url"),
"position": item.get("rank_group")} for item in organic]})
Path("search-results.json").write_text(json.dumps(collected, indent=2), encoding="utf-8")
print(json.dumps(collected, indent=2))Returned organic counts can be lower than the requested depth. Search results change over time and do not prove the content of a linked page. Open a source before citing a claim from it. Keep concurrency and the number of searches bounded as the workflow grows.
Tool costs
| Tool used in the example | Price per call |
|---|---|
| DataForSEO — Google live results, one call per query | Priced from DataForSEO's reported cost for the request or run (usage-based) |
The example makes three calls, one for each query, requesting a depth of ten results per call. Each call is priced by its endpoint and requested depth. Downloading the linked pages or asking a model to summarize them would add separate tool usage.
Prices in USD. Usage-based tools have no fixed per-call price. View pricing.