mouser

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Mouser Electronics Parts Search & Analysis

Mouser Electronics元件搜索与分析

Related Skills

相关技能

SkillPurpose
kicad
Schematic analysis — extracts MPNs for part lookup
bom
BOM management — orchestrates sourcing across distributors
digikey
Primary prototype source (prefer for datasheets — direct PDF links)
spice
Uses Mouser parametric data for behavioral SPICE models
Mouser is the secondary source for prototype orders — use when DigiKey is out of stock or has worse pricing. For production orders, see
lcsc
/
jlcpcb
. For BOM management and export workflows, see
bom
. For datasheets, prefer DigiKey's API (direct PDF links) — Mouser blocks automated PDF downloads.
技能用途
kicad
原理图分析——提取MPN用于元件查询
bom
BOM管理——协调多分销商采购
digikey
原型采购主要渠道(优先用于获取数据手册——提供直接PDF链接)
spice
利用Mouser参数数据生成行为SPICE模型
Mouser是原型订单的次要采购渠道——当DigiKey缺货或价格更高时使用。如需生产订单相关内容,请查看
lcsc
/
jlcpcb
。如需BOM管理与导出工作流相关内容,请查看
bom
。获取数据手册时优先选择DigiKey的API(提供直接PDF链接)——Mouser会阻止自动化PDF下载。

API Credential Setup

API凭证设置

Mouser uses simple API key authentication — no OAuth, no tokens, no callback URLs. The Search API key is a UUID passed as a query parameter.
Mouser采用简单API密钥认证——无需OAuth、无需令牌、无需回调URL。搜索API密钥是一个UUID,作为查询参数传递。

Getting Your API Key

获取API密钥

  1. Go to mouser.com → My Mouser → My Account
  2. Under "APIs" section, click "Manage"
  3. Register for Search API key — this is the one needed for part lookups and datasheet downloads
  4. Search API keys may require approval (status shows "pending authorization" initially)
  1. 访问mouser.com → My Mouser → 我的账户
  2. 在“APIs”板块下,点击“管理”
  3. 注册Search API密钥——这是元件查询和数据手册下载所需的密钥
  4. Search API密钥可能需要审核(初始状态显示“pending authorization”)

Setting Credentials

设置凭证

Set the environment variable before running the scripts:
bash
export MOUSER_SEARCH_API_KEY=your-search-api-key-uuid
If credentials are stored in a central secrets file (e.g.,
~/.config/secrets.env
), load them first:
bash
export $(grep -v '^#' ~/.config/secrets.env | grep -v '^$' | xargs)
运行脚本前设置环境变量:
bash
export MOUSER_SEARCH_API_KEY=your-search-api-key-uuid
如果凭证存储在中央密钥文件中(如
~/.config/secrets.env
),请先加载:
bash
export $(grep -v '^#' ~/.config/secrets.env | grep -v '^$' | xargs)

Mouser Search API Reference

Mouser搜索API参考

All search endpoints use the Search API key as a query parameter:
?apiKey=<key>
. Content-Type is
application/json
for all POST requests.
所有搜索端点均使用搜索API密钥作为查询参数:
?apiKey=<key>
。所有POST请求的Content-Type为
application/json

V1 Endpoints

V1端点

Keyword Search

关键词搜索

POST /api/v1/search/keyword?apiKey=<key>
json
{
  "SearchByKeywordRequest": {
    "keyword": "100nF 0402 ceramic capacitor",
    "records": 50,
    "startingRecord": 0,
    "searchOptions": "InStock"
  }
}
  • searchOptions
    :
    "None"
    |
    "Rohs"
    |
    "InStock"
    |
    "RohsAndInStock"
  • records
    : max 50 per request
  • startingRecord
    : offset for pagination
POST /api/v1/search/keyword?apiKey=<key>
json
{
  "SearchByKeywordRequest": {
    "keyword": "100nF 0402 ceramic capacitor",
    "records": 50,
    "startingRecord": 0,
    "searchOptions": "InStock"
  }
}
  • searchOptions
    :
    "None"
    |
    "Rohs"
    |
    "InStock"
    |
    "RohsAndInStock"
  • records
    : 每次请求最多50条
  • startingRecord
    : 分页偏移量

Part Number Search

零件编号搜索

