# Email Authentication Check (SPF, DKIM, DMARC) (`email.domain_auth`)

Read a domain's mail DNS: MX, SPF (with lookup count), DMARC policy, an optional DKIM selector, MTA-STS and BIMI, with a grade and the issues to fix.

- **Route:** `POST /v1/run/email.domain_auth`
- **Price:** $0.0005 per request ($0.50 per 1,000) · `cost_usd` on every response
- **Source:** GetAllAPIs network checks (`netcheck`) · failover: no
- **Measured latency:** p50 36 ms · p95 36 ms · p99 36 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `domain` | string | yes |  | Sending domain |
| `dkim_selector` | string | no |  | DKIM selector to check, e.g. google |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `grade` | strong, partial, weak or none. |
| `mx` | Mail servers. |
| `spf` | SPF record, 'all' qualifier and DNS lookup count. |
| `dmarc` | DMARC record and policy. |
| `dkim` | Whether the given selector publishes a key. |
| `issues` | What to fix, in plain words. |
| `spoofing_protected` | True when SPF exists and DMARC is quarantine or reject. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/email.domain_auth \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain":"github.com","dkim_selector":"google"}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('email.domain_auth', {'domain': 'github.com', 'dkim_selector': 'google'})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run email.domain_auth '{"domain":"github.com","dkim_selector":"google"}'
```

Quote first (free, validates input): `POST /v1/quote/email.domain_auth` with the same body.
