Dmitri Shuralyov edited this page Nov 8, 2017 · 4 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."
		}
	]
}

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.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.