Skip to content

builtwith/builtwith-official-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BuiltWith CLI 🔍

Non-interactive, scriptable CLI for the BuiltWith API — designed for automation, CI/CD pipelines, and AI agent consumption.

bw domain lookup shopify.com --format table
bw domain lookup shopify.com --nopii | jq '.Results[0].Technologies[].Name'
bw live feed --duration 60 > events.ndjson
bw mcp   # start MCP server for Claude Desktop, VS Code, etc.

🤔 Why this exists

The BuiltWith TUI is great for interactive exploration. This CLI is intentionally different:

  • stdout = data only (JSON/table/CSV) — safe to pipe anywhere
  • stderr = human output (spinners, errors, debug info)
  • Structured exit codes — scripts can distinguish auth failures from rate limits from network errors
  • Multiple auth paths — works in CI with env vars, locally with rc files, or inline with --key

📦 Installation

npm install -g builtwith-official-cli

Or run directly without installing:

npx builtwith-official-cli domain lookup example.com --key YOUR_KEY

Registers as both bw (short) and builtwith (discoverable).


🔑 Authentication

API key is resolved in priority order:

Priority Method
1 --key <value> CLI flag
2 BUILTWITH_API_KEY environment variable
3 .builtwithrc in current directory
4 .builtwithrc in home directory

.env files in the current directory are loaded automatically, so BUILTWITH_API_KEY=xxx in .env works too.

.builtwithrc format:

{"key": "YOUR_API_KEY"}

Copy .builtwithrc.example to get started:

cp .builtwithrc.example ~/.builtwithrc
# then edit with your key

💻 Commands

🌐 Domain

bw domain lookup <domain> [flags]
Flag Description
--nopii Exclude PII data
--nometa Exclude meta data
--noattr Exclude attribution data
--liveonly Only currently-live technologies
--fdrange <YYYYMMDD-YYYYMMDD> First-detected date range
--ldrange <YYYYMMDD-YYYYMMDD> Last-detected date range
bw domain lookup shopify.com
bw domain lookup shopify.com --format table
bw domain lookup shopify.com --nopii --liveonly | jq '.Results[0].Technologies[].Name'
bw domain lookup shopify.com --fdrange 20240101-20241231

📋 Lists

bw lists tech <tech> [--offset <n>] [--limit <n>]
bw lists tech WordPress
bw lists tech Shopify --limit 50 --offset 100

🔗 Relationships

bw relationships lookup <domain>

🆓 Free

bw free lookup <domain>

🏢 Company

bw company find <name>
bw company find "Shopify"

🏷️ Tags

bw tags lookup <lookup>

💡 Recommendations

bw recommendations lookup <domain>

↪️ Redirects

bw redirects lookup <domain>

🔤 Keywords

bw keywords lookup <domain>

📈 Trends

bw trends tech <tech>
bw trends tech React

🛍️ Products

bw products search <query> [--page <n>] [--limit <n>]
bw products search "coffee maker"
bw products search "running shoes" --page 2 --limit 50

🛡️ Trust

bw trust lookup <domain>

👤 Account

bw account whoami
bw account usage

📡 Live Feed

Stream live technology detection events as NDJSON, one event per line.

bw live feed [--duration <seconds>]
# Stream indefinitely (Ctrl+C to stop)
bw live feed

# Capture 60 seconds of events
bw live feed --duration 60 > events.ndjson

# Pipe to jq in real time
bw live feed | jq --unbuffered '.domain'

🚩 Global Flags

Available on every command:

Flag Description
--key <apikey> API key (highest priority)
--format <fmt> json (default) | table | csv
--no-color Disable color on stderr
--dry-run Print request URL (key masked) and exit
--debug Print HTTP metadata to stderr
--quiet Suppress spinner/info stderr output

🖨️ Output Formats

JSON (default)

bw domain lookup example.com | jq '.Results[0].Technologies[].Name'

Table

bw domain lookup example.com --format table

CSV

bw domain lookup example.com --format csv > results.csv

🚦 Exit Codes

Scripts can use exit codes to handle different failure modes:

