The Debian package directory provides a simple API to search for package releases. For instance this query results can be accessed as JSON at https://sources.debian.net/api/src/libtry-tiny-perl/. Is there a similar API for http://packages.ubuntu.com/?

share|improve this question
    
Since everything in Ubuntu is on Launchpad, you can probably use Launchpad's API to do something similar. – muru May 8 '15 at 8:58

As commented by muru, everything in Ubuntu is on Launchpad. Launchpad's API can also be used to search for package releases. To give an example:

To get API response as JSON, use curl:

$ curl https://api.launchpad.net/devel/ubuntu/+source/libtry-tiny-perl

Package releases can be queried with query parameter source_nameat base URL https://api.launchpad.net/1.0/ubuntu/+archive/primary?ws.op=getPublishedSources&&exact_match=true, for instance:

$ curl 'https://api.launchpad.net/1.0/ubuntu/+archive/primary?ws.op=getPublishedSources&source_name=libtry-tiny-perl&exact_match=true'

The API documentation is a bit complicated, even with the official API client launchpadlib so it took me some time to find out. The Ubuntu version of a package release is given in field distro_series_link.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.