<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->

# API Reference — Supply Chain Mapping

## Wappalyzer API

### Technology Lookup
```bash
curl -s -H "x-api-key: $WAPPALYZER_KEY" \
  "https://api.wappalyzer.com/v2/lookup/?urls=https://example.com"
```

### Response Fields
- `technologies[].name`: Technology name
- `technologies[].categories[].name`: Category (CDN, Analytics, CMS)
- `technologies[].website`: Vendor website

## BuiltWith API

### Free Lookup
```bash
curl -s "https://api.builtwith.com/free1/api.json?KEY=$BW_KEY&LOOKUP=example.com"
```

### Detailed Lookup
```bash
curl -s "https://api.builtwith.com/v21/api.json?KEY=$BW_KEY&LOOKUP=example.com" \
  | jq '.Results[].Result.Paths[].Technologies[] | {Name, Tag}'
```

## Retire.js

### Scan JavaScript
```bash
retire --jspath ./js/ --outputformat json --outputpath retire.json
```

### With Node Modules
```bash
retire --nodepath ./node_modules/ --outputformat json
```

## npm audit

### JSON Output
```bash
npm audit --json > audit.json
```

### Production Only
```bash
npm audit --production --json
```

## pip-audit

### JSON Output
```bash
pip-audit --format json --output audit.json
```

### Requirements File
```bash
pip-audit -r requirements.txt --format json
```

## SecurityScorecard API

### Company Rating
```bash
curl -s -H "Authorization: Token $SSC_KEY" \
  "https://api.securityscorecard.io/companies/example.com"
```

### Factors
```bash
curl -s -H "Authorization: Token $SSC_KEY" \
  "https://api.securityscorecard.io/companies/example.com/factors"
```

## DNS Service Detection

### MX Records (Email Provider)
```bash
dig +short example.com MX
```

### NS Records (DNS Provider)
```bash
dig +short example.com NS
```

### SPF Record (Email Services)
```bash
dig +short example.com TXT | grep spf
```

## Environment Variables

| Variable | Description |
|----------|-------------|
| `WAPPALYZER_KEY` | Wappalyzer API key |
| `BUILTWITH_KEY` | BuiltWith API key |
| `SSC_KEY` | SecurityScorecard API key |