Code Meaning
0 ✅ Success
1 💥 Unexpected error
2 🔐 Auth failure (missing key, 401, 403)
3 🔍 Not found (404)
4 ⏱️ Rate limit (429)
5 ⚠️ Other API error
6 🌐 Network failure
7 ❌ Invalid input
8 🛑 Interrupted (SIGINT)
bw domain lookup example.com
case $? in
  0) echo "success" ;;
  2) echo "check your API key" ;;
  4) echo "rate limited — slow down" ;;
  6) echo "network error" ;;
esac

🔧 Pipeline Examples

# Get all live tech names for a domain
bw domain lookup shopify.com --liveonly | \
  jq -r '.Results[0].Technologies[].Name' | sort

# Check if a domain uses WordPress
bw domain lookup example.com --quiet --liveonly | \
  jq -e '.Results[0].Technologies[] | select(.Name == "WordPress")' > /dev/null \
  && echo "uses WordPress"

# Export tech stack to CSV
bw domain lookup shopify.com --format csv > shopify-tech.csv

# Capture 5 minutes of live events
bw live feed --duration 300 --quiet > feed.ndjson

# Find all sites using a technology (paginated)
for offset in 0 20 40 60 80; do
  bw domain lists tech React --offset $offset --limit 20 --quiet
done | jq -s 'add'

# CI/CD: fail build if domain check fails
bw domain lookup mysite.com --key "$BUILTWITH_API_KEY" --quiet || exit 1

🐛 Dry Run & Debugging

# Preview the URL that would be called (key is masked)
bw domain lookup example.com --key MYKEY --dry-run
# → https://api.builtwith.com/v22/api.json?KEY=REDACTED&LOOKUP=example.com

# See HTTP response metadata
bw domain lookup example.com --debug

🤖 MCP Server

bw mcp starts a Model Context Protocol server over stdio, exposing all BuiltWith API endpoints as structured tools that any MCP-compatible client can call — Claude Desktop, VS Code, Cursor, Zed, and more.

bw mcp
bw mcp --key YOUR_API_KEY   # pass key inline instead of env/rc file
bw mcp --debug              # log JSON-RPC traffic to stderr

⚙️ Client configuration

Add to your MCP client config (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "builtwith": {
      "command": "bw",
      "args": ["mcp"]
    }
  }
}

If your API key isn't in an env var or .builtwithrc, pass it inline:

{
  "mcpServers": {
    "builtwith": {
      "command": "bw",
      "args": ["mcp", "--key", "YOUR_API_KEY"]
    }
  }
}

🧰 Available tools

Tool Description
domain_lookup 🌐 Technology stack for a domain (supports nopii, liveonly, date ranges)
lists_tech 📋 Domains currently using a technology
relationships_lookup 🔗 Related domains (shared infra, ownership)
free_lookup 🆓 Free-tier category counts for a domain
company_find 🏢 Domains associated with a company name
tags_lookup 🏷️ Domains related to an IP or tag attribute
recommendations_lookup 💡 Technology recommendations for a domain
redirects_lookup ↪️ Live and historical redirect chains
keywords_lookup 🔤 Keyword data for a domain
trends_tech 📈 Historical adoption trend for a technology
products_search 🛍️ Search ecommerce products across indexed stores
trust_lookup 🛡️ Trust/quality score for a domain
account_whoami 👤 Authenticated account identity
account_usage 📊 API usage statistics

🔬 Implementation note

The MCP server is implemented as a pure JSON-RPC 2.0 stdio server with no additional dependencies — auth, HTTP calls, and error handling all use the same code paths as the regular CLI commands.


🛠️ Development

git clone https://github.com/builtwith/builtwith-cli
cd builtwith-cli
npm install
npm test        # 24 tests, node:test built-in (no extra framework)
# Run without installing globally
node bin/bw.js domain lookup example.com --key YOUR_KEY

🔗 Related


📄 License

MIT

About

Non-interactive, scriptable CLI for the BuiltWith API — pipeline-friendly with JSON/table/CSV output and structured exit codes

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors