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

Bing Webmaster API: REST endpoints, authentication, and data quirks

Authenticate with a Bing API key or OAuth 2.0, migrate off retired SOAP and POX endpoints to JSON REST, and parse WCF dates and errors.

Harlan Wilton
5 min

Microsoft set 31 August 2026 as the retirement date for legacy Bing Webmaster SOAP and POX APIs, as documented on Bing Webmaster API and Supported API Protocols. Microsoft directs developers to REST (JSON/HTTP). Every new or migrated integration uses the JSON/HTTP endpoints, authenticated with either a single user-scoped API key or OAuth 2.0.

Unlike Google Search Console, which rejects API keys for private data, Bing lets you start with an API key in minutes. Watch one crucial detail before writing your first request: API key calls and OAuth 2.0 calls use different hostnames.

Choose API key or OAuth 2.0

Microsoft documents both methods in Getting Access and recommends OAuth 2.0 for multi-user or production apps.

MethodBase URLAuth transportScope and blast radius
API keyhttps://ssl.bing.com/webmaster/api.svc/json/Query string ?apikey=<key>One key per Bing user; accesses every verified site in that account
OAuth 2.0https://www.bing.com/webmaster/api.svc/json/Header Authorization: Bearer <token>Scoped to webmaster.read or webmaster.manage per user grant

Two operational rules apply to API keys. First, Bing allows only one API key per user account. Second, deleting or regenerating that key breaks every script using it across all sites in that account.

For OAuth 2.0, Microsoft documents these endpoints in Accessing Bing Webmaster APIs using OAuth 2.0:

  • Authorize: https://www.bing.com/webmasters/oauth/authorize (response_type=code, exact registered redirect_uri, and space-separated scope of webmaster.read or webmaster.manage).
  • Token exchange and refresh: https://www.bing.com/webmasters/oauth/token (application/x-www-form-urlencoded). Authorization codes expire after 5 minutes.
  • Refresh tokens: Microsoft documents refresh tokens as valid until the user revokes access, though expired or revoked grants still require reauthorization when a refresh fails.

If you also integrate Google, see Search Console API authentication to compare OAuth setups.

Make your first JSON REST request

Start by listing the verified sites on your account or pulling daily site traffic. Pass the exact verified site URL in siteUrl, URL-encoded in the query string.

With an API key stored in BING_API_KEY:

curl --fail-with-body --get \
  'https://ssl.bing.com/webmaster/api.svc/json/GetRankAndTrafficStats' \
  --data-urlencode "apikey=${BING_API_KEY}" \
  --data-urlencode 'siteUrl=https://example.com/' \
  --header 'Accept: application/json'

With an OAuth 2.0 access token stored in BING_ACCESS_TOKEN, switch the host to www.bing.com and send a Bearer header:

curl --fail-with-body --get \
  'https://www.bing.com/webmaster/api.svc/json/GetRankAndTrafficStats' \
  --data-urlencode 'siteUrl=https://example.com/' \
  --header "Authorization: Bearer $BING_ACCESS_TOKEN" \
  --header 'Accept: application/json'

To migrate an older POX call, change /api.svc/pox/ to /api.svc/json/ and parse JSON instead of XML. Method names and query parameter names match the IWebmasterApi interface.

Core endpoints and update cadence

Each endpoint updates on its own schedule and covers a different scope.

MethodHTTPCadence and scopePrimary reference
GetRankAndTrafficStatsGETDaily site clicks and impressions across all verticals (Web, Chat, News, Images, Videos, Knowledge Panel) from 24 March 2023 onwardGetRankAndTrafficStats
GetQueryStatsGETWeekly top queries (Query, Clicks, Impressions, AvgClickPosition, AvgImpressionPosition, Date)GetQueryStats
GetPageStatsGETWeekly top pages, returned as QueryStats objects where Query holds the page URLGetPageStats
GetCrawlStatsGETDaily crawl counts, index counts, and HTTP status buckets for the last 6 monthsGetCrawlStats
GetUrlInfoGETSingle-URL discovery date, last crawl date, HTTP status, anchor count, and document sizeGetUrlInfo
GetFeedsGETTop-level submitted sitemaps (Url, Type, Status, UrlCount, Submitted, LastCrawled, FileSize, Compressed)GetFeeds

Do not sum GetQueryStats or GetPageStats rows to produce a site total. Both return ranked weekly subsets rather than every query or page. Use GetRankAndTrafficStats for daily site totals.

Four response quirks to handle in your parser

Bing's JSON endpoints still wrap payloads in legacy WCF shapes. Handle these four quirks at your API boundary before storing rows:

  1. The { "d": ... } envelope. Every JSON response wraps the data inside a top-level d property and includes a "__type" string on objects:
{
  "d": [
    {
      "__type": "RankAndTrafficStats:#Microsoft.Bing.Webmaster.Api",
      "Clicks": 15,
      "Date": "/Date(1316156400000-0700)/",
      "Impressions": 100
    }
  ]
}
  1. WCF /Date(...)/ timestamps and sentinel dates. Dates arrive as /Date(<epoch-ms><offset>)/ strings. When Bing has no date value, GetUrlInfo and GetFeeds can return .NET minimum or 1601 FILETIME epoch timestamps instead of null. Treat timestamps at or before year 1601 (-11644473600000 ms) as missing dates.
  2. Query holds the URL in GetPageStats, and -1 means missing position. GetPageStats reuses the QueryStats schema, so the page URL sits in Query. Both AvgClickPosition and AvgImpressionPosition can return -1 when unavailable; map -1 to null rather than averaging it into rankings.
  3. Shared-egress IP throttling (ErrorCode: 17). On 1 October 2026, gscdump production diagnostics observed authenticated GetUserSites calls from Cloudflare Workers shared egress returning HTTP 400 with ErrorCode: 17 (ThrottleIP). Identical calls with the same API key from a fixed IP returned HTTP 200. That observation is not a Microsoft SLA for every shared IP, but if you hit ErrorCode: 17, retrying from the same blocked egress IP will not clear it; route requests through a dedicated egress IP.

Call Bing from TypeScript or the CLI

The MIT-licensed gscdump/bing client (from the gscdump package) handles API key and OAuth host routing. It unwraps { "d": ... }, normalizes WCF and sentinel dates, maps -1 positions to null, and returns tagged Result errors (including ErrorCode: 17 as Throttled without a retry delay).

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 traffic = await bing.getRankAndTrafficStats('https://example.com/')
if (!traffic.ok)
  throw traffic.error

console.log(traffic.value)

For quick terminal dumps in Local mode, see the CLI Bing reference. For the full direct TypeScript client, read Direct Bing and the direct client reference. If you are evaluating managed multi-user access, note that Hosted Partner v1 Bing endpoints on gscdump for builders remain in private preview.