# Go Modules API
> The Go package ecosystem as an API. Look up any Go module by its import path for its latest version, license, source repository, total version count and known security advisories; read a module's full version history with publication dates; and get a module's declared dependencies — direct and indirect — parsed straight from its go.mod, with the required Go version. Covers the entire public Go module graph, from github.com/gin-gonic/gin, github.com/spf13/cobra and golang.org/x/text to gorm.io/gorm and k8s.io/client-go. Live from the official Go module proxy (proxy.golang.org) and Google's deps.dev. Ideal for dependency and supply-chain tooling, SBOM generation, package dashboards and Go developer portals. Modules are addressed by full import path. Open data.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/gomod-api/..."
```

## Pricing
- **Free** (Free) — 3,620 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 49,500 calls/Mo, 8 req/s
- **Pro** ($13/Mo) — 245,000 calls/Mo, 20 req/s
- **Mega** ($35/Mo) — 1,215,000 calls/Mo, 50 req/s

## Endpoints

### Go Modules

#### `GET /v1/dependencies` — Declared dependencies from go.mod

**Parameters:**
- `name` (query, required, string) — Go module import path Example: `github.com/gin-gonic/gin`
- `version` (query, optional, string) — Version, e.g. v1.10.0 (defaults to latest) Example: `v1.10.0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/gomod-api/v1/dependencies?name=github.com%2Fgin-gonic%2Fgin&version=v1.10.0"
```

**Response:**
```json
{
    "data": {
        "module": "github.com/gin-gonic/gin",
        "version": "v1.10.0",
        "go_version": "1.20",
        "total_count": 29,
        "dependencies": [
            {
                "module": "github.com/bytedance/sonic",
                "version": "v1.11.6",
                "indirect": false
            },
            {
                "module": "github.com/gin-contrib/sse",
                "version": "v0.1.0",
                "indirect": false
            },
            {
                "module": "github.com/go-playground/validator/v10",
                "version": "v10.20.0",
                "indirect": false
            },
            {
                "module": "github.com/goccy/go-json",
                "version": "v0.10.2",
                "indirect": false
            },
            {
                "module": "github.com/json-iterator/go",
                "version": "v1.1.12",
                "indirect": false
            },
            {
                "module": "github.com/mattn/go-isatty",
                "version": "v0.0.20",
                "indirect": false
            },
            {
                "module": "github.com/pelletier/go-toml/v2",
                "version": "v2.2.2",
                "indirect": false
            },
            {
                "module": "github.com/stretchr/testify",
                "version": "v1.9.0",
                "indirect": false
            },
            {
                "module": "github.com/ug
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/module` — Module metadata + latest version + advisories

**Parameters:**
- `name` (query, required, string) — Go module import path, e.g. github.com/gin-gonic/gin Example: `github.com/gin-gonic/gin`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/gomod-api/v1/module?name=github.com%2Fgin-gonic%2Fgin"
```

**Response:**
```json
{
    "data": {
        "module": {
            "name": "github.com/gin-gonic/gin",
            "homepage": null,
            "licenses": [
                "MIT"
            ],
            "published": "2026-02-28T10:10:09Z",
            "repository": "https://github.com/gin-gonic/gin",
            "version_count": 2334,
            "advisory_count": 0,
            "latest_version": "v1.12.0",
            "pkg_go_dev_url": "https://pkg.go.dev/github.com/gin-gonic/gin",
            "recent_versions": [
                {
                    "version": "v1.12.1-0.20260509022032-5f4f9643258d",
                    "published": "2026-05-09T02:20:32Z"
                },
                {
                    "version": "v1.12.1-0.20260330225428-a6315125d2a5",
                    "published": "2026-03-30T22:54:28Z"
                },
                {
                    "version": "v0.0.0-20260316124959-d3ffc9985281",
                    "published": "2026-03-16T12:49:59Z"
                },
                {
                    "version": "v1.12.1-0.20260316124959-d3ffc9985281",
                    "published": "2026-03-16T12:49:59Z"
                },
                {
                    "version": "v1.12.1-0.20260315091642-ecd26c883557",
                    "published": "2026-03-15T09:16:42Z"
                },
                {
                    "version": "v1.12.1-0.20260315063458-a749e4d33c2d",
                    "published": "2026-03-15T06:34:58Z"
                },
      
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/versions` — Version history

**Parameters:**
- `name` (query, required, string) — Go module import path Example: `golang.org/x/text`
- `limit` (query, optional, string) — Max versions (1-500, default 50)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/gomod-api/v1/versions?name=golang.org%2Fx%2Ftext"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "total": 921,
        "module": "golang.org/x/text",
        "versions": [
            {
                "version": "v0.37.0",
                "published": "2026-05-08T14:56:42Z",
                "is_default": true,
                "is_deprecated": false
            },
            {
                "version": "v0.36.0",
                "published": "2026-04-09T11:43:05Z",
                "is_default": false,
                "is_deprecated": false
            },
            {
                "version": "v0.34.1-0.20260310014136-7ca2c6d99153",
                "published": "2026-03-10T01:41:36Z",
                "is_default": false,
                "is_deprecated": false
            },
            {
                "version": "v0.35.0",
                "published": "2026-03-10T01:41:36Z",
                "is_default": false,
                "is_deprecated": false
            },
            {
                "version": "v0.34.1-0.20260211190941-73d1ba91404d",
                "published": "2026-02-11T19:09:41Z",
                "is_default": false,
                "is_deprecated": false
            },
            {
                "version": "v0.34.0",
                "published": "2026-02-09T16:14:29Z",
                "is_default": false,
                "is_deprecated": false
            },
            {
                "version": "v0.33.1-0.20260122225119-3264de9174be",
                "published": "2026-01-22T22:51:19Z",
          
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Source & options

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/gomod-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Live Go module data. /v1/module = metadata (latest version, license, repository, version count, security advisories); /v1/versions = version history with dates; /v1/dependencies = the module's declared dependencies parsed from its go.mod (direct + indirect; pass a version or it defaults to the latest). Modules are addressed by full import path, e.g. github.com/gin-gonic/gin.",
        "source": "Go modules — via the Go module proxy (proxy.golang.org) and deps.dev",
        "endpoints": [
            "/v1/module",
            "/v1/versions",
            "/v1/dependencies",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-05-31T13:13:23.661Z",
        "request_id": "9937e3f1-0b2c-41d7-9f0e-2d11860f88e8"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/gomod-api
OpenAPI spec: https://www.oanor.com/api/gomod-api/openapi.json
