Skip to main content

bing-webmaster-cli

CLI for Bing Webmaster API using API-key authentication.

Features

  • API key auth from BING_WEBMASTER_API_KEY or local stored credentials
  • List sites available to your Bing Webmaster account
  • Site and URL traffic stats with CLI-side date range filtering
  • URL index check with crawl-issue reason hints when URL is not indexed
  • Submit one URL or a batch of URLs for indexing
  • Output formats: table, json, csv
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install bing-webmaster-cli

Verify:

bwm --version

Install From Source

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Authentication

The CLI reads API key from:

  1. BING_WEBMASTER_API_KEY environment variable
  2. local credentials file (~/.config/bing-webmaster-cli/credentials.json)

Store key locally:

bwm auth login --api-key "<your-api-key>"

Or interactive prompt:

bwm auth login

Check auth source:

bwm auth whoami

Clear local key:

bwm auth clear

Optional Default Site

bwm config set default-site https://example.com
bwm config get default-site

Usage

Sites

bwm site list
bwm site list --output json

Stats

Site-level stats:

bwm stats site --site https://example.com --start-date 2026-02-01 --end-date 2026-02-26

For stats site and stats url, Bing's API ignores date range parameters on these endpoints. The CLI still accepts --start-date and --end-date, but applies that filtering locally to the returned rows.

URL-level stats:

bwm stats url --site https://example.com --url https://example.com/page --start-date 2026-02-01 --end-date 2026-02-26

Save as CSV:

bwm stats site --site https://example.com --output csv --csv-path ./site-stats.csv

URL Indexing

Check if a URL is indexed by Bing:

bwm url check-index --site https://example.com --url https://example.com/page

If not indexed, CLI attempts to map crawl issue flags from GetCrawlIssues and prints the likely reason.

URL Submission

Submit one URL:

bwm url submit --site https://example.com --url https://example.com/new-page

Submit many URLs:

bwm url submit --site https://example.com \
  --url https://example.com/a \
  --url https://example.com/b

Submit URLs from file (one URL per line):

bwm url submit --site https://example.com --file ./urls.txt

Config Paths

Defaults:

  • credentials: ~/.config/bing-webmaster-cli/credentials.json
  • app config: ~/.config/bing-webmaster-cli/config.json

Overrides:

  • BWM_CONFIG_DIR
  • BWM_CREDENTIALS_FILE
  • BWM_APP_CONFIG_FILE
  • BWM_API_BASE_URL

API References

This CLI is based on Microsoft Bing Webmaster API docs:

  • Getting access: https://learn.microsoft.com/en-us/bingwebmaster/getting-access
  • API interfaces: https://learn.microsoft.com/en-us/dotnet/api/microsoft.bing.webmaster.api.interfaces?view=bing-webmaster-dotnet

Publishing

This repo includes .github/workflows/publish.yml.

Release flow:

  1. Bump version in pyproject.toml and bingwm_cli/__init__.py.
  2. Commit and push.
  3. Tag and push:
git tag v0.1.3
git push origin v0.1.3

Manual publishing

python -m pip install --upgrade build twine
python -m build
python -m twine upload dist/*

Metadata

Release files for bing-webmaster-cli 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bing-webmaster-cli 0.1.3
File Size Uploaded Provenance Actions
bing_webmaster_cli-0.1.3.tar.gz 14.3 kB With provenance Details for bing_webmaster_cli-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bing-webmaster-cli 0.1.3
File Interpreter ABI Platform Actions
bing_webmaster_cli-0.1.3-py3-none-any.whl Python 3 none any Details for bing_webmaster_cli-0.1.3-py3-none-any.whl

Total release size: 28.8 kB

Release files / bing_webmaster_cli-0.1.3.tar.gz

Download URL bing_webmaster_cli-0.1.3.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
010cd104785d4c3b38a3e59ba3964ed95af2b990bd517a6b019a83b9dc41a7c2
BLAKE2b-256 checksum
How to use checksums
344cb6b3606e152aef081a4ef4823d7a800fa1a3f35590b9ae5fa27134166952
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.

Transparency log

Release files / bing_webmaster_cli-0.1.3-py3-none-any.whl

Download URL bing_webmaster_cli-0.1.3-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54779d4902e36840a9e6a52a3be9cc87513534bec97122dbd54f1cbe7115c78f
BLAKE2b-256 checksum
How to use checksums
6c4eeb3133e559ee7e890cf3784fef202f1dceabc043cedd86a9ed903a248d63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.

Transparency log

Security for bing-webmaster-cli 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bing_webmaster_cli-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page