Index of every page on this site: llms.txt
Skip to content

Read Bing Indexing Evidence and traffic

The direct Bing client uses a Bing Webmaster OAuth token or API key. It returns tagged Result values for each operation.

Before you start

Use a Bing credential that can access the exact Site URL. Keep it on your server. The direct client reference lists the gscdump/bing export.

Create the client

import { bingWebmaster } from 'gscdump/bing'

const apiKey = process.env.BING_WEBMASTER_API_KEY
if (!apiKey)
  throw new Error('Set BING_WEBMASTER_API_KEY')

const bing = bingWebmaster({ apiKey })
const siteUrl = 'https://example.com/'
const url = 'https://example.com/docs'
const evidence = await bing.getIndexingEvidence(siteUrl, url)
if (!evidence.ok)
  throw evidence.error
console.log(evidence.value)

You can use accessToken instead of apiKey. It accepts a function for refreshed tokens.

Read Site traffic and crawl data

const pages = await bing.getPageStats(siteUrl)
const queries = await bing.getQueryStats(siteUrl)
const crawl = await bing.getCrawlStats(siteUrl)

if (!pages.ok)
  throw pages.error
if (!queries.ok)
  throw queries.error
if (!crawl.ok)
  throw crawl.error

console.log(pages.value, queries.value, crawl.value)

Each method returns a tagged Result. A crawl observation does not prove indexing. Keep its Search Engine and date beside the observation.

List and submit sitemaps

The Bing API calls a submitted sitemap a feed.

const submitted = await bing.submitFeed(siteUrl, 'https://example.com/sitemap.xml')
if (!submitted.ok)
  throw submitted.error

const feeds = await bing.getFeeds(siteUrl)
if (!feeds.ok)
  throw feeds.error

console.log(feeds.value)

getFeeds returns the top-level feeds only. Each feed has its type, status, URL count, and submission and crawl dates. A date is null when Bing has no value. The list does not contain the URLs inside a sitemap.

If the check fails

Inspect the tagged error on the specific URL, page, query, or crawl call. Confirm Site access and credential freshness. For Google rows, use Direct Search Analytics. For a CLI comparison, see Google and Bing Indexing Evidence.