コンテンツにスキップ
Zidooka
スポンサーリンク

Bing Webmaster Tools API — How to Access Search Performance Data Programmatically

* If you need help with the content of this article for work or development, individual support is available.

Bing Webmaster Tools provides a full-featured API that lets you access search performance data (impressions, clicks, rankings, and more) programmatically. This article covers the API basics and how to get started.

As of June 15, 2020, use of the Bing Webmaster API is governed by the Microsoft Services Agreement.

What You Can Do with the API

The Bing Webmaster Tools API gives programmatic access to the following data:

  • Rank & Traffic Stats — Daily impressions and clicks
  • Link Details — Inbound link information
  • Keyword Details — Keyword-level rankings and traffic
  • Crawl Stats — Crawl volume and errors
  • URL & Sitemap Submission — Submit URLs and sitemaps to Bing

Authentication

Two authentication methods are available:

1. API Key (Quick Start)

Generate an API key from your Bing Webmaster Tools settings:

  1. Sign in to Bing Webmaster Tools
  2. Click Settings (top right) → API Access
  3. Accept the terms and click Generate API Key

Each API key is user-scoped — one key works across all sites owned by the same user.

Never share your API key. If compromised, delete and regenerate it from the settings page.

  1. Register an OAuth client under Settings → API Access
  2. Obtain a Client ID and Client Secret
  3. Use the Authorization Code Flow to get an access token
  4. Refresh tokens enable automatic renewal

Available scopes:

  • webmaster.read — Read-only access
  • webmaster.manage — Read and write access

Endpoints and Protocols

The API supports three protocols:

The JSON endpoint is the easiest to work with from modern applications.

Key API Methods

Usage Examples (Node.js)

API Key

const API_KEY = 'YOUR_API_KEY';
const SITE_URL = 'https://www.example.com/';

const res = await fetch(
  `https://ssl.bing.com/webmaster/api.svc/json/GetRankAndTrafficStats?apikey=${API_KEY}&siteUrl=${encodeURIComponent(SITE_URL)}`
);
const data = await res.json();
console.log(data);

OAuth 2.0

const res = await fetch(
  'https://ssl.bing.com/webmaster/api.svc/json/SubmitUrl',
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${ACCESS_TOKEN}`
    },
    body: JSON.stringify({
      siteUrl: 'https://www.example.com/',
      url: 'https://www.example.com/new-page'
    })
  }
);

Comparison with Google Search Console API

Conclusion

The Bing Webmaster Tools API provides a JSON endpoint that is easy to consume from Node.js and other modern runtimes. It offers two authentication paths — API Key for simplicity and OAuth 2.0 for production use. When combined with the Google Search Console API, you can build a unified search analytics pipeline covering both major search engines.

The Bing Webmaster Tools API is a practical, production-ready way to access Bing search performance data programmatically. Its JSON endpoint makes it accessible from any language, and when used alongside GA4 and AdSense APIs, it enables a complete cross-channel analytics stack.

スポンサーリンク

ZIDOOKA!

Need help with the content of this article?

I provide individual technical support related to the issues described in this article, as a freelance developer.
If the problem is blocking your work or internal tasks, feel free to reach out.

Support starts from $30 USD (Estimate provided in advance)

Policy on AI Usage

Some articles on this site are written with the assistance of AI. However, we do not rely entirely on AI for writing; it is used strictly as a support tool. We believe that if using AI improves productivity and helps convey the message more effectively, it should be utilized.

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です