API reference
β
Access
Endpoints
Search
Resolving links
Response
Fetch
Resolve
Errors
Every call goes to /api/β¦. Parameters work in the
query string and, for POST, as a JSON body. The full reference is in the
project's README.md.
Access
Create a key in π Access and send it with every request as
Authorization: Bearer <key> or X-Api-Key: <key>.
A key reaches /api/search, /api/fetch,
/api/resolve and /api/engines only. Everything else needs a
UI sign-in. Until the first
admin is created, the service is open to anyone.
curl -H "Authorization: Bearer $KEY" \
" /api/search?q=sourdough+starter&format=json"
Endpoints
GET|POST /api/searchrun a query in a real browser and return the results page
GET|POST /api/fetchopen one URL (a /goto link or any page) and return where it led, plus the rendered page
GET|POST /api/resolvefind where up to 20 links lead, without loading the pages
GET /api/enginesavailable search engines
GET /api/healthliveness probe, no auth
GET /api/statusbrowser, profiles, tabs, solver (UI sign-in)
/api/browser/β¦, /api/profiles/β¦tabs and the profile pool, what this UI drives (UI sign-in)
Search β /api/search
parameter default meaning
qβ the query (required)
formatmarkdownmarkdown, html, text: the page itself as the body; json: parsed results
enginegooglesee /api/engines
hl / glserver config interface language / region code
page1first results page to read
pages1how many consecutive pages to read (capped by the server)
resolvenonefollow result links before answering, see below
profileβ run in this browser profile instead of the next free one
captcha_waitserver config seconds to wait for a human to solve a CAPTCHA; 0 = answer 423 at once
keep_tab0leave the browser tab open afterwards
web / direct1Google: plain "Web" tab / go straight to the results URL
With a page format, the rest of the answer is sent in headers: X-Search-Url,
X-Search-Pages, X-Profile-Id, X-Tab-Id,
X-Duration-Ms, and when they apply X-Search-Truncated and
X-Resolved-Links.
Resolving links
Google hides every result's address behind a /goto?β¦ redirect. With
resolve, the search ctrl+clicks the chosen results on the page and reports
where they lead. Google sees every one of these clicks, so resolve only what you need.
Ads are never clicked, and never appear in the results.
parameter default meaning
resolvenonenone Β· all Β· words: enough of the query's words in title + snippet Β· shingles: the same for runs of consecutive words
resolve_threshold50words/shingles: lowest share of the query found, percent
resolve_shingle2words per shingle
resolve_skip_home1, 0 for allskip results that point at a site's home page (brand results)
resolve_max0most links followed per search, across all pages; 0 = no cap
Words match on their first five letters, so ΡΡΡΠ°Ρ
ΠΎΠ²ΠΊΠ° matches
ΡΡΡΠ°Ρ
ΠΎΠ²ΠΊΠΈ . Each link takes a second or two plus a short pause. Links left
unresolved can be sent to /api/resolve
later.
curl " /api/search?q=car+insurance+quote&format=json&resolve=words&resolve_threshold=60"
curl -X POST /api/search -H "Content-Type: application/json" \
-d '{"q":"car insurance quote","format":"json","resolve":{"mode":"shingles","threshold":50,"max":3}}'
Response β format=json
{
"query": "car insurance quote", "page": 1, "pages": 1,
"url": "https://www.google.com/search?q=β¦", "profileId": "p1",
"parsed": {
"results": [{
"title": "Car Insurance Quotes β Compare Prices & Cover",
"link": "https://www.google.com/goto?β¦",
"description": "β¦",
"page": 1,
"breadcrumb": { "origin": "https://www.admiral.com", "path": "/Car insurance", "url": null, "truncated": false },
"url": "https://www.admiral.com/car-insurance",
"resolve": { "status": "resolved", "score": 100, "method": "click" }
}],
"questions": [], "relatedSearches": [], "aiOverview": { "found": false, "content": null }
},
"resolve": { "mode": "words", "clicked": 9, "resolved": 9, "failed": 0, "skipped": 1 },
"durationMs": 57876
}
linkalways the /goto redirect; pass it to /api/resolve or /api/fetch to follow it later
breadcrumbthe address as printed above the title. A hint only: Google shortens it and mixes in labels
sitelinksthe site's other pages listed under a result, as { title, link, description }. Only with web=0: the Web tab prints none. Never resolved
urlwhere the link really leads; only when resolve.status is resolved, otherwise null
resolve.statusresolved, failed or skipped
resolve.reasonwhy it was skipped: homepage, below-threshold, limit, challenge
resolve.methodclick: a ctrl+click that sent Google's click pings; navigate: the fallback, a new tab with no pings
url and resolve appear only when resolve is not
none. Every field in parsed is best-effort. When it falls short,
ask for the page itself in another format.
Fetch β /api/fetch
Opens one URL in a browser and returns the final address, the redirect chain and the page
after its scripts have run. A /goto link from a recent search is opened in
the profile that ran the search, with the results page as the Referer. A fetch is not a
search: it does not wait out the profile's cooldown between queries, and does not
start a new one.
parameter default meaning
urlβ what to open (required)
formathtmlhtml, markdown or text
raw0the document as served, not sanitised
wait_untilloadload, domcontentloaded or commit
timeoutserver config navigation timeout, seconds
refererthe link's results page override the Referer header
captcha_waitserver config seconds to wait for a human; 0 = answer 423 at once
profile / tabβ use this profile, or an already open tab
keep_tab0leave the tab open afterwards
redirectChain lists every address from url to the final one:
server 30x hops and client-side ones (JavaScript, <meta refresh>).
A 404 or 403 is not an error here: it comes back with its httpStatus and body.
curl -G /api/fetch --data-urlencode 'url=https://www.google.com/goto?β¦'
# β { "url": "https://example.com/article", "redirectChain": [...], "httpStatus": 200, "content": "β¦" }
Resolve β /api/resolve
Finds where links lead without loading the pages behind them. Each link opens in a fresh
tab that closes as soon as it reaches an address off Google, so a /goto
link takes about half a second. Google links go to the profile whose search showed them,
with that results page as the Referer, and are spaced by a short pause. Any other link
goes to whichever profile is free. Like a fetch, a resolve ignores the cooldown between
searches.
parameter default meaning
url / urlsβ the links (required): repeat either in the query string, or a string or array in JSON; at most 20
profileβ send every link to this profile
refererthe link's results page override the Referer header for every link
timeout15per link, seconds
curl -G /api/resolve --data-urlencode 'url=https://www.google.com/goto?β¦'
curl -X POST /api/resolve -H "Content-Type: application/json" \
-d '{"urls":["https://www.google.com/goto?β¦","https://bit.ly/β¦"]}'
# β {
# "results": [{
# "link": "https://www.google.com/goto?β¦", "url": "https://example.com/article",
# "status": "resolved", "redirectChain": ["https://www.google.com/goto?β¦", "https://example.com/article"],
# "session": "redirect-link", "profileId": "p1", "durationMs": 611
# }],
# "resolved": 1, "failed": 0, "skipped": 0, "challenged": false
# }
urlwhere the link leads; null unless status is resolved
statusresolved, failed (see error) or skipped
reasonwhy it was skipped: challenge, an earlier link in the same profile hit a CAPTCHA
redirectChainserver-side 30x hops only. A JavaScript redirect on the page it lands on is not followed: use /api/fetch for that
sessionredirect-link: the search's own profile Β· pinned: your profile Β· pool: any free one
Each link answers for itself: the request is 200 even when every link
failed, and only bad input answers 400. A site that refuses the connection
still resolves, from the redirect's Location header.
Errors
Errors are always JSON: { "error": "<status>", "message": "β¦" }.
400bad parameters
401 / 403no key or sign-in / the key cannot reach this endpoint
423a CAPTCHA is waiting for a human. The answer names the tab: solve it in this UI, then retry. Cloudflare's "Just a momentβ¦" pages are waited out, and their checkbox clicked, before it comes to that
502the page could not be opened (network, navigation)
504no browser profile became free in time