SerpBase
Back to Blog

Google Exact Match Search API: Quoted Phrases as JSON

Wrap a phrase in quotes inside q to make Google match it exactly. Tested on desktop and phone, with a check of how many results really show the phrase.

December 2, 2026
By SerpBase Team2 min read

Short answer: wrap the phrase in double quotes inside q: "best budget mechanical keyboard". In JSON that means escaping the quotes. Google then looks for the words in that order, and you can check the match on every result yourself.

The request

curl -X POST 'https://api.serpbase.dev/google/search' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d '{"q":"\"best budget mechanical keyboard\"","gl":"us","hl":"en","device":"desktop"}'

What came back

We sent the quoted phrase on 2 December 2026 with both layouts and checked whether each result's title or snippet contains it:

LayoutOrganic resultsPhrase visible in title or snippet
desktop109
phone107

The desktop page was led by forum threads (Reddit r/buildapc, Tom's Hardware forums, overclock.net) and also carried discussions, inline_videos, shopping_results and an ai_overview. The phone page opened with rtings.com, then nytimes.com and arstechnica.com further down.

The results without the phrase in their visible text were close variants ("budget mechanical keyboards that sound…", "best $50 mechanical keyboard"). Google can match words in the page body that the snippet does not show, so a missing phrase in the snippet is not proof the page lacks it.

Python: build the query safely and verify

import json, requests

phrase = "best budget mechanical keyboard"
r = requests.post(
    "https://api.serpbase.dev/google/search",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json={"q": f'"{phrase}"', "gl": "us", "hl": "en", "device": "desktop"},
    timeout=60,
).json()
if r["status"] != 0:
    raise SystemExit(r.get("error"))

for item in r.get("organic", []):
    text = (item["title"] + " " + (item.get("snippet") or "")).lower()
    print("exact" if phrase in text else "close", item["rank"], item["title"])

Letting your HTTP library build the JSON (json= in requests) avoids hand-escaping the quotes.

Things that trip people up

  • Escaping. In a shell, the quotes inside q need a backslash; in code, let the JSON encoder do it.
  • Spelling correction. For a rare phrase Google may still "fix" your words. Send "nfpr":"1" to stop that — see nfpr.
  • Combine with operators. "phrase" site:example.com checks one site; "phrase" -site:example.com finds everyone else using it.
  • Layouts differ. Desktop and phone answers are separate pages; compare like with like.

Related

Cost and docs

A Google search is 1 credit, with or without operators. Failed requests are not charged, and new accounts get 500 free credits.