Skip to content

v1.6.0 — returning-visitor cookie jar, is_empty, cache superset, MCP fixes

Choose a tag to compare

@flack0x flack0x released this 19 Aug 03:30
· 4 commits to main since this release

Returning-visitor sessions for the Explore path, plus four small things the
2026-08-16 audit had queued.

Added

  • cookies="disk" on the three Explore functions (CLI --cookies disk;
    the MCP interest tools use it by default) — each browser session reuses the
    Google cookies the previous successful session was issued (a small JSON file
    beside the archive DB, or TRENDSPYG_COOKIES), so trendspyg looks like one
    returning visitor instead of a parade of new ones. Why: measured
    2026-08-19 on an IP that had been busy — brand-new sessions (headed or
    headless, warmed or not) were refused with Google's hard 429 page, while
    sessions carrying an established jar were served, repeatedly, and this held
    through the public API (explore 17s / interest-over-time 13s served; the same
    call without the jar → RateLimitError in the same minute). Best-effort by
    design: a missing/corrupt jar is ignored, a jar Google refuses is dropped
    automatically, and only google.com cookies are kept (written atomically,
    owner-readable where the OS supports it). Opt-in because it stores a Google
    cookie on disk. clear_explore_cookies() (new public name, 47 in __all__)
    deletes it. It does not unlock Related Topics — that widget stays empty
    for headless sessions even with a trusted jar.

  • compare_trending(geos, compact=false) (MCP): compact=true returns
    keyword / rank / volume_min / is_active per trend only — measured 45.8 KB →
    2.8 KB for 3 geos — for agents that only need "what is trending where".
    Default output unchanged.

  • is_empty on the ExploreEnvelope (EXPLORE_SCHEMA_VERSION 1.1 → 1.2,
    additive): True when the interest series has no non-zero point — Google
    answers a keyword it has no data for with an all-zero series (observed
    2026-08-19), which trendspyg returns as-is, so agents can tell "no data"
    from "genuinely flat". Honest limit: Google samples, so a keyword at the
    noise floor came back all-zero on one run and with a lone 100 spike on
    another an hour later (related queries and regions empty both times) — the
    flag states what the series contains, it does not guess intent. The typed
    ExploreEnvelope also gains the gprop field it had been missing since
    1.5.0. download_google_trends_interest_over_time returns a bare list and is
    unchanged; its docstring now says a no-data keyword comes back as zeros.

Changed

  • A cached bigger Explore answer now serves a smaller question. With
    cache="disk", explore -k x --full followed by explore -k x (or
    download_google_trends_interest_over_time) is answered from the cached
    full payload, trimmed to what was asked, instead of costing a second
    browser session. The reverse (a cached small answer for a bigger question)
    still fetches.
  • The MCP handshake reports trendspyg's version. serverInfo.version
    used to be the mcp SDK's own version (1.28.1 on the v1 line; an empty
    string on v2); it is now trendspyg's — verified on SDK 1.28.1 and 2.0.0.
  • CI now also runs the MCP tests against the v1 SDK line (mcp<2) — fresh
    installs resolve v2, local development often has v1, and two v1-shaped test
    assertions had reddened every 3.10+ cell of the matrix before this release.
  • Nine always-skipped placeholder tests in tests/test_csv_downloader.py
    were removed — they could never run and asserted only is not None; the
    browser-driven CSV export is checked live by tests/test_live_contract.py.

Full changelog: v1.5.2...v1.6.0