POST /api/v1/search/partnumber?apiKey=<key>
json
{
  "SearchByPartRequest": {
    "mouserPartNumber": "GRM155R71C104KA88D|RC0402FR-0710KL",
    "partSearchOptions": "Exact"
  }
}
  • Up to 10 part numbers, pipe-separated (
    |
    )
  • Works with both Mouser part numbers AND manufacturer part numbers (MPNs)
  • partSearchOptions
    :
    "Exact"
    |
    "BeginsWith"
    |
    "Contains"
POST /api/v1/search/partnumber?apiKey=<key>
json
{
  "SearchByPartRequest": {
    "mouserPartNumber": "GRM155R71C104KA88D|RC0402FR-0710KL",
    "partSearchOptions": "Exact"
  }
}
  • 最多支持10个零件编号,用竖线分隔(
    |
  • 同时支持Mouser零件编号和制造商零件编号(MPN)
  • partSearchOptions
    :
    "Exact"
    |
    "BeginsWith"
    |
    "Contains"

V2 Endpoints

V2端点

V2 adds manufacturer filtering and pagination by page number.
V2新增了制造商筛选和按页码分页功能。

Keyword + Manufacturer Search

关键词+制造商搜索

POST /api/v2/search/keywordandmanufacturer?apiKey=<key>
json
{
  "SearchByKeywordMfrNameRequest": {
    "keyword": "LMR51450",
    "manufacturerName": "Texas Instruments",
    "records": 25,
    "pageNumber": 1,
    "searchOptions": "InStock"
  }
}
Note: the wrapper object name is
SearchByKeywordMfrNameRequest
(not
SearchByKeywordMfrRequest
— the V1 name is deprecated).
POST /api/v2/search/keywordandmanufacturer?apiKey=<key>
json
{
  "SearchByKeywordMfrNameRequest": {
    "keyword": "LMR51450",
    "manufacturerName": "Texas Instruments",
    "records": 25,
    "pageNumber": 1,
    "searchOptions": "InStock"
  }
}
注意:包装对象名称为
SearchByKeywordMfrNameRequest
(而非
SearchByKeywordMfrRequest
——V1名称已废弃)。

Part Number + Manufacturer Search

零件编号+制造商搜索

POST /api/v2/search/partnumberandmanufacturer?apiKey=<key>
POST /api/v2/search/partnumberandmanufacturer?apiKey=<key>

Manufacturer List

制造商列表

GET /api/v2/search/manufacturerlist?apiKey=<key>
Returns the full list of manufacturer names for use in filtered searches.
GET /api/v2/search/manufacturerlist?apiKey=<key>
返回完整的制造商名称列表,用于筛选搜索。

V1 Deprecated Endpoints

V1废弃端点

These still work but V2 equivalents are preferred:
  • POST /api/v1/search/keywordandmanufacturer
    → use V2
  • POST /api/v1/search/partnumberandmanufacturer
    → use V2
  • GET /api/v1/search/manufacturerlist
    → use V2
这些端点仍可使用,但优先选择V2等效端点:
  • POST /api/v1/search/keywordandmanufacturer
    → 使用V2版本
  • POST /api/v1/search/partnumberandmanufacturer
    → 使用V2版本
  • GET /api/v1/search/manufacturerlist
    → 使用V2版本

Search Response Structure

搜索响应结构

All search endpoints return the same response format:
json
{
  "Errors": [],
  "SearchResults": {
    "NumberOfResult": 142,
    "Parts": [...]
  }
}
所有搜索端点返回相同的响应格式:
json
{
  "Errors": [],
  "SearchResults": {
    "NumberOfResult": 142,
    "Parts": [...]
  }
}

Key Part Fields

关键元件字段

FieldTypeDescription
MouserPartNumber
stringMouser's internal part number (prefixed, e.g.,
81-GRM155R71C104KA88
)
ManufacturerPartNumber
stringManufacturer's part number (MPN) — use for cross-distributor matching
Manufacturer
stringManufacturer name
Description
stringProduct description
Category
stringProduct category
DataSheetUrl
stringURL to datasheet PDF (Mouser-hosted — see Datasheet section)
ProductDetailUrl
stringURL to Mouser product page
ImagePath
stringProduct image URL
Availability
stringHuman-readable stock text (e.g., "2648712 In Stock")
AvailabilityInStock
stringNumeric stock quantity (as string)
AvailabilityOnOrder
arrayIncoming stock:
[{Quantity, Date}]
LeadTime
stringFactory lead time (e.g., "84 Days")
LifecycleStatus
string|null"New Product", "End of Life", etc.
IsDiscontinued
string"true" or "false" (string, not boolean)
SuggestedReplacement
stringReplacement MPN if discontinued
Min
stringMinimum order quantity (as string)
Mult
stringOrder multiple (as string)
Reeling
boolTape-and-reel packaging available
ROHSStatus
stringRoHS compliance status
PriceBreaks
arrayTiered pricing:
[{Quantity, Price, Currency}]
ProductAttributes
arrayParametric specs:
[{AttributeName, AttributeValue}]
AlternatePackagings
array|nullAlternate packaging MPNs:
[{APMfrPN}]
SurchargeMessages
arrayTariff/surcharge info:
[{code, message}]
ProductCompliance
arrayHTS codes, ECCN:
[{ComplianceName, ComplianceValue}]
UnitWeightKg
object
{UnitWeight: <float>}
in kg
字段类型描述
MouserPartNumber
字符串Mouser内部零件编号(带前缀,例如
81-GRM155R71C104KA88
ManufacturerPartNumber
字符串制造商零件编号(MPN)——用于跨分销商匹配
Manufacturer
字符串制造商名称
Description
字符串产品描述
Category
字符串产品类别
DataSheetUrl
字符串数据手册PDF的URL(Mouser托管——查看数据手册章节)
ProductDetailUrl
字符串Mouser产品页面的URL
ImagePath
字符串产品图片URL
Availability
字符串人类可读的库存文本(例如"2648712 In Stock")
AvailabilityInStock
字符串库存数量(字符串格式)
AvailabilityOnOrder
数组待入库库存:
[{Quantity, Date}]
LeadTime
字符串工厂交货期(例如"84 Days")
LifecycleStatus
字符串|null"New Product"、"End of Life"等
IsDiscontinued
字符串"true"或"false"(字符串类型,非布尔值)
SuggestedReplacement
字符串停产元件的替代MPN
Min
字符串最小订购量(字符串格式)
Mult
字符串订购倍数(字符串格式)
Reeling
布尔值是否提供卷带包装
ROHSStatus
字符串RoHS合规状态
PriceBreaks
数组阶梯定价:
[{Quantity, Price, Currency}]
ProductAttributes
数组参数规格:
[{AttributeName, AttributeValue}]
AlternatePackagings
数组|null替代包装MPN:
[{APMfrPN}]
SurchargeMessages
数组关税/附加费信息:
[{code, message}]
ProductCompliance
数组HTS编码、ECCN:
[{ComplianceName, ComplianceValue}]
UnitWeightKg
对象
{UnitWeight: <float>}
,单位为千克

Quirks and Gotchas

注意事项与陷阱

  • Price is a string with currency symbol:
    "$0.10"
    , not a float. Parse it before comparing.
  • Stock is a string:
    AvailabilityInStock
    returns
    "2648712"
    not
    2648712
    .
  • IsDiscontinued is a string:
    "true"
    or
    "false"
    , not boolean.
  • Mouser part numbers have prefixes:
    81-GRM155R71C104KA88
    — the prefix is Mouser-specific. Use
    ManufacturerPartNumber
    for cross-referencing.
  • V2 wrapper names differ from V1: V2 uses
    SearchByKeywordMfrNameRequest
    , not
    SearchByKeywordMfrRequest
    .
  • Tariff info:
    SurchargeMessages
    may contain US tariff percentages — useful for cost estimation.
  • On-order data:
    AvailabilityOnOrder
    shows incoming stock quantities and expected dates.
  • 价格为带货币符号的字符串:例如
    "$0.10"
    ,而非浮点数。对比前需解析。
  • 库存为字符串
    AvailabilityInStock
    返回
    "2648712"
    而非
    2648712
  • IsDiscontinued为字符串
    "true"
    "false"
    ,而非布尔值。
  • Mouser零件编号带前缀:例如
    81-GRM155R71C104KA88
    ——前缀为Mouser专属。跨分销商关联时请使用
    ManufacturerPartNumber
  • V2包装名称与V1不同:V2使用
    SearchByKeywordMfrNameRequest
    ,而非
    SearchByKeywordMfrRequest
  • 关税信息
    SurchargeMessages
    可能包含美国关税百分比——对成本估算有用。
  • 待入库数据
    AvailabilityOnOrder
    显示待入库库存数量及预计日期。

Datasheet Download & Sync

数据手册下载与同步

Mouser's
DataSheetUrl
field points to Mouser-hosted URLs (
mouser.com/datasheet/...
). These URLs block automated downloads — they return an HTML "Access denied" page when fetched with Python/curl/wget, even with browser User-Agent headers. The download scripts handle this with a multi-strategy approach:
  1. Try the Mouser datasheet URL directly (works for some parts)
  2. Scrape the Mouser product page HTML for alternative datasheet links
  3. Try manufacturer-specific alternative URL patterns
Note: Mouser's product pages return 403 for most automated requests, so strategy 2 has limited success. DigiKey and LCSC are more reliable datasheet sources.
Mouser的
DataSheetUrl
字段指向Mouser托管的URL(
mouser.com/datasheet/...
)。这些URL阻止自动化下载——当用Python/curl/wget获取时,即使设置浏览器User-Agent头,也会返回HTML“访问被拒绝”页面。下载脚本采用多策略方法处理此问题:
  1. 直接尝试Mouser数据手册URL(对部分元件有效)
  2. 抓取Mouser产品页面HTML以获取替代数据手册链接
  3. 尝试制造商专属的替代URL模式
注意:Mouser产品页面对大多数自动化请求返回403,因此策略2的成功率有限。DigiKey和LCSC是更可靠的数据手册来源。

Datasheet Directory Sync

数据手册目录同步

Use
sync_datasheets_mouser.py
to maintain a
datasheets/
directory alongside a KiCad project. Same workflow and
manifest.json
format as the DigiKey skill.
bash
undefined
使用
sync_datasheets_mouser.py
在KiCad项目旁维护
datasheets/
目录。工作流和
manifest.json
格式与DigiKey技能相同。
bash
undefined

Sync datasheets for a KiCad project

同步KiCad项目的数据手册

python3 <skill-path>/scripts/sync_datasheets_mouser.py <file.kicad_sch>
python3 <skill-path>/scripts/sync_datasheets_mouser.py <file.kicad_sch>

Preview what would be downloaded

预览将要下载的内容

python3 <skill-path>/scripts/sync_datasheets_mouser.py <file.kicad_sch> --dry-run
python3 <skill-path>/scripts/sync_datasheets_mouser.py <file.kicad_sch> --dry-run

Retry previously failed downloads

重试之前失败的下载

python3 <skill-path>/scripts/sync_datasheets_mouser.py <file.kicad_sch> --force
python3 <skill-path>/scripts/sync_datasheets_mouser.py <file.kicad_sch> --force

Custom output directory

自定义输出目录

python3 <skill-path>/scripts/sync_datasheets_mouser.py <file.kicad_sch> -o ./my-datasheets
python3 <skill-path>/scripts/sync_datasheets_mouser.py <file.kicad_sch> -o ./my-datasheets

Parallel downloads (3 workers)

并行下载(3个工作进程)

python3 <skill-path>/scripts/sync_datasheets_mouser.py <file.kicad_sch> --parallel 3
python3 <skill-path>/scripts/sync_datasheets_mouser.py <file.kicad_sch> --parallel 3

Batch mode — sync from a plain MPN list (no KiCad project required)

批量模式——从纯MPN列表同步(无需KiCad项目)

python3 <skill-path>/scripts/sync_datasheets_mouser.py --mpn-list mpns.txt --output ./datasheets

**MPN-list batch mode** (KH-312) — when you have a list of MPNs but no
KiCad project to point at (harness datasheet seeding, bulk part-library
seeding). One MPN per line; blank lines and `#` comments (full-line and
inline) are skipped; generic values (`100nF`, `DNP`) are filtered via
`is_real_mpn()` and de-duplicated. Output defaults to `./datasheets/` in
the current working directory when `--output` is omitted.

**Rate limiting** — the script paces API calls with a 1.0s delay between
requests by default (Mouser's Search API allows 30 calls/min on the free
tier; 1.0s stays comfortably under). Override with `--delay <seconds>` if
you have a higher-tier key or want to slow things down further.
python3 <skill-path>/scripts/sync_datasheets_mouser.py --mpn-list mpns.txt --output ./datasheets

**MPN列表批量模式**(KH-312)——当你有MPN列表但没有对应的KiCad项目时(用于数据手册批量导入、元件库批量导入)。每行一个MPN;空行和`#`注释(整行或行内)会被跳过;通用值(如`100nF`、`DNP`)会通过`is_real_mpn()`过滤并去重。若未指定`--output`,默认输出到当前工作目录的`./datasheets/`。

**速率限制**——脚本默认在请求之间设置1.0秒延迟(Mouser搜索API免费层级允许每分钟30次调用;1.0秒延迟远低于限制)。如果你有更高等级的密钥或想进一步减慢速度,可使用`--delay <seconds>`覆盖默认设置。

Single Datasheet Download

单个数据手册下载

Use
fetch_datasheet_mouser.py
for one-off downloads.
bash
undefined
使用
fetch_datasheet_mouser.py
进行单次下载。
bash
undefined

Search by MPN (uses Mouser API)

通过MPN搜索(使用Mouser API)

python3 <skill-path>/scripts/fetch_datasheet_mouser.py --search "TPS61023DRLR" -o datasheet.pdf
python3 <skill-path>/scripts/fetch_datasheet_mouser.py --search "TPS61023DRLR" -o datasheet.pdf

Direct URL download

直接下载URL

python3 <skill-path>/scripts/fetch_datasheet_mouser.py "https://example.com/datasheet.pdf" -o datasheet.pdf
python3 <skill-path>/scripts/fetch_datasheet_mouser.py "https://example.com/datasheet.pdf" -o datasheet.pdf

JSON output

JSON输出

python3 <skill-path>/scripts/fetch_datasheet_mouser.py --search "ADP1706" --json
undefined
python3 <skill-path>/scripts/fetch_datasheet_mouser.py --search "ADP1706" --json
undefined

Download Strategy

下载策略

The scripts try multiple sources in order:
  1. Schematic URL — uses the datasheet URL embedded in the KiCad symbol (sync only)
  2. Mouser API search — gets the
    DataSheetUrl
    from the API response
  3. Alternative manufacturer sources — tries known URL patterns for major manufacturers (TI, Microchip, etc.) when the Mouser URL is blocked
  4. Headless browser fallback — if
    playwright
    is installed, uses headless Chromium as a last resort
When all methods fail, provide the
ProductDetailUrl
to the user so they can download from the Mouser product page in their browser.
脚本按以下顺序尝试多个来源:
  1. 原理图URL——使用KiCad符号中嵌入的数据手册URL(仅同步功能)
  2. Mouser API搜索——从API响应中获取
    DataSheetUrl
  3. 替代制造商来源——当Mouser URL被阻止时,尝试主要制造商(TI、Microchip等)的已知URL模式
  4. 无头浏览器回退——如果安装了
    playwright
    ,则使用无头Chromium作为最后手段
当所有方法都失败时,将
ProductDetailUrl
提供给用户,以便他们在浏览器中从Mouser产品页面下载。

Web Search Fallback

网页搜索回退

If no API key is available, search Mouser by fetching product pages directly:
  • Search URL:
    https://www.mouser.com/c/?q=<query>
  • Product pages contain full specs, pricing tiers, stock, datasheets
  • Results from Mouser can be noisy (JS-heavy pages)
Include key parameters in the query:
  • Passives: value, package (0402/0603/0805), tolerance, voltage/power rating, dielectric (C0G/X7R)
  • ICs: part number or function, package (QFN/SOIC/TSSOP), key specs (voltage, current, interface)
  • Connectors: type (USB-C, JST-PH), pin count, pitch, mounting (SMD/THT), orientation
如果没有API密钥,可直接抓取产品页面搜索Mouser:
  • 搜索URL:
    https://www.mouser.com/c/?q=<query>
  • 产品页面包含完整规格、阶梯定价、库存、数据手册
  • Mouser的搜索结果可能较杂乱(页面依赖JS)
查询中包含关键参数:
  • 无源元件:参数值、封装(0402/0603/0805)、容差、电压/功率等级、介质(C0G/X7R)
  • 集成电路:零件编号或功能、封装(QFN/SOIC/TSSOP)、关键规格(电压、电流、接口)
  • 连接器:类型(USB-C、JST-PH)、引脚数、间距、安装方式(SMD/THT)、方向

Tips

小贴士

  • Pipe-separate up to 10 part numbers in a single PartNumber search for batch lookups
  • Min
    and
    Mult
    fields matter — some parts have minimum order qty or must be ordered in multiples
  • SurchargeMessages
    may include US tariff percentages — factor into cost estimates
  • AvailabilityOnOrder
    shows incoming stock with expected dates
  • Check
    IsDiscontinued
    and
    LifecycleStatus
    before selecting parts
  • 在单个零件编号搜索中用竖线分隔最多10个零件编号,进行批量查询
  • Min
    Mult
    字段很重要——部分元件有最小订购量或必须按倍数订购
  • SurchargeMessages
    可能包含美国关税百分比——纳入成本估算
  • AvailabilityOnOrder
    显示待入库库存及预计日期
  • 选择元件前检查
    IsDiscontinued
    LifecycleStatus