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:

repo
name of repository for this package
subrepo
name of subrepository (if applicable; for example, main or contrib or non-free for Debian)
name
package name as in repository
version
package version (sanitized)
origversion
package version as in repository (if different from version)
summary
one-line description of the package
categories
list of package categories
licenses
list of package licenses
maintainers
list of package maintainers
www
list of package webpages
downloads
list of package downloads

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

The following requests return data for multiple metapackages in form of metapackage name → list of packages dictionary. API returns no more than 200 metapackages per request. You may specify a start or an end of metapackage names range to request.

Get first 200 metapackages:

/api/v1/metapackages/

Get first 200 metapackages starting with firefox (inclusive):

/api/v1/metapackages/firefox/

Get last 200 metapackages up to firefox (inclusive):

/api/v1/metapackages/..firefox/

You may iterate through all metapackages by using the last metapackage name in the next request

/api/v1/metapackages/  # returns '010editor' ... 'aaut'
/api/v1/metapackages/aaut/  # returns 'aaut' ... 'acf-snort'
/api/v1/metapackages/acf-snort/  # returns 'acf-snort' ... 'adinatha-fonts'
# ...

Filtered metapackages

API supports all the filters available on the website, so you can just play with filters in the website and then replace /metapackages/ URL prefix with /api/v1/metapackages/ to get API output.

Supported filters are:

search
metapackage name substring to look for
maintainer
return metapackages maintainer by specified person
category
return metapackages with specified category
inrepo
return metapackages present in specified repository
notinrepo
return metapackages absent in specified repository
minspread
return metapackages present in at least specified number of repository families (for instance, use 2 to get non-unique metapackages)
maxspread
return metapackages present in at most specified number of repository families (for instance, use 1 to get unique metapackages)

Example: get unique outdated metapackages not present in FreeBSD maintainer by foo@bar.com

/api/v1/metapackages/?notinrepo=freebsd&maintainer=foo%40bar.com&maxspread=1&outdated=1

Problems

Get problems for specific repository or maintainer:

/api/v1/repository/freebsd/problems
/api/v1/maintainer/ports@freebsd.org/problems
Output is an array of entries of the following format:
{
	"repo": "freebsd",
	"name": "abby",
	"effname": "abby",
	"maintainer": "ports@freebsd.org",
	"problem": "Homepage link \"https://code.google.com/archive/p/abby/\" points to Google Code which was discontinued. The link should be updated (probably along with download URLs). If this link is still alive, it may point to a new project homepage."
}

Fields are:

repo
repository name
name
package name as in repository
effname
repology metapackage name
maintainer
package maintainer associated with the problem; may be null; note that if there are multiple package maintainers, problem is duplicated for each one
problem
textual description of the problem