{# Copyright (C) 2015 The Debsources developers . See the AUTHORS file at the top-level directory of this distribution and at https://salsa.debian.org/qa/debsources/blob/master/AUTHORS License: GNU Affero General Public License, version 3 or above. #} {% set url_prefix = "//" + config.SOURCES_URL + '/copyright' %}

You can query all information available in Debian Sources, and get a JSON object which allows you to navigate packages and source files programmaticaly.
The JSON result will be pretty-printed, unless the X-Requested-With HTTP header is set to XmlHttpRequest.

Note: wherever a specific version number is required, you can use the string "latest" instead to get redirected to the most recent version of the package.

Search

File search

You can search files by SHA-256 sum: {{ url_prefix }}/api/sha256/?checksum=sha256&package=packagename&suite=jessie Specifying a package name or a suite is optional.
example

Path search

The URL for a path search is: {{ url_prefix }}/api/file/packagename/version/path Both package name and version are required parameters. See example

Batch search

The URL for a batch (many files) search is: {{ url_prefix }}/api/sha256/ The API accepts an HTTP POST request. The data must be form-encoded, repeating the checksum parameter for multiple values. For example, if you are using python requests to create the POST request then the dictionnary containing the values should have the following structure:

{
    "checksums": [SUM1, SUM2, SUM3, ...],
    "package": PACKAGE,
    "suite": SUITE
}
Package and suite parameters are optional.

Package list

All packages

{{ url_prefix }}/api/list example

By prefix

{{ url_prefix }}/api/prefix/prefix example

Check the service status

Check service status and retrieve last update timestamp: {{ url_prefix }}/api/ping/ example