Trendflow JS — API Reference - v0.2.0
    Preparing search index...

    Class GoogleTrendsFetcher

    Fetches data via the in-tree Google Trends HTTP session.

    Implements

    Index
    • get currentProxy(): string | undefined

      The proxy currently pinned for queries, if a pool is configured.

      Returns string | undefined

    • Every region Google accepts: [code, name, slug] per country, each with its subregions. Useful for validating a geo before querying it.

      Returns Promise<unknown>

    • Entity suggestions for a partial query — the picker behind the UI's "Topic" results.

      Pass a returned mid as a keyword to any query method to measure the topic rather than the literal phrase; a topic aggregates every spelling and translation of the same concept, so it usually scores far higher than the raw string.

      Needs no cookie and no proxy: this RPC answers on IPs the widgetdata endpoints reject.

      Parameters

      • query: string

      Returns Promise<TopicSuggestion[]>

    • Trending searches for a region. Accepts any country code, not a fixed list, and worldwide works too.

      backend selects the source:

      • "rpc" (default via "auto") — 50 items with growth percentages and volume.
      • "rss" — 10 items with the news articles behind each trend, which the RPC does not carry, but no growth figures. window does not apply: Google ignores it on the feed. There is no worldwide feed, so a country code is required.
      • "auto" — the RPC, falling back to RSS if it fails. RPC first because it returns five times the items with real growth numbers; defaulting to RSS would quietly degrade results.

      TrendingResult.source reports which one answered.

      Parameters

      • region: Region | string & {} = Region.WORLDWIDE
      • options: { backend?: TrendingBackend; window?: number } = {}

      Returns Promise<TrendingResult>