skills/digikey/SKILL.md
Search DigiKey for electronic components and download datasheets — primary source for prototype orders and the preferred API method for fetching datasheets. Find parts by keyword or MPN, check pricing/stock, download datasheets via API, analyze specifications. Sync and maintain a local datasheets directory — extract components from schematics, download missing datasheets, keep them up to date. Use when the user asks about electronic components, part specs, datasheets, pricing, stock, footprints, or needs to download a datasheet — even without mentioning "DigiKey". Also for "sync datasheets", "download datasheets for my board/project", or mentions a datasheets directory. DigiKey is the default distributor for prototyping. For BOM workflows, see the bom skill.
npx skillsauth add aklofas/kicad-happy digikeyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Skill | Purpose |
|-------|---------|
| kicad | Schematic analysis — extracts MPNs for datasheet sync |
| bom | BOM management — orchestrates sourcing across distributors |
| spice | Uses DigiKey parametric data for behavioral SPICE models |
DigiKey is the primary source for prototype orders (Mouser is secondary). Its API returns direct PDF datasheet links, making it the preferred datasheet source. For production orders, see lcsc/jlcpcb. For BOM management and export workflows, see bom.
The DigiKey API requires OAuth 2.0 credentials. Here's how to set them up:
https://localhost (not used for client credentials, but required)export DIGIKEY_CLIENT_ID=your_client_id_here
export DIGIKEY_CLIENT_SECRET=your_client_secret_here
If credentials are stored in a central secrets file (e.g., ~/.config/secrets.env), load them first:
export $(grep -v '^#' ~/.config/secrets.env | grep -v '^$' | xargs)
The client credentials flow has no user interaction — once configured, API calls work automatically.
The API is the preferred way to search DigiKey. It returns structured JSON with full product details, pricing, stock, datasheets, and parametric data.
Base URL: https://api.digikey.com
All API requests require OAuth 2.0. Use the client credentials flow (2-legged). Credentials must be loaded as environment variables (see "API Credential Setup" above).
curl -s -X POST https://api.digikey.com/v1/oauth2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=${DIGIKEY_CLIENT_ID}&client_secret=${DIGIKEY_CLIENT_SECRET}&grant_type=client_credentials"
The response returns an access_token valid for 10 minutes. Cache the token in a shell variable and reuse it for subsequent calls in the same session. If you get a 401 error mid-session, the token has expired — re-authenticate to get a fresh one.
Every API call needs:
X-DIGIKEY-Client-Id: ${DIGIKEY_CLIENT_ID}
Authorization: Bearer <access_token>
Optional locale headers:
X-DIGIKEY-Locale-Language: en (default), ja, de, fr, ko, zhs, zht, it, esX-DIGIKEY-Locale-Currency: USD (default), CAD, EUR, GBP, JPY, etc.X-DIGIKEY-Locale-Site: US (default), CA, UK, DE, etc.POST /products/v4/search/keyword
This is the primary search endpoint. Search by MPN, DigiKey part number, description, or keywords.
Request body:
{
"Keywords": "GRM155R71C104KA88D",
"Limit": 25,
"Offset": 0,
"FilterOptionsRequest": {
"MinimumQuantityAvailable": 1,
"SearchOptions": ["InStock", "HasDatasheet", "RoHSCompliant"],
"ManufacturerFilter": [{"Id": "..."}],
"CategoryFilter": [{"Id": "..."}],
"StatusFilter": [{"Id": "..."}],
"MarketPlaceFilter": "ExcludeMarketPlace"
},
"SortOptions": {
"Field": "Price",
"SortOrder": "Ascending"
}
}
Key request fields:
Keywords (string, max 250 chars) — search term (MPN, DK PN, description)Limit (int, 1-50) — results per pageOffset (int) — pagination offsetSearchOptions — array of: InStock, HasDatasheet, RoHSCompliant, NormallyStocking, Has3DModel, HasCadModel, HasProductPhoto, NewProductSortOptions.Field — Price, QuantityAvailable, Manufacturer, ManufacturerProductNumber, DigiKeyProductNumber, MinimumQuantityMarketPlaceFilter — NoFilter, ExcludeMarketPlace, MarketPlaceOnlyResponse — key fields in each Products[] item:
{
"ManufacturerProductNumber": "GRM155R71C104KA88D",
"Manufacturer": {"Id": 563, "Name": "Murata Electronics"},
"Description": {
"ProductDescription": "CAP CER 100NF 16V X7R 0402",
"DetailedDescription": "..."
},
"UnitPrice": 0.01,
"QuantityAvailable": 248000,
"ProductUrl": "https://www.digikey.com/...",
"DatasheetUrl": "https://...",
"PhotoUrl": "https://...",
"ProductVariations": [
{
"DigiKeyProductNumber": "490-10698-1-ND",
"PackageType": {"Name": "Cut Tape"},
"StandardPricing": [
{"BreakQuantity": 1, "UnitPrice": 0.01, "TotalPrice": 0.01},
{"BreakQuantity": 10, "UnitPrice": 0.008, "TotalPrice": 0.08}
],
"QuantityAvailableforPackageType": 248000,
"MinimumOrderQuantity": 1,
"StandardPackage": 10000
}
],
"Parameters": [
{"ParameterText": "Capacitance", "ValueText": "100nF"},
{"ParameterText": "Voltage Rated", "ValueText": "16V"},
{"ParameterText": "Temperature Coefficient", "ValueText": "X7R"},
{"ParameterText": "Package / Case", "ValueText": "0402 (1005 Metric)"}
],
"ProductStatus": {"Status": "Active"},
"Category": {"Name": "Ceramic Capacitors"},
"Classifications": {"RohsStatus": "ROHS3 Compliant"},
"Discontinued": false,
"EndOfLife": false,
"NormallyStocking": true
}
GET /products/v4/search/{productNumber}/productdetails
Use this for expanded information on a specific part. {productNumber} can be a DigiKey part number or manufacturer part number.
Query parameters:
manufacturerId (optional) — disambiguate MPNs that match multiple manufacturers (e.g., "CR2032")Returns the full Product object with all parameters, pricing (including MyPricing if authenticated with account), media links, and related products.
| Endpoint | Method | Description |
|----------|--------|-------------|
| /products/v4/search/{pn}/productdetails | GET | Full product info for one part |
| /products/v4/search/productpricing/{pn} | GET | Pricing with MyPricing for a part |
| /products/v4/search/{pn}/media | GET | All media (images, datasheets) for a part |
| /products/v4/search/manufacturers | GET | All manufacturers (use IDs in KeywordSearch filters) |
| /products/v4/search/categories | GET | All categories (use IDs in KeywordSearch filters) |
| /products/v4/search/{pn}/alternatepackaging | GET | Alternate packaging options |
| /products/v4/search/{pn}/substitutions | GET | Substitute parts |
| /products/v4/search/{pn}/recommendedproducts | GET | Recommended/associated parts |
Per-minute and daily quotas apply. HTTP 429 with Retry-After header on exceed.
All errors return DKProblemDetails:
{"type": "...", "title": "...", "status": 401, "detail": "Invalid token", "correlationId": "..."}
If API credentials are not available or authentication fails, search DigiKey by fetching product pages directly:
https://www.digikey.com/en/products/result?keywords=<url-encoded-query>
Examples:
https://www.digikey.com/en/products/result?keywords=GRM155R71C104KA88D (by MPN)https://www.digikey.com/en/products/result?keywords=100nF+0402+X7R+16V (by specs)Results from DigiKey can be noisy (JS-heavy pages). Look for the product table rows containing: DigiKey part number, MPN, description, unit price, stock quantity, and datasheet links. If results are truncated or empty, try searching by exact MPN rather than keywords.
DigiKey's API provides direct PDF URLs for datasheets — this is the preferred method for downloading datasheets because it avoids web scraping and returns reliable, stable links. Other skills (kicad, bom) should use DigiKey API as the first-choice datasheet source.
Use sync_datasheets_digikey.py to maintain a datasheets/ directory alongside a KiCad project. It extracts components from the schematic, searches DigiKey for datasheet URLs, downloads missing PDFs, and writes an index.json manifest. Subsequent runs are incremental — only new or changed parts are fetched.
# Sync datasheets for a KiCad project (creates datasheets/ next to the schematic)
python3 <skill-path>/scripts/sync_datasheets_digikey.py <file.kicad_sch>
# Preview what would be downloaded
python3 <skill-path>/scripts/sync_datasheets_digikey.py <file.kicad_sch> --dry-run
# Retry previously failed downloads
python3 <skill-path>/scripts/sync_datasheets_digikey.py <file.kicad_sch> --force
# Custom output directory
python3 <skill-path>/scripts/sync_datasheets_digikey.py <file.kicad_sch> -o ./my-datasheets
# Use pre-computed analyzer JSON instead of running the analyzer
python3 <skill-path>/scripts/sync_datasheets_digikey.py analyzer_output.json
# Parallel downloads (3 workers)
python3 <skill-path>/scripts/sync_datasheets_digikey.py <file.kicad_sch> --parallel 3
The script:
index.json manifest — maps each MPN to its PDF file, manufacturer, description, download status, and URL. The kicad skill reads this during design review to cross-reference datasheets with the schematic.--force is used--delay)The index.json manifest structure:
{
"schematic": "/path/to/file.kicad_sch",
"last_sync": "2026-03-09T04:44:30+00:00",
"parts": {
"TPS61023DRLR": {
"file": "TPS61023DRLR.pdf",
"manufacturer": "Texas Instruments",
"description": "Boost converter",
"datasheet_url": "https://...",
"status": "ok",
"references": ["U3", "U2"],
"size_bytes": 2392725
}
}
}
Use fetch_datasheet_digikey.py for one-off datasheet downloads. It handles manufacturer-specific quirks automatically.
# Search by MPN (uses DigiKey API, requires credentials)
python3 <skill-path>/scripts/fetch_datasheet_digikey.py --search "TPS61023" -o datasheet.pdf
# Direct URL download
python3 <skill-path>/scripts/fetch_datasheet_digikey.py "https://www.ti.com/lit/gpn/tps61023" -o datasheet.pdf
# JSON output for script integration
python3 <skill-path>/scripts/fetch_datasheet_digikey.py --search "ADP1706" --json
The script:
requests library (no wget/curl dependency). Falls back to urllib if requests isn't installed.DatasheetUrl for TI parts points to a JS redirect page; the script extracts the direct PDF link. Also fixes protocol-relative //mm.digikey.com/... URLs.urllib or curl requests but serve PDFs fine with a browser User-Agentplaywright is installed, automatically uses a headless Chromium browser as a last resort for sites that serve PDFs via JavaScript (Broadcom doc viewer, Espressif download redirects). Intercepts download events and reads response bodies directly.pip install requests (strongly recommended; urllib fallback can't handle HTTP/2 sites like analog.com)pip install playwright && playwright install chromium (optional; enables headless browser fallback for JS-heavy sites)Tested against 240 components across 8 open-source KiCad projects (96% download success rate, 94% without Playwright):
| Manufacturer | Status | Notes |
|---|---|---|
| TI | Works | URL normalization strips JS redirect wrapper |
| ADI / Analog | Works | requests handles HTTP/2 transparently |
| STMicro | Works | Requires User-Agent header |
| Nexperia | Works | Requires User-Agent header |
| Lite-On | Works | Requires User-Agent header |
| Molex | Works | Requires User-Agent header |
| Renesas | Works | Direct download |
| ON Semi | Works | Direct download |
| NXP | Works | Direct download |
| Diodes Inc | Works | Direct download |
| Microchip | Works | Direct download via API URLs |
| YAGEO, Samsung, Murata | Works | DigiKey-hosted PDFs (mm.digikey.com) |
| Broadcom | Works* | Requires Playwright — docs.broadcom.com serves PDFs via JS download |
| Espressif | Works* | Requires Playwright — download redirect needs JS execution |
| Lattice | Mixed | Some URLs require cookies/auth |
* Requires playwright package — falls back gracefully to user notification if not installed.
If the script or inline download fails (exit code 1), tell the user and provide the URL so they can open it in a real browser. Some manufacturer sites (Lattice, TDK InvenSense) require interactive login, cookies, or CAPTCHA that even a headless browser can't handle. With Playwright installed, Broadcom and Espressif now download automatically.
Example message to the user:
I couldn't download the datasheet for ICE40UP5K-SG48I automatically — Lattice's site requires browser authentication. Here's the direct link: https://www.latticesemi.com/-/media/LatticeSemi/Documents/DataSheets/iCE/FPGA-DS-02008-1-9-iCE40-Ultra-Plus-Family-Data-Sheet.ashx
You can open it in your browser and save it locally, then I can read and analyze it.
The --json output always includes the datasheet_url field even on failure, so you can extract the URL programmatically.
If the script isn't available or you need to do it inline:
DatasheetUrl from the API response//, prepend https:. If it contains ti.com/general/docs/suppproductinfo, extract the gotoUrl query parameter.requests (Python) or wget/curl with a browser User-Agent%PDFIf the DatasheetUrl field is empty or all download methods fail:
/products/v4/search/{pn}/media endpoint for alternative media links"<MPN> datasheet filetype:pdf"When analyzing a datasheet for a KiCad design review (see kicad skill):
-ND standard, -1-ND cut tape, -2-ND digi-reel, -6-ND full reelExcludeMarketPlace filter to avoid third-party seller listingsProductVariations[].StandardPricing[] — check BreakQuantity thresholdsProductStatus and Discontinued/EndOfLife before selecting partsdocumentation
Generate professional engineering documentation from KiCad projects — Hardware Design Descriptions (HDD), CE Technical Files, Interface Control Documents (ICD), Design Review Packages, and Manufacturing Transfer Packages. Auto-runs schematic, PCB, EMC, and thermal analyses; renders schematic and PCB SVGs with subsystem cropping, focus dimming, net highlighting, and pin-net annotation; generates power tree, bus topology, and architecture block diagrams. Produces styled PDF with cover pages, TOC, and vector SVG embedding. Markdown source of truth — human-editable, version-controllable. Use for "generate documentation", "create report", "HDD", "CE technical file", "design review package", "ICD", "render schematic", "render layout", "generate block diagram", "manufacturing package", "generate PDF", or "custom report".
development
EMC pre-compliance risk analysis for KiCad PCB designs — 17 check categories, 42 rule IDs covering ground planes, decoupling, I/O filtering, switching harmonics, clock routing, differential pair skew, board edge radiation, PDN impedance, return paths, crosstalk, ESD protection, and shielding. Produces severity-ranked risk report with pre-compliance test plan. Supports FCC Part 15, CISPR 32, CISPR 25 (automotive), MIL-STD-461G. SPICE-enhanced when available. Use when the user asks about EMC, EMI, radiated/conducted emissions, FCC compliance, CE marking, CISPR, ground plane issues, decoupling strategy, clock routing EMC, switching noise, differential pair skew, or whether their board will pass EMC testing. Also for "will this pass FCC?", "check my EMC", "is my ground plane okay?", "check my decoupling", or "generate an EMC test plan".
testing
Run automatic SPICE simulations on subcircuits detected from KiCad schematic analysis — validates filter frequencies, divider ratios, opamp gains, LC resonance, and crystal load capacitance. Supports ngspice, LTspice, and Xyce (auto-detected). Generates testbenches, runs batch mode, produces structured pass/warn/fail report. Use when the user asks to simulate, verify, or validate any analog subcircuit — RC filters, LC filters, voltage dividers, opamp circuits, crystal oscillators. Also for "simulate my circuit", "run spice", "verify with simulation", "check my filter cutoff", "does this divider give the right voltage", "what's the bandwidth of this opamp stage". Consider suggesting simulation during design reviews when the schematic analyzer reports simulatable subcircuits and a SPICE simulator is available.
development
Analyze KiCad projects and PDF schematics: schematics, PCB layouts, Gerbers, footprints, symbols, netlists, and design rules. Reviews designs for bugs, traces nets, cross-references schematic to PCB, extracts BOM data, checks DRC/ERC, DFM, power trees, and regulator circuits. Analyzes PDF schematics from dev boards, reference designs, eval kits, and datasheets. Supports KiCad 5–10. Use whenever the user mentions .kicad_sch, .kicad_pcb, .kicad_pro, PCB design review, schematic analysis, PDF schematics, reference designs, Gerber files, DRC/ERC, netlist issues, BOM extraction, signal tracing, power budget, DFM, or wants to understand, debug, compare, or review any hardware design. Also for "check my board", "review before fab", "what's wrong with my schematic", "is this ready to order", "check my power supply", "verify this circuit", or any electronics/PCB design question.