Code examples
A search from Python and from TypeScript.
Search from Python and TypeScript
search.pyPython
import os
import httpx
KEY = os.environ["GROUNDER_KEY"]
r = httpx.post(
"https://api.grounder.net/v1/search",
headers={"Authorization": f"Bearer {KEY}"},
json={"query": "offshore wind capacity 2026", "top_k": 5},
timeout=30,
).json()
for hit in r["results"]:
source = "Licensed" if hit["provenance"]["licensed"] else "Open web"
print(hit["rank"], hit["domain"], source, hit["provenance"]["found_by"])
const res = await fetch("https://api.grounder.net/v1/search", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GROUNDER_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: "offshore wind capacity 2026",
top_k: 5,
filters: { recency: { mode: "rolling", days: 30 } },
}),
})
const { results, routing } = await res.json()