Skip to main content

pangolinfo-serp

Pangolinfo SERP API SDK — AI Overview SERP and keyword trends data for e-commerce intelligence.

Built and maintained by PANGOLIN INFO TECH PTE. LTD.

Installation

pip install pangolinfo-serp

Quick start

from pangolinfo_serp import SerpClient

client = SerpClient(token="your_bearer_token")

# AI Overview for a Google search URL
result = client.ai_overview("https://www.google.com/search?q=how+java+work")
print(result["json"])

# Keyword trends comparison
trends = client.keyword_trends(["shoe", "hat"])
print(trends["json"])

Authentication

Grab a free API key from tool.pangolinfo.com, then pass it as the token argument. It is sent as a Bearer token on every request.

client = SerpClient(token="YOUR_TOKEN")

Methods

ai_overview(url, screenshot=False)

Scrapes a Google search result page and returns the AI Overview, organic results, related searches and references.

  • url (str, required) — Target Google search URL, e.g. "https://www.google.com/search?q=how+java+work".
  • screenshot (bool, optional) — Capture a screenshot of the page.

Posts to POST https://scrapeapi.pangolinfo.com/api/v2/scrape with parserName="googleSearch".

Returns the data object:

{
  "json": {
    "ai_overview": "...",
    "organic": ["..."],
    "related_searches": ["..."],
    "references": ["..."]
  },
  "screenshot": "https://...",
  "taskId": "abc123",
  "url": "https://www.google.com/search?q=..."
}

Example:

with SerpClient(token="TOKEN") as client:
    data = client.ai_overview(
        "https://www.google.com/search?q=best+running+shoes",
        screenshot=True,
    )
    ai = data["json"].get("ai_overview")
    screenshot_url = data.get("screenshot")

keyword_trends(keywords, time_range="today 12-m", region="US", language="en-US")

Returns Google Trends comparison data for one or more keywords.

  • keywords (str | list[str], required) — A single keyword or a list of keywords, e.g. "shoe" or ["shoe", "hat"].
  • time_range (str, optional) — Time range, e.g. "today 12-m" (default), "today 3-m", "today 1-m".
  • region (str, optional) — Region code, e.g. "US" (default), "GB".
  • language (str, optional) — Language, e.g. "en-US" (default).

Posts to POST https://scrapeapi.pangolinfo.com/api/v1/google/trends.

Returns the data object:

{
  "json": {
    "keywordsGeoData": {"..."},
    "keywordsRankData": {"..."},
    "timelineData": ["..."],
    "geoMapData": {"..."}
  },
  "taskId": "abc123",
  "url": "https://trends.google.com/..."
}

Example:

with SerpClient(token="TOKEN") as client:
    data = client.keyword_trends(
        ["shoe", "hat"],
        time_range="today 3-m",
        region="US",
        language="en-US",
    )
    timeline = data["json"]["timelineData"]

Configuration

SerpClient accepts optional configuration:

client = SerpClient(
    token="YOUR_TOKEN",
    base_url="https://scrapeapi.pangolinfo.com",  # default
    timeout=120,  # seconds, AI Overview can take 30s+
)

Use it as a context manager to ensure the underlying HTTP connection is closed:

with SerpClient(token="TOKEN") as client:
    ...

Errors

All errors derive from pangolinfo_serp.SerpError:

Exception When
AuthenticationError HTTP 401 / 403 — bad or missing token.
APIError API returns code != 0 or an HTTP error.
TimeoutError Request times out.
from pangolinfo_serp import SerpClient, APIError, AuthenticationError

try:
    client.ai_overview("https://www.google.com/search?q=java")
except AuthenticationError:
    print("check your token")
except APIError as exc:
    print(f"API error code={exc.code}: {exc}")

License

MIT — © PANGOLIN INFO TECH PTE. LTD.

Metadata

Release files for pangolinfo-serp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pangolinfo-serp 0.2.0
File Size Uploaded Provenance Actions
pangolinfo_serp-0.2.0.tar.gz 5.2 kB Without provenance Details for pangolinfo_serp-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pangolinfo-serp 0.2.0
File Interpreter ABI Platform Actions
pangolinfo_serp-0.2.0-py3-none-any.whl Python 3 none any Details for pangolinfo_serp-0.2.0-py3-none-any.whl

Total release size: 11.9 kB

Release files / pangolinfo_serp-0.2.0.tar.gz

Download URL pangolinfo_serp-0.2.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
aab805e6240155a1e0791e2178ef4db522630d14eda841c56028e6355637194a
BLAKE2b-256 checksum
How to use checksums
b12565632f9c2c1e7d0b2e02c35f43499922fd2dd8e92d3a3135469fcdba7739
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / pangolinfo_serp-0.2.0-py3-none-any.whl

Download URL pangolinfo_serp-0.2.0-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aedee6680e36dec530b28eb10eaadfcb0a20e0756f32057eca7abb25f733ca59
BLAKE2b-256 checksum
How to use checksums
23824d36c142095847693cbf8188807d20d491049d96f46caaa341a736c5f680
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for pangolinfo-serp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page