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. Also supports batch MPN-list seeding (`--mpn-list`) for bulk workflows without a KiCad project. 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.
Instrucciones de origen · Vista previa de solo lectura
name
digikey
description
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. Also supports batch MPN-list seeding (`--mpn-list`) for bulk workflows without a KiCad project. 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.
DigiKey Parts Search & Analysis
Related Skills
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.
API Credential Setup
The DigiKey API requires OAuth 2.0 credentials. Here's how to set them up:
Create a DigiKey account at digikey.com if you don't have one
The client credentials flow has no user interaction — once configured, API calls work automatically.
DigiKey Product Information API v4
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
Authentication
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).
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.
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.
Datasheet Download & Analysis
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.
Datasheet Directory Sync (Primary Workflow)
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 manifest.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
# Batch mode — sync from a plain MPN list (no KiCad project required)
python3 <skill-path>/scripts/sync_datasheets_digikey.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 seeding a new part
library). The file format is one MPN per line. Blank lines and #
comments (full-line and inline) are skipped. Non-MPN strings (generic
values like 100nF or DNP) are filtered via is_real_mpn() and
de-duplicated. Output defaults to ./datasheets/ in the current working
directory when --output is omitted.
The script:
Runs the kicad schematic analyzer automatically to extract components and MPNs
Filters generic passives — skips entries without real MPNs (e.g., "100nF", "10K")
Tries schematic URLs first — uses the datasheet URL embedded in the KiCad symbol before hitting the DigiKey API, saving API calls
Writes manifest.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.
Tracks failures — failed downloads are recorded with error details and not retried on subsequent runs unless --force is used
Rate-limited — 1 second between DigiKey API calls (configurable with --delay)
Saves progress incrementally — if interrupted, already-downloaded files are preserved
OS-agnostic — uses Python requests library (no wget/curl dependency). Falls back to urllib if requests isn't installed.
Normalizes redirect URLs — DigiKey's 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.
Sets proper User-Agent — many manufacturer sites (Nexperia, Lite-On, STMicro, Molex) block bare urllib or curl requests but serve PDFs fine with a browser User-Agent
Validates PDF headers — rejects HTML error pages or Cloudflare challenge pages that masquerade as downloads
Falls back to alternative sources — tries known URL patterns for Microchip when the primary URL fails
Headless browser fallback — if playwright 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.
* Requires playwright package — falls back gracefully to user notification if not installed.
When Download Fails
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.