Back to APIs
GET

Google Search API

Scrape organic results, ads, knowledge graph, featured snippets, and more from Google Search.

Endpoint

GET https://api.serpii.com/v1/search

Parameters

NameTypeRequiredDescription
qstring
Required
Search query
locationstring
Optional
Geographic location (e.g., 'Dallas, TX')
hlstring
Optional
Language code (e.g., 'en')
glstring
Optional
Country code (e.g., 'us')
numnumber
Optional
Number of results (1-100)
devicestring
Optional
Device type: desktop, mobile, tablet

Code Examples

cURL

curl -X GET "https://api.serpii.com/v1/search?q=YOUR_VALUE" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Node.js

import { Serpii } from 'serpii';

const serpii = new Serpii('YOUR_API_KEY');

const response = await serpii.google_search({
  q: 'YOUR_VALUE',
});

console.log(response);

Python

from serpii import Serpii

client = Serpii('YOUR_API_KEY')

response = client.google_search(
    q='YOUR_VALUE',
)

print(response)

Example Response

{
  "success": true,
  "query": "example query",
  "intent": "informational",
  "sentiment": "neutral",
  "clusters": ["topic1", "topic2"],
  "entities": [
    {"name": "Entity Name", "type": "EntityType"}
  ],
  "organic_results": [
    {
      "position": 1,
      "title": "Result Title",
      "url": "https://example.com",
      "snippet": "Result snippet text...",
      "domain": "example.com"
    }
  ],
  "related_searches": ["related query 1", "related query 2"],
  "credits_used": 1,
  "credits_remaining": 4999
}