Skip to main content

CLI for Bing Webmaster API

Project description

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
  • 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

Install (Recommended)

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

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

Trusted Publishing via GitHub Actions (Recommended)

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

Release flow:

  1. Bump version in pyproject.toml.
  2. Commit and push.
  3. Tag and push:
git tag v0.1.0
git push origin v0.1.0

Manual publishing

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bing_webmaster_cli-0.1.0.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bing_webmaster_cli-0.1.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file bing_webmaster_cli-0.1.0.tar.gz.

File metadata

  • Download URL: bing_webmaster_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bing_webmaster_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 75d8b4620124719e48f7740af70f9288a87ce660d837cac505374ad4740dfc18
MD5 bf33689de9f39bc134959d7d0c4ea45d
BLAKE2b-256 f6128376e2a3355035d9fe193383b93668f35b6c4ef31f893394fd950a689483

See more details on using hashes here.

Provenance

The following attestation bundles were made for bing_webmaster_cli-0.1.0.tar.gz:

Publisher: publish.yml on NmadeleiDev/bing_webmaster_cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bing_webmaster_cli-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bing_webmaster_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c30d4ebdf5dfb2cf3fdf099fcbbd38598168499820ff528789caedef4aafbe50
MD5 07dd817b730a93b667b3e2ce7304813a
BLAKE2b-256 2c80de3f00845c3a6aa939738e89681b7e03d8fe9c320d5010518ceafcebc393

See more details on using hashes here.

Provenance

The following attestation bundles were made for bing_webmaster_cli-0.1.0-py3-none-any.whl:

Publisher: publish.yml on NmadeleiDev/bing_webmaster_cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page