Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.
Adam Schmideg edited this page Feb 27, 2019 · 5 revisions

The GoDoc API is comprised of these endpoints:

api.godoc.org/search?q=Query—Returns search results for Query, in JSON format.

{
	"results": [
		{
			"path": "import/path/one",
			"synopsis": "Package synopsis is here, if present."
		},
		{
			"path": "import/path/two",
			"synopsis": "Package synopsis is here, if present."
		}
	]
}

api.godoc.org/packages—Returns all packages, in JSON format. This API returns all packages, including packages with errors, vendored packages, internal packages and more.

{
	"results": [
		{
			"path": "import/path/one"
		},
		{
			"path": "import/path/two"
		},
		{
			"path": "import/path/three"
		}
	]
}

api.godoc.org/importers/ImportPath—Returns packages that import ImportPath, in JSON format. Not recursive, direct imports only.

{
	"results": [
		{
			"path": "import/path/one",
			"synopsis": "Package synopsis is here, if present."
		},
		{
			"path": "import/path/two",
			"synopsis": "Package synopsis is here, if present."
		}
	]
}

For example, run curl https://api.godoc.org/importers/github.com/golang/gddo to see packages importing this project.

api.godoc.org/imports/ImportPath—Returns packages that ImportPath imports, in JSON format. Not recursive, direct imports only.

{
	"imports": [
		{
			"path": "import/path/one",
			"synopsis": "Package synopsis is here, if present."
		},
		{
			"path": "import/path/two",
			"synopsis": "Package synopsis is here, if present."
		}
	],
	"testImports": [
		{
			"path": "import/path/three",
			"synopsis": "Package synopsis is here, if present."
		}
	]
}

A plain text interface to GoDoc.org is also available.

Clone this wiki locally