{"slug": "a-new-pkg-go-dev-api-for-go", "title": "A new pkg.go.dev API for Go", "summary": "The Go team launched a new structured API for pkg.go.dev, providing programmatic access to Go package metadata. The API, currently in v1beta, enables developers to build tools, IDE integrations, and AI-assisted coding workflows with efficient JSON endpoints. A reference CLI implementation, pkgsite-cli, is also available to demonstrate API usage.", "body_md": "Access to Go metadata has been an everpresent need for the Go community. Since its launch, [pkg.go.dev](http://pkg.go.dev) has served as a central hub for Go package documentation and discovery. While we initially prioritized providing this comprehensive access via a web interface, the need for streamlined programmatic access has become increasingly clear.\n\nStructured API access has been one of the most highly requested features for [pkg.go.dev](http://pkg.go.dev) for a while now. Developers building tools, IDE integrations, automated workflows, and other systems have had to rely on inconsistent and fragile scraping methods. By providing a formal API, we can provide fast and efficient access to required data. This foundation also sets Go up for the future of AI-assisted coding. Large language models and agents can access the context necessary to reason about the Go ecosystem with greater precision and accuracy.\n\n## Empowering Tool Builders\n\nOur goal with this API is to reduce the technical churn for builders and innovators. By offering structured JSON metadata, we address the following use cases:\n\n**Search and Discovery:** The API enables fast and efficient search across the entire Go module ecosystem.**Driving AI Innovation:** As AI-assisted coding evolves, LLMs and agents need precise context. This API provides the data required for agents and models to reason deterministically about Go packages.\n\n## The Service Interface\n\nBuilt for stability and efficient caching, the API uses a stateless, GET-only architecture. Primary endpoints are currently hosted under the `v1beta`\n\npath. Following a period of feedback from the Go community and confirmed stability, we intend to transition toward a formal `v1`\n\nrelease.\n\nFor a complete interactive reference of all endpoints, query parameters, and\nresponse shapes, see [pkg.go.dev/api](http://pkg.go.dev/api). The machine-readable API contract is also published directly at [pkg.go.dev/v1beta/openapi.yaml](http://pkg.go.dev/v1beta/openapi.yaml).\n\nEndpoint\n|\nDescription\n|\n`/v1beta/imported-by/{path}`\n|\nPaths of packages importing the package at `{path}` .\n|\n`/v1beta/module/{path}`\n|\nInformation about the module at `{path}` .\n|\n`/v1beta/package/{path}`\n|\nInformation about the package at `{path}` .\n|\n`/v1beta/packages/{path}`\n|\nInformation about packages of the module at `{path}` .\n|\n`/v1beta/search/search?q={query}`\n|\nSearch results for a given query. |\n`/v1beta/symbols/{path}`\n|\nList of symbols declared by the package at `{path}` .\n|\n`/v1beta/versions/{path}`\n|\nVersions of the module at `{path}` .\n|\n`/v1beta/vulns/{path}`\n|\nVulnerabilities of the module or package at `{path}` .\n|\n\nAn example of retrieving package information is shown below:\n\n```\ncurl https://pkg.go.dev/v1beta/package/github.com/google/go-cmp/cmp | jq\n{\n  \"modulePath\": \"github.com/google/go-cmp\",\n  \"version\": \"v0.7.0\",\n  \"isLatest\": true,\n  \"isStandardLibrary\": false,\n  \"goos\": \"all\",\n  \"goarch\": \"all\",\n  \"path\": \"github.com/google/go-cmp/cmp\",\n  \"name\": \"cmp\",\n  \"synopsis\": \"Package cmp determines equality of values.\",\n  \"isRedistributable\": true\n}\n```\n\n## A Reference Implementation\n\nTo demonstrate how to interact with our API, we are providing a reference CLI implementation: `pkgsite-cli`\n\n. This implementation serves as a practical example for developers looking to build their own integrations, showing how to handle the data directly from the terminal. Note, as the API continues to evolve, the interface and behavior of this CLI may change.\n\nYou can use it to search for packages or inspect symbols without leaving your shell:\n\n```\ngo install golang.org/x/pkgsite/cmd/internal/pkgsite-cli@latest\n\npkgsite-cli search \"uuid\"\ngithub.com/google/uuid\n  Module:   github.com/google/uuid@v1.6.0\n  Synopsis: Package uuid generates and inspects UUIDs.\n... more\n\npkgsite-cli package github.com/google/go-cmp/cmp\ngithub.com/google/go-cmp/cmp\n  Name:      cmp\n  Module:    github.com/google/go-cmp\n  Version:   v0.7.0 (latest)\n  Synopsis:  Package cmp determines equality of values.\n\npkgsite-cli package --symbols github.com/google/go-cmp/cmp\ngithub.com/google/go-cmp/cmp\n  Name:     cmp\n  Module:   github.com/google/go-cmp\n  Version:  v0.7.0 (latest)\n  Synopsis: Package cmp determines equality of values.\n\nSymbols:\n  type Indirect struct{}\n  type MapIndex struct{}\n  type Option interface{}\n  ... more\n```\n\n## Looking Ahead\n\nWhile we prioritize stability for our new `/v1beta`\n\nendpoints, we are eager to hear how open source communities use these resources to solve real-world problems.\n\nWe look forward to your feedback via our [issue tracker](https://github.com/golang/go/issues) and to seeing the tools you’ll build next.", "url": "https://wpnews.pro/news/a-new-pkg-go-dev-api-for-go", "canonical_source": "https://opensource.googleblog.com/2026/06/a-new-pkggodev-api-for-go.html", "published_at": "2026-06-13 06:46:53+00:00", "updated_at": "2026-06-13 07:20:06.753736+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence", "large-language-models", "ai-agents"], "entities": ["Go", "pkg.go.dev", "pkgsite-cli", "github.com/google/go-cmp", "github.com/google/uuid"], "alternates": {"html": "https://wpnews.pro/news/a-new-pkg-go-dev-api-for-go", "markdown": "https://wpnews.pro/news/a-new-pkg-go-dev-api-for-go.md", "text": "https://wpnews.pro/news/a-new-pkg-go-dev-api-for-go.txt", "jsonld": "https://wpnews.pro/news/a-new-pkg-go-dev-api-for-go.jsonld"}}