This guide describes the web API used by apm and Atom. The vast majority of use cases are met by the apm
command-line tool, which does other useful things like incrementing your version in package.json
and making sure you have pushed your git tag. In fact, Atom itself shells out to apm
rather than hitting the API directly. If you're curious about how Atom uses apm
, see the PackageManager class in the settings-view
package.
Warning: This API should be considered pre-release and is subject to change.
For calls to the API that require authentication, provide a valid token from your atom.io account page in the Authorization
header.
All requests that take parameters require application/json
.
Parameters:
downloads
, created_at
, updated_at
, stars
. Defaults to downloads
asc
or desc
. Defaults to desc
. stars
can only be ordered desc
Returns a list of all packages in the following format:
[
{
"releases": {
"latest": "0.6.0"
},
"name": "thedaniel-test-package",
"repository": {
"type": "git",
"url": "https://github.com/thedaniel/test-package"
}
},
...
]
Results are paginated 30 at a time, and links to the next and last pages are provided in the Link
header:
Link: <https://www.atom.io/api/packages?page=1>; rel="self",
<https://www.atom.io/api/packages?page=41>; rel="last",
<https://www.atom.io/api/packages?page=2>; rel="next"
By default, results are sorted by download count, descending.
Parameters:
downloads
, created_at
, updated_at
, stars
. Defaults to the relevance of the search query.asc
or desc
. Defaults to desc
.Returns results in the same format as listing packages.
Returns package details and versions for a single package
Parameters:
Returns:
{
"releases": {
"latest": "0.6.0"
},
"name": "thedaniel-test-package",
"repository": {
"type": "git",
"url": "https://github.com/thedaniel/test-package"
},
"versions": [
(see single version output below)
...,
]
}
Create a new package; requires authentication.
The name and version will be fetched from the package.json
file in the specified repository. The authenticating user must have access to the indicated repository.
Parameters:
Returns:
Delete a package; requires authentication.
Returns:
Packages are renamed by publishing a new version with the name changed in package.json
. See Creating a new package version for details.
Requests made to the previous name will forward to the new name.
Returns package.json
with dist
key added for e.g. tarball download:
{
"bugs": {
"url": "https://github.com/thedaniel/test-package/issues"
},
"dependencies": {
"async": "~0.2.6",
"pegjs": "~0.7.0",
"season": "~0.13.0"
},
"description": "Expand snippets matching the current prefix with `tab`.",
"dist": {
"tarball": "https://codeload.github.com/..."
},
"engines": {
"atom": "*"
},
"main": "./lib/snippets",
"name": "thedaniel-test-package",
"publishConfig": {
"registry": "https://...",
},
"repository": {
"type": "git",
"url": "https://github.com/thedaniel/test-package.git"
},
"version": "0.6.0"
}
Creates a new package version from a git tag; requires authentication. If rename
is not true
, the name
field in package.json
must match the current package name.
Parameters:
version
key in the package.json
file at that ref. The authenticating user must have access to the package repository.Returns:
Deletes a package version; requires authentication.
Note that a version cannot be republished with a different tag if it is deleted. If you need to delete the latest version of a package for example for security reasons, you'll need to increment the version when republishing.
Returns 204 No Content
List a user's starred packages.
Return value is similar to GET /api/packages
List the authenticated user's starred packages; requires authentication.
Return value is similar to GET /api/packages
Star a package; requires authentication.
Returns a package.
Unstar a package; requires authentication.
Returns 204 No Content.
List the users that have starred a package.
Returns a list of user objects:
[
{"login":"aperson"},
{"login":"anotherperson"},
]