CLI for Bing Webmaster API using API-key authentication.
- API key auth from
BING_WEBMASTER_API_KEYor 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-cliVerify:
bwm --versionpython3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"The CLI reads API key from:
BING_WEBMASTER_API_KEYenvironment variable- 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 loginCheck auth source:
bwm auth whoamiClear local key:
bwm auth clearbwm config set default-site https://example.com
bwm config get default-sitebwm site list
bwm site list --output jsonSite-level stats:
bwm stats site --site https://example.com --start-date 2026-02-01 --end-date 2026-02-26For 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-26Save as CSV:
bwm stats site --site https://example.com --output csv --csv-path ./site-stats.csvCheck if a URL is indexed by Bing:
bwm url check-index --site https://example.com --url https://example.com/pageIf not indexed, CLI attempts to map crawl issue flags from GetCrawlIssues and prints the likely reason.
Submit one URL:
bwm url submit --site https://example.com --url https://example.com/new-pageSubmit many URLs:
bwm url submit --site https://example.com \
--url https://example.com/a \
--url https://example.com/bSubmit URLs from file (one URL per line):
bwm url submit --site https://example.com --file ./urls.txtDefaults:
- credentials:
~/.config/bing-webmaster-cli/credentials.json - app config:
~/.config/bing-webmaster-cli/config.json
Overrides:
BWM_CONFIG_DIRBWM_CREDENTIALS_FILEBWM_APP_CONFIG_FILEBWM_API_BASE_URL
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
This repo includes .github/workflows/publish.yml.
Release flow:
- Bump version in
pyproject.tomlandbingwm_cli/__init__.py. - Commit and push.
- Tag and push:
git tag v0.1.3
git push origin v0.1.3python -m pip install --upgrade build twine
python -m build
python -m twine upload dist/*