Build SEO tools on live Google results

Most SEO tool features start from the results page: who ranks for a keyword, with which title and snippet, and which competitors appear across a keyword set. BestSERP returns those results as JSON for any country, at one credit per page of 10, so a weekly analysis of 500 keywords costs $1 a month.

Last updated:

Key takeaways

  • 500 keywords, weekly: 2,000 credits, about $1.00 a month.
  • 5,000 keywords, weekly: 20,000 credits, about $10.00 a month.
  • Built on the Google Search API and the Google Images API and the Google Videos API.
  • A complete Python example is below: set BESTSERP_API_KEY and run it.

The problem

Keyword research, content briefs and competitor analysis all need to know what Google shows today. Third-party keyword databases are refreshed on their schedule, not yours, and rarely cover every country.

With live results you can compute what you need: which domains dominate a topic, how long the ranking titles are, which pages a competitor ranks with, and how that changes week to week.

Suggested architecture

  1. 1

    Collect

    Search each keyword of a project with /search, in the country and language of the market.

  2. 2

    Normalize

    Keep position, domain, link, title and snippet. The domain field is already the host name without www.

  3. 3

    Analyze

    Count domains across keywords (share of voice), compare title lengths, list the pages each competitor ranks with.

  4. 4

    Present

    Show tables and trends. Store raw results so you can add new metrics later without searching again.

Complete example

Competitor overlap across a keyword set (Python). Set BESTSERP_API_KEY and run it with Python 3.9+ and requests.
import os
import time

import requests

API = "https://api.bestserp.com"
HEADERS = {"X-API-KEY": os.environ["BESTSERP_API_KEY"]}


def search(endpoint: str, **body) -> dict:
    """POST one search and return the JSON. Polls while the API answers 202 (still running)."""
    r = requests.post(f"{API}/{endpoint}", headers=HEADERS, json={"timeout": 120, **body}, timeout=130)
    while r.status_code == 202:
        time.sleep(2)
        r = requests.get(f"{API}/requests/{r.json()['requestId']}", headers=HEADERS, timeout=30)
    r.raise_for_status()
    return r.json()


from collections import Counter, defaultdict

KEYWORDS = ["serp api", "google search api", "rank tracker api", "keyword rank checker"]
COUNTRY = "us"

appearances = Counter()            # domain -> number of keywords it ranks for (top 10)
best_page = defaultdict(dict)      # domain -> keyword -> (position, link)

for keyword in KEYWORDS:
    for item in search("search", q=keyword, gl=COUNTRY, hl="en").get("organic", [])[:10]:
        domain = item.get("domain")
        if not domain:
            continue
        appearances[domain] += 1
        best_page[domain].setdefault(keyword, (item["position"], item["link"]))
    time.sleep(1)

print(f"Share of voice for {len(KEYWORDS)} keywords ({COUNTRY}):")
for domain, count in appearances.most_common(10):
    print(f"{count:>2}/{len(KEYWORDS)}  {domain}")
    for keyword, (position, link) in best_page[domain].items():
        print(f"      #{position:<3} {keyword}  {link}")

What it costs

1 credit per page of 10 results, $0.50 per 1,000 credits. The first 3,000 credits are free.
ScenarioCredits per monthCost per month
500 keywords, weekly2,000$1.00
5,000 keywords, weekly20,000$10.00
5,000 keywords, daily150,000$75.00

Frequently asked questions

Can I resell features built on the API?
You can build products on the data the API returns; read the Terms of Service for what is allowed and what is not.
Do you return search volume or keyword difficulty?
No. The API returns search results, not keyword metrics. Use it with a keyword volume source of your choice.
How do I analyze title lengths like Google displays them?
Titles come back as shown on the results page. To check how a title is cut off in pixels, try the free SERP Simulator.
Can I check many countries?
Yes, set gl and hl per request. Any two-letter country code is accepted.

Start with 3,000 free searches

No credit card. Sign in with Google, create a key, send your first request.