MDN Web Docs

May 6, 2026 ยท View on GitHub

Mode: ๐ŸŒ Public ยท Domain: developer.mozilla.org

Search the official Mozilla Developer Network web docs without auth or browser. One command.

Commands

CommandDescription
opencli mdn search <query>Search MDN Web Docs by keyword

Usage Examples

# Web platform feature search
opencli mdn search fetch --limit 10
opencli mdn search flexbox --limit 5

# JS reference lookups
opencli mdn search "Array.prototype.map"

# Localized search (default: en-US)
opencli mdn search fetch --locale ja --limit 5
opencli mdn search fetch --locale zh-CN --limit 5

# JSON output
opencli mdn search fetch -f json

Output Columns

CommandColumns
searchrank, title, slug, locale, summary, url

The slug column round-trips into MDN's URL space (https://developer.mozilla.org/<locale>/docs/<slug>).

Options

OptionDescription
query (positional)Free-text query
--limitMax results (1โ€“50, default: 10)
--localeDoc locale (default: en-US). Allowed: en-US, de, es, fr, ja, ko, pt-BR, ru, zh-CN, zh-TW.

Caveats

  • Only the locales MDN actually publishes are accepted; passing anything else raises ArgumentError.
  • The summary field is MDN's pre-computed search excerpt with whitespace collapsed; it is not the full document body.
  • MDN throttles aggressive bursts; HTTP 429 surfaces as a typed CommandExecutionError with a retry hint.

Prerequisites

  • No browser required โ€” uses developer.mozilla.org/api/v1/search.