Dev.to WebDev 🛠 Dev 👁 0 📖 2 min read

Free Google Search API: what 500 free credits get you, and your first JSON result in 3 minutes

When you just want to test a free google search api against a handful of real queries, the last thing you want is a sales form or a credit card wall before you even see the JSON shape. On SerpBase, a new account starts

When you just want to test a free google search api against a handful of real queries, the last thing you want is a sales form or a credit card wall before you even see the JSON shape.

On SerpBase, a new account starts with 500 free credits and no credit card required. One standard Google Web Search request costs 1 credit, and failed or rate-limited requests are not charged.

What 500 free credits actually cover

500 requests sounds small on paper, but for prototyping it goes a long way:

  • Run a 50-keyword test set across desktop and mobile for 5 days to check field coverage.
  • Test country (gl), language (hl), and date filter (tbs) combinations before writing your parser.
  • Wire up a small RAG or agent tool prototype and inspect real latency on your own queries.

Because failed calls do not deduct credits, debugging a bad parameter or hitting a temporary timeout won't burn through the starter balance.

Your first JSON result in 3 minutes

  1. Sign up, open the API keys page, and copy a key.
  2. Put it in an environment variable so it stays out of your shell history and git repo:
export SERPBASE_API_KEY="your_api_key_here"
  1. Run a single curl call against /google/search:
curl -s -X POST "https://api.serpbase.dev/google/search" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $SERPBASE_API_KEY" \
  -d '{
    "q": "fastapi background tasks",
    "gl": "us",
    "hl": "en"
  }' | jq '{status, credits_charged, top3: .organic[:3] | map({position, rank, title, link})}'

Notice the key goes in the X-API-Key header. Keys in URL query strings are refused so they don't end up in proxy or browser logs.

What comes back in the JSON

Here are the fields most scripts actually read first:

  • status: 0 means the search succeeded. Always check status == 0 in your code even on HTTP 200.
  • organic: array of organic listings. Each item has title, link, snippet, position, rank, and date (when Google shows a date).
  • position vs rank: rank is the organic rank among blue links; position counts other blocks on the page too. Keeping both helps when clicks drop even though organic rank didn't move.
  • ai_overview, people_also_ask, featured_snippet, local_results, top_stories: returned as structured objects/arrays whenever Google renders those blocks for that query.
  • credits_charged: exact credits used by this call (0 on failure).

If you want to verify your key works before spending even 1 credit, GET https://api.serpbase.dev/account/credits returns your current balance for free.

You can check the full field list and grab the 500 starter credits on the SerpBase Google Web Search API page. Full disclosure: I work on SerpBase.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.