APIs / Apps and media / Go Modules
1 credit per call3 endpoints
Go Modules API
Go Modules API for Go package search with import counts, a module's latest version with VCS origin and licences, and its version list as JSON.
{
"success": true,
"data": {
"module": "github.com/gin-gonic/gin",
"version": "v1.12.0",
"published_at": "2026-02-28T10:10:09Z",
"origin": {
"vcs": "git",
"url": "https://github.com/gin-gonic/gin",
"ref": "refs/tags/v1.12.0",
"hash": "73726dc606796a025971fe451f0aa6f1b9b847f6"
},
"repo_url": "https://github.com/gin-gonic/gin",
"deprecated": false,
"retracted": false,
"licenses": [
"MIT"
],
"redistributable": true,
"has_go_mod": true,
"url": "https://pkg.go.dev/github.com/gin-gonic/gin"
},
"meta": {
"request_id": "req_e3297318cb05405da38d6e7cf9b845cd",
"credits_charged": 1,
"credits_remaining": 491
}
}Playground
Run this API
curl "https://api.perceptlayer.com/v1/go-modules/module-latest?module=github.com%2Fgin-gonic%2Fgin" \
-H "X-API-Key: $API_KEY"Go Modules · 3 endpoints
Endpoints
Every endpoint takes the same key. Open one for its parameters, the fields it returns and an example request.
| Endpoint | Required parameters | Returns | Cost |
|---|---|---|---|
GET/v1/go-modules/module-latest | module | moduleversionpublished_atoriginrepo_urldeprecated+5 more | 1 credit |
GET/v1/go-modules/module-versions | module+3 optional | versionpublished_atretractedurl | 1 credit |
GET/v1/go-modules/search | query+2 optional | packagemoduleversionsynopsisimported_by_packagesimported_by_modules+1 more | 1 credit |
Overview
About the Go Modules API
What you can get
The Go Modules API returns Go module data from the Go module mirror and pkg.go.dev as JSON through 3 endpoints.
- Search:
searchtakes aquery(words in package paths and documentation), withlimit(1 to 100, default 20) andpage_token. - Latest version:
module-latesttakes amodulepath, for example github.com/gin-gonic/gin. - Versions:
module-versionstakes amodulepath, withprerelease(false to leave out pre-releases; default true),pageandper_page(1 to 100, default 20). Versions come highest first. Major versions 2 and up are separate modules (…/v2).
The recorded search for "yaml" returned packages with package, module, version, synopsis, imported_by_packages, imported_by_modules and url. The first was gopkg.in/yaml.v2 at v2.4.0, imported by 60,161 packages in 43,006 modules.
The recorded module-latest for github.com/gin-gonic/gin returned version v1.12.0 with published_at, an origin with vcs, url, ref and commit hash, repo_url, licenses (MIT), redistributable, has_go_mod, deprecated and retracted. The recorded module-versions call for the same module found 28 versions (total), each with version, published_at, retracted and url.
How a call works
Search, then check a module: GET /v1/go-modules/search?query=yaml&limit=10 with your key in the X-API-Key header returns each package's module, which module-latest and module-versions take, for example GET /v1/go-modules/module-latest?module=github.com/gin-gonic/gin. Module paths keep their capitals; the gateway encodes them for the mirror. To page search results, pass next_page_token back as page_token while has_more is true. Answers come from a cache for up to an hour. Every successful call costs 1 credit; failed calls cost nothing.
More apps and media APIs
Use cases
Let a coding agent check a module's latest version before editing `go.mod`
Use the Go Modules API to let a coding agent check a module's latest version before editing `go.mod`Flag deprecated modules and retracted versions in a dependency list
Use the Go Modules API to flag deprecated modules and retracted versions in a dependency listRank packages for a job by how many packages and modules import them
Use the Go Modules API to rank packages for a job by how many packages and modules import themCheck a module's licence and whether pkg.go.dev marks it `redistributable`
Use the Go Modules API to check a module's licence and whether pkg.go.dev marks it `redistributable`FAQ
Questions
Is this the official Go Modules API?
No. Perceptlayer is an independent service and is not affiliated with Google or the Go project. The Go module mirror (proxy.golang.org) and pkg.go.dev, the official sources, are free to call directly, without a key, under Google's terms. This API calls them on your behalf and adds one key for every source on Perceptlayer, mirror and pkg.go.dev data merged into one response shape, a cache of up to an hour, and no charge for failed calls.
Where does each field come from?
Versions and the VCS `origin` come from the Go module mirror; publish dates, deprecation, retraction, licences, import counts and search come from pkg.go.dev.
Why doesn't `module-versions` show v2 and later?
In Go, major version 2 and above is a separate module with its own path, such as `example.com/mod/v2`. Pass that path to list its versions.
Does it return a module's dependencies?
No. These endpoints return versions, origin, licences, status and import counts, not the module's `go.mod` requirements.
Should I build a Go Modules scraper instead?
You can, but a Go Modules scraper is code you maintain: page changes break it, requests get blocked, and Go Modules's terms govern how you collect data. The Go Modules API gives you 3 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first.
Try the Go Modules API with 100 free credits
No credit card. Failed calls are never billed.