API

Introduction

API always returns a list of packages. Package is a dictionary of the following format:

{
	"repo": "freebsd",
	"name": "firefox",
	"version": "50.1.0",
	"origversion": "50.1.0_4,1",
	"summary": "Widely used web browser",
	"categories": ["www"],
	"licenses": ["GPLv2+"],
	"maintainers": ["gecko@FreeBSD.org"],
	"www": ["http://www.mozilla.com/firefox"],
	"downloads": ["http://download.cdn.mozilla.net/pub/firefox/releases/50.1.0/source/firefox-50.1.0.source.tar.xz"]
}

Fields are:

Mandatory fields are repo, name and version, all other fields are optional.

Metapackage is a group of related packages from different repositories (though it may contain multiple packages from the same repository). Metapackage has its own name which is derived from package names. In most cases it's the same, but sometimes different package names are transformed into a single metapackage name to coalesce differently named packages from different repositories.

API allows to request packages for a single metapackage or for a range of metapackages.

Single metapackage

Get list of packages for specific metapackage (here, firefox):

/api/v1/metapackage/firefox

Multiple metapackages

Following requests return data for multiple metapackages in form of metapackage name → list of packages dictionary. You may set a range of names to retrieve by specifying first or last name in range(inclusive or exclisive). API returns no more than 200 metapackages per request. By taking last (alphanumerically) name from a request and making another request with >name you can iterate through all metapackages. Empty output means end of data.

Get first 200 metapackages:

/api/v1/metapackages/all/

Get first 200 metapackages starting with firefox (inclusive):

/api/v1/metapackages/all/firefox/

Get first 200 metapackages after firefox (exclusive, e.g. firefox not included):

/api/v1/metapackages/all/>firefox/

Get first 200 metapackages just before firefox (exclusive, e.g. firefox not included):

/api/v1/metapackages/all/<firefox/

All metapackages requests support < and > syntax.

Filtered metapackages

Get metapackages present in specific repository (e.g. containing a package from that repository):

/api/v1/metapackages/in-repo/freebsd/
/api/v1/metapackages/in-repo/freebsd/firefox/
/api/v1/metapackages/in-repo/freebsd/>firefox/
/api/v1/metapackages/in-repo/freebsd/<firefox/

Get metapackages not present in specific repository:

/api/v1/metapackages/not-in-repo/freebsd/
/api/v1/metapackages/not-in-repo/freebsd/firefox/
/api/v1/metapackages/not-in-repo/freebsd/>firefox/
/api/v1/metapackages/not-in-repo/freebsd/<firefox/

Get metapackages outdated in specific repository:

/api/v1/metapackages/outdated-in-repo/freebsd/
/api/v1/metapackages/outdated-in-repo/freebsd/firefox/
/api/v1/metapackages/outdated-in-repo/freebsd/>firefox/
/api/v1/metapackages/outdated-in-repo/freebsd/<firefox/

Get metapackages for specific maintainer (e.g. containing a package with specific maintainer):

/api/v1/metapackages/by-maintainer/amdmi3%40FreeBSD.org/
/api/v1/metapackages/by-maintainer/amdmi3%40FreeBSD.org/firefox/
/api/v1/metapackages/by-maintainer/amdmi3%40FreeBSD.org/>firefox/
/api/v1/metapackages/by-maintainer/amdmi3%40FreeBSD.org/<firefox/

Get metapackages which are outdated for specific maintainer:

/api/v1/metapackages/outdated-by-maintainer/amdmi3%40FreeBSD.org/
/api/v1/metapackages/outdated-by-maintainer/amdmi3%40FreeBSD.org/firefox/
/api/v1/metapackages/outdated-by-maintainer/amdmi3%40FreeBSD.org/>firefox/
/api/v1/metapackages/outdated-by-maintainer/amdmi3%40FreeBSD.org/<firefox/