npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gscdump

v3.8.0

Published

Direct Google Search Console and Bing Webmaster clients with typed queries and Indexing Evidence

Readme

gscdump

npm version npm downloads license

Direct Google Search Console and Bing Webmaster clients with typed queries and Indexing Evidence.

Install

npm install gscdump

gscdump requires Node 22 or newer. It talks to Google over fetch; it does not require the Google API client packages.

Query Search Analytics

Create a client with an access token, an OAuth-like client, or refresh-token credentials:

import { googleSearchConsole } from 'gscdump'

const client = googleSearchConsole({ accessToken: 'ya29.xxx' })
const sites = await client.sites()

Use fetchOptions for custom headers, request hooks, or retry settings:

const client = googleSearchConsole('ya29.xxx', {
  fetchOptions: {
    headers: new Headers({ 'x-project': 'analytics' }),
    retry: 0,
    timeout: 10_000,
    onRequest({ options }) {
      options.headers.set('x-request-id', crypto.randomUUID())
    },
  },
})

Request hooks run after authentication. The client awaits each hook, including arrays of hooks. If you omit retry settings, requests use three retries and respect Google's Retry-After header.

Use gscdump/query to build a request. client.query() paginates through Google's 25,000-row pages and yields each non-empty batch.

import { googleSearchConsole } from 'gscdump'
import { between, date, daysAgo, gsc, page, query } from 'gscdump/query'

const client = googleSearchConsole('ya29.xxx')
const siteUrl = 'sc-domain:example.com'

const request = gsc
  .select(page, query)
  .where(between(date, daysAgo(30), daysAgo(3)))

for await (const rows of client.query(siteUrl, request)) {
  for (const row of rows)
    console.log(row.page, row.query, row.clicks)
}

If you already have a Search Analytics request body, call the direct operation:

const response = await client.searchAnalytics.query(siteUrl, {
  startDate: '2026-06-01',
  endDate: '2026-06-30',
  dimensions: ['page'],
  rowLimit: 1000,
})

Other Google resources

Use the same client for sitemaps, inspections, and eligible Indexing API notifications:

const sitemapList = await client.sitemaps.list(siteUrl)
const inspection = await client.inspect(siteUrl, 'https://example.com/docs')

await client.indexing.publish(
  'https://example.com/jobs/frontend-engineer',
  'URL_UPDATED',
)

Indexing notifications apply only to eligible job or livestream pages. See URL inspection and indexing.

The package root also exports batch and projection helpers such as fetchSitesWithSitemaps, batchInspectUrlsFlatSettled, inspectUrlFlat, and batchRequestIndexing.

Read Bing Indexing Evidence

Use gscdump/bing with an OAuth access token or Bing Webmaster API key. The client returns tagged Result values and never infers an indexed verdict from crawl evidence.

import { bingWebmaster } from 'gscdump/bing'

const client = bingWebmaster({ accessToken: 'access-token' })
// API key alternative: bingWebmaster({ apiKey: 'bing-webmaster-api-key' })
const evidence = await client.getIndexingEvidence(
  'https://example.com/',
  'https://example.com/docs',
)

if (evidence.ok)
  console.log(evidence.value)

const [pages, queries, crawl] = await Promise.all([
  client.getPageStats('https://example.com/'),
  client.getQueryStats('https://example.com/'),
  client.getCrawlStats('https://example.com/'),
])

accessToken also accepts a function returning a string or Promise<string>. The client calls that function before each request, so callers can refresh expiring tokens during long exports. The CLI manages this refresh when you use gscdump bing login --mode local --oauth.

Sitemap XML reading and traversal live in sitemapd. Product feed scoping and exact membership hashing live in gscdump/sitemap-identity. Hosted canonical sitemap membership is available through @gscdump/sdk/v1.

Public subpaths

  • gscdump/client: Google client and authentication types
  • gscdump/indexing: inspection and indexing helpers
  • gscdump/errors: typed Google API failures
  • gscdump/sites: Site helpers
  • gscdump/sitemap-identity: sitemap scope and membership hashing
  • gscdump/query: query builder, columns, operators, Pacific date helpers, and logical query plans
  • gscdump/query/plan: logical query planning only
  • gscdump/bing: Bing Site, URL, traffic, and crawl evidence calls
  • gscdump/dates: explicit UTC and Pacific Search Console date helpers
  • gscdump/contracts: Search Analytics request and response contracts
  • gscdump/result: Result helpers
  • gscdump/normalize: URL normalization
  • gscdump/tenant: site ID encoding and normalization

Hosted gscdump.com clients live in @gscdump/sdk. Storage engines and analyzers live in @gscdump/engine and @gscdump/analysis.

License

MIT