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

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

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

Trusted Publishing via GitHub Actions (Recommended)

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/*

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.3.tar.gz (14.3 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.3-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bing_webmaster_cli-0.1.3.tar.gz
  • Upload date:
  • Size: 14.3 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.3.tar.gz
Algorithm Hash digest
SHA256 010cd104785d4c3b38a3e59ba3964ed95af2b990bd517a6b019a83b9dc41a7c2
MD5 c62bee2b94bedc0dfa618f7d15b3040f
BLAKE2b-256 344cb6b3606e152aef081a4ef4823d7a800fa1a3f35590b9ae5fa27134166952

See more details on using hashes here.

Provenance

The following attestation bundles were made for bing_webmaster_cli-0.1.3.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.3-py3-none-any.whl.

File metadata

File hashes

Hashes for bing_webmaster_cli-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 54779d4902e36840a9e6a52a3be9cc87513534bec97122dbd54f1cbe7115c78f
MD5 9e4fac9608108edcaf7fec3b924f5877
BLAKE2b-256 6c4eeb3133e559ee7e890cf3784fef202f1dceabc043cedd86a9ed903a248d63

See more details on using hashes here.

Provenance

The following attestation bundles were made for bing_webmaster_cli-0.1.3-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