# OMG Security API

Use the no-key API to look up CVEs, check index health, and discover package advisories.

- [Documentation](https://security.getomg.dev/docs/)
- [Quickstart](https://security.getomg.dev/docs/quickstart/)
- [API reference](https://security.getomg.dev/docs/api-reference/)
- [OpenAPI 3.1](https://security.getomg.dev/api/v1/openapi.json)
- [Playground](https://security.getomg.dev/docs/playground/)
- [Agent integration](https://security.getomg.dev/docs/agents/)
- [Webhooks](https://security.getomg.dev/docs/webhooks/)
- [Data and metrics](https://security.getomg.dev/docs/data-and-metrics/)
- [Pricing](https://security.getomg.dev/pricing)
- [Account](https://security.getomg.dev/account)

## Public requests

```sh
curl -fsS 'https://security.getomg.dev/api/v1/status'
curl -fsS 'https://security.getomg.dev/api/v1/cves/recent?limit=25'
```

| Method and path | Response |
| --- | --- |
| `GET /api/v1/status` | Index freshness and completeness. |
| `GET /api/v1/metrics` | Inventory and rolling latency measurements in milliseconds. |
| `GET /api/v1/cves/recent?limit=25` | Recent revisions. Pass the returned `next_cursor` to continue. |
| `GET /api/v1/cves/{id}?view=summary` | CVE metadata. Omit `view` for the published record. |
| `GET /api/v1/epss/{id}` | FIRST EPSS score, percentile, and score date when available. |
| `GET /api/search?q=lodash` | Search indexed CVEs and package advisories. |
| `GET /api/v1/packages/check?ecosystem=npm&name=lodash` | Advisory lookup by name. Up to 200 findings. |
| `POST /api/v1/packages/audit` | Batch advisory lookup by name. Up to 500 input coordinates and 1,000 returned findings. |

Use `next_cursor` verbatim and URL-encode it. Recent results cover a 30-day window and cursors expire in one hour. Coverage can change between pages. Overlap recurring reads and deduplicate by CVE ID and revision.

Use `current`, `checked_at`, and measurement sample counts to interpret status and metrics. A missing percentile has insufficient data. Index-write timing and first-read confirmation are separate measurements.

## Package coverage

```json
{"packages":[{"ecosystem":"npm","name":"lodash"},{"ecosystem":"PyPI","name":"requests"}]}
```

The package endpoints accept an optional exact version on each coordinate. On name-only lookups, release-specific malware appears in `scoped_advisories` and is excluded from package-wide counts. Versioned lookups report confirmed matches and keep unresolved evidence in `scoped_advisories`. Withdrawn records are excluded. Include the Alpine release in the ecosystem identifier. Invalid versions and unsupported ecosystems return HTTP 400. Check `X-OMG-Match-Scope`, `X-OMG-Result-Limit`, and `X-OMG-Result-Limit-Reached` before drawing coverage conclusions. Empty findings only report that the lookup returned no rows.

## Authenticated requests

See [plans](https://security.getomg.dev/pricing) and manage your subscription from your [account](https://security.getomg.dev/account). Use `Authorization: Bearer $OMG_API_KEY` or `X-OMG-API-Key` for an enabled key. Keep it on a server or in a CI secret.

An enabled key provides the commercial feed, package watchlists and webhook management. The default feed returns the newest 100 records. Start with `?order=asc&since=ISO8601` to page forward by upstream modification time. Follow each URL-encoded `next_cursor` until null. Overlap polling windows for locally late arrivals and deduplicate by CVE ID and payload hash. Use the [Webhooks guide](https://security.getomg.dev/docs/webhooks/) to register and disable first-index notifications.

## Errors and notices

Check the HTTP status and JSON `error` field before processing the body. Correct invalid requests before retrying. Use backoff for transient read failures and honor `Retry-After` when present.

Keep publisher notices and attribution supplied with records. [Data notices](https://security.getomg.dev/sources#data-notices)
