---
title: "Bing Webmaster API: REST endpoints, authentication, and data quirks"
description: "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."
canonical_url: "https://gscdump.com/learn-google-search-console/bing/webmaster-api"
last_updated: "2026-11-28"
---

> Index of every page on this site: [llms.txt](https://gscdump.com/llms.txt)

Microsoft set 31 August 2026 as the retirement date for legacy Bing Webmaster SOAP and POX APIs, as documented on [Bing Webmaster API](https://learn.microsoft.com/en-us/bingwebmaster/) and [Supported API Protocols](https://learn.microsoft.com/en-us/bingwebmaster/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](https://learn.microsoft.com/en-us/bingwebmaster/getting-access) and recommends OAuth 2.0 for multi-user or production apps.

| Method    | Base URL                                       | Auth transport                         | Scope and blast radius                                              |
| --------- | ---------------------------------------------- | -------------------------------------- | ------------------------------------------------------------------- |
| API key   | `https://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.0 | `https://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](https://learn.microsoft.com/en-us/bingwebmaster/oauth2):

- **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](https://gscdump.com/learn-google-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`:

```bash
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:

```bash
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](https://learn.microsoft.com/en-us/dotnet/api/microsoft.bing.webmaster.api.interfaces.iwebmasterapi?view=bing-webmaster-dotnet).

## Core endpoints and update cadence

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

| Method                   | HTTP | Cadence and scope                                                                                                                   | Primary reference                                                                                                                                                              |
| ------------------------ | ---- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `GetRankAndTrafficStats` | GET  | Daily site clicks and impressions across all verticals (Web, Chat, News, Images, Videos, Knowledge Panel) from 24 March 2023 onward | [GetRankAndTrafficStats](https://learn.microsoft.com/en-us/dotnet/api/microsoft.bing.webmaster.api.interfaces.iwebmasterapi.getrankandtrafficstats?view=bing-webmaster-dotnet) |
| `GetQueryStats`          | GET  | Weekly top queries (`Query`, `Clicks`, `Impressions`, `AvgClickPosition`, `AvgImpressionPosition`, `Date`)                          | [GetQueryStats](https://learn.microsoft.com/en-us/dotnet/api/microsoft.bing.webmaster.api.interfaces.iwebmasterapi.getquerystats?view=bing-webmaster-dotnet)                   |
| `GetPageStats`           | GET  | Weekly top pages, returned as `QueryStats` objects where `Query` holds the page URL                                                 | [GetPageStats](https://learn.microsoft.com/en-us/dotnet/api/microsoft.bing.webmaster.api.interfaces.iwebmasterapi.getpagestats?view=bing-webmaster-dotnet)                     |
| `GetCrawlStats`          | GET  | Daily crawl counts, index counts, and HTTP status buckets for the last 6 months                                                     | [GetCrawlStats](https://learn.microsoft.com/en-us/dotnet/api/microsoft.bing.webmaster.api.interfaces.iwebmasterapi.getcrawlstats?view=bing-webmaster-dotnet)                   |
| `GetUrlInfo`             | GET  | Single-URL discovery date, last crawl date, HTTP status, anchor count, and document size                                            | [GetUrlInfo](https://learn.microsoft.com/en-us/dotnet/api/microsoft.bing.webmaster.api.interfaces.iwebmasterapi.geturlinfo?view=bing-webmaster-dotnet)                         |
| `GetFeeds`               | GET  | Top-level submitted sitemaps (`Url`, `Type`, `Status`, `UrlCount`, `Submitted`, `LastCrawled`, `FileSize`, `Compressed`)            | [GetFeeds](https://learn.microsoft.com/en-us/dotnet/api/microsoft.bing.webmaster.api.interfaces.iwebmasterapi.getfeeds?view=bing-webmaster-dotnet)                             |

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:

```json
{
  "d": [
    {
      "__type": "RankAndTrafficStats:#Microsoft.Bing.Webmaster.Api",
      "Clicks": 15,
      "Date": "/Date(1316156400000-0700)/",
      "Impressions": 100
    }
  ]
}
```

2. **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.
3. **`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.
4. **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).

```ts
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](https://gscdump.com/gscdump-cli/api/bing). For the full direct TypeScript client, read [Direct Bing](https://gscdump.com/gscdump-sdk/guides/read-data/direct-bing) and the [direct client reference](https://gscdump.com/gscdump-sdk/api/direct-client). If you are evaluating managed multi-user access, note that Hosted Partner v1 Bing endpoints on [gscdump for builders](https://gscdump.com/builders) remain in private preview.

## Sitemap

See the full [sitemap](https://gscdump.com/sitemap.md) for all pages.
