# API reference

Use `https://security.getomg.dev` as your base URL. Requests in the public sections require no key. The [OpenAPI 3.1 document](/api/v1/openapi.json) contains machine-readable schemas. The [playground](/docs/playground/) can run public examples.

## Read records and index health

| Request | Inputs | Response |
| --- | --- | --- |
| `GET /api/v1/status` | None | Feed checkpoints, completion flags, and baseline verification. |
| `GET /api/v1/metrics` | None | Index counts and sampled latency distributions. See [Data and metrics](/docs/data-and-metrics/). |
| `GET /api/v1/cves/recent` | Optional `limit` from 1 to 100, default 100. Optional `cursor` from the previous response. | Revisions within the trailing 30 days in descending modification order. Read `records`, `as_of`, and `next_cursor`. |
| `GET /api/v1/cves/{id}` | A canonical CVE ID. Optional `view=summary`. | Stored CVE data and verification metadata. The summary omits the full `payload_json`. A record outside the index returns `404`. |
| `GET /api/v1/epss/{id}` | A canonical CVE ID. | FIRST EPSS score, percentile, date, and history when available. Inspect `status` alongside the nullable `score`. |
| `GET /api/search` | Query `q` with 2 to 80 characters. | Indexed package and advisory matches. |

Treat the recent endpoint as a view of a changing index. Follow `next_cursor` until it is `null`, use each cursor within an hour, and deduplicate recurring reads by ID and revision. A valid cursor can be reused with a URL encoder that preserves its value.

## Look up package advisories

| Request | Inputs | Response |
| --- | --- | --- |
| `GET /api/v1/packages/check` | One `ecosystem` and `name`, with an optional exact `version`. | Up to 200 advisory matches in `advisories`, plus package-level flags. |
| `POST /api/v1/packages/audit` | A JSON `packages` array with 1 to 500 package coordinates, each with an optional exact `version`. | Up to 1,000 `findings` across the batch. `queried` counts input coordinates. `malware_count` and `kev_count` count returned finding rows. |

```sh
curl -fsS 'https://security.getomg.dev/api/v1/packages/audit' \
  -H 'Content-Type: application/json' \
  -d '{"packages":[{"ecosystem":"npm","name":"lodash"},{"ecosystem":"PyPI","name":"requests"}]}'
```

- A name-only lookup puts release-specific malware reports in `scoped_advisories`. Only package-wide malware contributes to the `malware` flag or `malware_count`. Withdrawn reports are excluded.
- Supply `version` to match an installed release. `advisories` or `findings` contains confirmed matches. `scoped_advisories` retains records with insufficient version evidence. Each match includes `detail_url`. Malware records expose `affected_versions` and OSV `affected_ranges`. An empty `fixed_versions` means the source names no fixed release.
- `X-OMG-Match-Scope` is `package_name`, `exact_version`, or `mixed` for batches that combine both.
- `X-OMG-Result-Limit` gives the response cap. When `X-OMG-Result-Limit-Reached` is `true`, more matches may exist.
- An invalid `version` returns HTTP `400` with `invalid_version`. An unsupported ecosystem returns HTTP `400` with `unsupported_ecosystem`.
- For Alpine, use an indexed release in the form `Alpine:vN.M`. Bare `Alpine` returns HTTP `400` with `ecosystem_release_required`.
- An empty result reports zero returned matches for the query. Consider index freshness and source coverage as part of an install or policy decision.

## Work with an enabled workspace

See [pricing](/pricing) for plans and [your account](/account) for subscription management. Store an enabled key on a server or in CI and send `Authorization: Bearer $OMG_API_KEY` or `X-OMG-API-Key`.

| Request | Inputs | Response |
| --- | --- | --- |
| `GET /api/v1/commercial/feed` | Optional `since` timestamp in ISO 8601 UTC, defaulting to the preceding hour. Add `order=asc` to page forward. | The default returns the 100 newest matching records. Forward pages include `as_of` and `next_cursor`. |
| `GET /api/v1/commercial/watchlist` | Workspace key. | Configured package coordinates. |
| `POST /api/v1/commercial/watchlist` | `{ecosystem, name}` as JSON. | Adds the coordinate to the watchlist. |
| `DELETE /api/v1/commercial/watchlist` | `{ecosystem, name}` as JSON. | Removes the coordinate. |
| `GET /api/v1/commercial/webhooks` | Workspace key. | Subscriptions and recent delivery attempts. |
| `POST /api/v1/commercial/webhooks` | `target_url` and optional `events` as JSON. Use HTTPS. | Creates a subscription and provides its signing secret. |
| `DELETE /api/v1/commercial/webhooks` | `{subscription_id}` as JSON. | Disables the owned receiver and frees a subscription slot. |
| `POST /api/v1/commercial/webhooks/replay` | `{delivery_id}` as JSON. | Moves an owned delivery into pending status. Check history for the outcome. |

Read the [webhook guide](/docs/webhooks/) for verification and acknowledgment.

### Page through CVE metadata

Start with `?order=asc&since=2026-12-01T00:00:00Z&limit=100`. The server sorts by upstream modification time and then CVE ID. Each page holds at most 100 records. Follow a returned cursor with its exact value:

```sh
curl -fsSG 'https://security.getomg.dev/api/v1/commercial/feed' \
  -H "Authorization: Bearer $OMG_API_KEY" \
  --data-urlencode "cursor=$NEXT_CURSOR"
```

The first page sets the inclusive upper bound `as_of` for the entire traversal. When `next_cursor` is null, start a new window with `order=asc` and `since`. The feed reflects each CVE's latest indexed revision. An upstream modification timestamp can predate arrival in our index, and a revision can change while you page. For polling, overlap successive windows and deduplicate by CVE ID and `payload_sha256`. A traversal can miss intermediate or late-arriving writes. Use signed publication webhooks when you need notification of a first index write.

## Handle HTTP responses

| Status | Client action |
| --- | --- |
| `304` | Reuse your cached representation. The response body is empty. Use `If-None-Match` on reads that return an ETag. |
| `400` | Correct the query or payload. For an expired cursor, start a new recent-feed read. |
| `401` | Verify the key and the enabled workspace. |
| `404` | Verify the identifier and the route. |
| `409` | Check the workspace's watchlist or subscription capacity. |
| `429` | Wait for the number of seconds in `Retry-After`. Keys on the same account share one quota per minute. |
| `503` | Retry a safe read with bounded backoff. Honor `Retry-After` when present. |

Preserve attribution and publisher notices with the records you reuse. [Data notices](/sources#data-notices)
