Skip to content

Get a package version for a user

GET
/users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}

Gets a specific package version for a public package owned by a specified user.

OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see “About permissions for GitHub Packages.”

API method documentation

package_type
required
string
Allowed values: npm maven rubygems docker nuget container

The type of supported package. Packages in GitHub’s Gradle registry have the type maven. Docker images pushed to GitHub’s Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub’s Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.

package_name
required
string

The name of the package.

package_version_id
required
integer

Unique identifier of the package version.

username
required
string

The handle for the GitHub user account.

Response

Media type application/json
Package Version

A version of a software package

object
id
required

Unique identifier of the package version.

integer
name
required

The name of the package version.

string
url
required
string
package_html_url
required
string
html_url
string
license
string
description
string
created_at
required
string format: date-time
updated_at
required
string format: date-time
deleted_at
string format: date-time
metadata
Package Version Metadata
object
package_type
required
string
Allowed values: npm maven rubygems docker nuget container
container
Container Metadata
object
tags
required
Array<string>
docker
Docker Metadata
object
tag
Array<string>
Examples
Example default
{
"id": 387039,
"name": "0.2.0",
"url": "https://api.github.com/users/octocat/packages/rubygems/octo-name/versions/387039",
"package_html_url": "https://github.com/octocat/octo-name-repo/packages/40201",
"license": "MIT",
"created_at": "2019-12-01T20:49:29Z",
"updated_at": "2019-12-01T20:49:30Z",
"description": "Octo-name client for Ruby",
"html_url": "https://github.com/octocat/octo-name-repo/packages/40201?version=0.2.0",
"metadata": {
"package_type": "rubygems"
}
}