--- title: "Serper API guide (2026): free key, pricing, endpoints and examples" category: "guides" url: https://keirolabs.cloud/blog/serper-api-guide-2026 --- ## The 60-second version **Serper (serper.dev) is a Google SERP API: you send a query and get Google's results back as JSON, typically in one to two seconds, at $0.30 to $1.00 per 1,000 searches.** It is one of the cheapest and simplest ways to get Google results into code, and it is built into frameworks such as LangChain. - **Free:** **2,500 free queries** when you sign up, no credit card. - **Price:** prepaid credit packages, **$50 for 50,000 ($1.00 per 1,000) down to $3,750 for 12.5 million ($0.30 per 1,000)**. Credits are valid for six months. - **Speed:** 50 to 300 queries per second depending on package. - **Endpoints:** web search, images, news, maps, places, videos, shopping, Scholar, patents and autocomplete. - **Auth:** send your key in the **`X-API-KEY`** header to `https://google.serper.dev/search`. **Use Serper when you want Google's actual results cheaply and fast.** If your AI agent needs page content rather than links and snippets, read the alternatives section first. ## What is Serper? **Serper is a SERP API, a service that runs Google searches for you and returns the results page as structured data.** You get the organic results with position, title, link and snippet, plus the other blocks Google showed: answer box, knowledge graph, "People also ask", related searches, and more. It is narrower than SerpAPI, its best-known competitor: **Serper covers Google only**, while SerpAPI covers many engines. In exchange it is much cheaper. At 100,000 searches a month Serper costs $30 to $100 depending on the package, against $725 on SerpAPI's Searcher plan. If SERP APIs are new to you, start with [what is a SERP API](/blog/what-is-a-serp-api). ## How do you get a Serper API key? 1. **Sign up** at [serper.dev](https://serper.dev) with Google or email. 2. **Copy your API key** from the dashboard. 3. **Store it as `SERPER_API_KEY`.** LangChain and most other tools read this variable name. 4. **Use the 2,500 free queries** to test. When they run out, buy a credit package; there is no subscription. ## How do you make your first Serper search? **POST a JSON body with your query to `https://google.serper.dev/search`, with the key in `X-API-KEY`.** ```bash curl -X POST https://google.serper.dev/search \ -H "X-API-KEY: $SERPER_API_KEY" \ -H "Content-Type: application/json" \ -d '{"q": "best search api for ai agents", "gl": "us", "hl": "en", "num": 10}' ``` In Python, no SDK needed: ```python import os, requests def serper(q: str, gl: str = "us", hl: str = "en", num: int = 10, tbs: str | None = None) -> dict: body = {"q": q, "gl": gl, "hl": hl, "num": num} if tbs: body["tbs"] = tbs # e.g. "qdr:d" for the past day, "qdr:w" for the past week r = requests.post("https://google.serper.dev/search", headers={"X-API-KEY": os.environ["SERPER_API_KEY"], "Content-Type": "application/json"}, json=body, timeout=20) r.raise_for_status() return r.json() data = serper("serper api pricing") for hit in data.get("organic", []): print(hit["position"], hit["title"], hit["link"]) ``` Organic results come back under `organic`, each with `position`, `title`, `link` and `snippet`, and a `date` when Google shows one. Other blocks, such as `answerBox`, `knowledgeGraph`, `peopleAlsoAsk` and `relatedSearches`, appear when Google displays them for that query. ## Which Serper parameters matter? | Parameter | Example | What it does | |---|---|---| | `q` | `"running shoes"` | The query; Google operators like `site:` work inside it | | `gl` | `"us"`, `"de"`, `"in"` | Country the search runs from | | `hl` | `"en"`, `"de"` | Interface language | | `location` | `"Austin, Texas, United States"` | City-level location, for local results | | `num` | `10` | Results per request | | `page` | `2` | Page of results | | `tbs` | `"qdr:d"`, `"qdr:w"`, `"qdr:m"`, `"qdr:y"` | Time filter: past day, week, month, year | **Set `gl` and `hl` on every request.** Google results vary a lot by country, and a search with no country set may not match what your users see. ## What other Serper endpoints are there? Each Google vertical has its own path on the same host, with the same key and request format: | Endpoint | Returns | |---|---| | `/search` | Web results and SERP blocks | | `/images` | Google Images results | | `/news` | Google News articles with source and date | | `/maps` and `/places` | Local businesses, addresses, ratings | | `/videos` | Video results | | `/shopping` | Products and prices | | `/scholar` | Google Scholar papers | | `/patents` | Google Patents | | `/autocomplete` | Google's query suggestions | So `https://google.serper.dev/news` with `{"q": "nvidia earnings"}` returns news results. Autocomplete is handy for keyword research: it returns the suggestions Google shows as someone types. ## How much does Serper cost? **Serper sells prepaid credit packages; one standard search uses one credit.** Packages from [serper.dev](https://serper.dev), checked October 15, 2026: | Package | Credits | Price | Per 1,000 searches | Rate limit | |---|---|---|---|---| | Free | 2,500 | $0 | free | n/a | | Starter | 50,000 | $50 | $1.00 | 50 queries/second | | Standard | 500,000 | $375 | $0.75 | 100 queries/second | | Scale | 2,500,000 | $1,250 | $0.50 | 200 queries/second | | Ultimate | 12,500,000 | $3,750 | $0.30 | 300 queries/second | Prices exclude sales tax or VAT. **Credits expire after six months,** so buy the package you will actually use in that window: Scale at $0.50 only beats Standard if you run more than about 2.5 million searches within six months. Requesting more results per call may use more credits; check the dashboard's usage figures on your own requests before committing. Monthly cost at a few volumes, using the package that fits and spreading its price over the months its credits last: | Searches a month | Serper | SerpAPI | Keirolabs SERP | |---|---|---|---| | 10,000 | about $10 (Starter) | $150 (Production) | about $1 | | 100,000 | about $75 (Standard) | $725 (Searcher) | about $10 | | 1,000,000 | about $500 (Scale) | $3,750 (Cloud 1M) | about $100 | SerpAPI from [serpapi.com/pricing](https://serpapi.com/pricing); Keirolabs from [our pricing page](https://keirolabs.cloud/pricing). Disclosure: Keirolabs is ours. ## How do you use Serper with LangChain or AI agents? **LangChain ships a Serper wrapper, `GoogleSerperAPIWrapper`, which reads `SERPER_API_KEY` and defaults to `gl="us"`, `hl="en"` and 10 results.** ```python # pip install langchain-community from langchain_community.utilities import GoogleSerperAPIWrapper search = GoogleSerperAPIWrapper() # reads SERPER_API_KEY print(search.run("current Brave Search API price")) ``` Most agent frameworks, including CrewAI and AutoGen, have similar Serper tools. **The limit for agents is that Serper returns snippets, not pages.** A two-line snippet is often not enough for a model to answer accurately, so agents usually follow up by fetching and cleaning the top pages, which adds latency, cost and code. If you find yourself doing that on most queries, an API that returns page content in the same call is simpler; see the alternatives below. ## Is Serper reliable, and is it legal? **Serper depends on Google, like every SERP API.** It fetches results Google does not sell, so changes on Google's side can affect it. When Google removed the `num=100` parameter in September 2025, tools across the industry that relied on it broke at once. On the legal side, a US court dismissed Google's copyright (DMCA) claim against SerpAPI in July 2026, finding that plain search results are not copyrighted works, though related cases continue. We summarize the rulings in [what is a SERP API](/blog/what-is-a-serp-api#is-using-a-serp-api-legal). For production systems, keep a second provider ready, ideally one with its own index. This is not legal advice. ## What are the best Serper alternatives? | Alternative | Price per 1,000 | Choose it when | |---|---|---| | **Keirolabs** | $0.10 (Google SERP), from $0.25 (search with page content) | You want SERP and search-with-content on one key, cheaper, with 1,250 free credits a month | | **SerpAPI** | $3.75 to $25 | You need many engines and detailed SERP features, with a legal guarantee on paid plans | | **DataForSEO** | from $0.60 | You build SEO tools and need Google, Bing, YouTube and more | | **Brave Search API** | $5 | You want an independent index with no dependency on Google | | **Tavily** | $8 pay as you go | Your agent needs results pre-processed for RAG | Details in our guides to [Brave](/blog/brave-search-api-guide-2026) and [Tavily](/blog/tavily-api-guide-2026), and the full list in [SerpAPI alternatives](/blog/serpapi-alternatives). ## Common Serper mistakes - **Leaving out `gl` and `hl`.** Results differ by country; set them explicitly. - **Buying a big package you will not use.** Credits expire after six months. - **Feeding only snippets to a model.** Fetch the pages you need, or use an API that returns content. - **Sending the key as a Bearer token.** Serper reads `X-API-KEY`. - **No fallback.** If Google changes something, every SERP API can be affected at once. ## The short answer Serper is a fast, cheap Google SERP API: 2,500 free queries to start, then $0.30 to $1.00 per 1,000 searches on prepaid credits that last six months, with endpoints for web, news, images, maps, shopping and Scholar. It is the easy choice for Google results in code and in LangChain. For AI agents that need page content, or for protection from changes at Google, compare the alternatives above.