« All posts

pkg.go.dev için Resmi API Yayınlandı: Go Modüllerine Programatik Erişim

Go ekibi pkg.go.dev API'sini duyurdu: modül/paket metadatası, sürüm çözümleme ve arama artık GET tabanlı v1beta uçlarıyla programatik erişilebilir.

The Go team has released an official API for pkg.go.dev, enabling programmatic access to package and module metadata that developers previously had to obtain through fragile web scraping. The rise of AI-assisted coding tools, which need precise, high-fidelity context about the Go ecosystem, was cited as a key driver behind the launch.

The API is stateless and GET-only, currently hosted under the /v1beta path with a planned transition to v1 after a community feedback period. Endpoints cover packages, modules, versions, search, symbols, reverse dependencies (imported-by), and vulnerabilities. A core design principle is "precision over convenience": unlike the web UI, which auto-resolves ambiguous package paths using the longest-module-path rule, the API returns an error and candidate list when a path could belong to multiple modules, requiring explicit disambiguation. Version resolution supports semantic version tags and the master/main branches, which resolve to pseudo-versions.

Alongside the API, the team released pkgsite-cli, a reference command-line client demonstrating search, package inspection, symbol listing, reverse-dependency lookup, and module version/package listing. While the API commits to backward compatibility, the CLI's interface is still considered unstable. This gives engineers building tooling, IDE integrations, or automated Go workflows a stable, direct data source instead of scraping.

» SourceThe Go Blog