Difference between revisions of "Aurweb RPC interface"

From ArchWiki
Jump to navigation Jump to search
(Change "associated code" section name to "libraries" as it better describes the purpose Associated code)
m (Libraries: python3-aur has view helper utilities)
(3 intermediate revisions by the same user not shown)
Line 163: Line 163:
== Libraries ==
== Libraries ==
* [https://github.com/zeyla/aur.rs aur.rs]: Rust library for accessing the AUR RPC interface.
* {{App|aur.rs|Rust library for accessing Aurweb RPC interface.|https://github.com/zeyla/aur.rs|–}}
* {{AUR|haskell-archlinux}}: Haskell library to access the AUR and package metadata. See [https://hackage.haskell.org/package/archlinux hackage/archlinux] for details.
* {{App|haskell-archlinux|Haskell library to access the AUR and package metadata. '''Deprecated.'''|https://hackage.haskell.org/package/archlinux|{{AUR|haskell-archlinux}}}}
* {{AUR|python3-aur}}: Python modules for interacting with the remote AUR RPC interface, among other AUR services. See [http://xyne.archlinux.ca/projects/python3-aur/ python3-aur] for details.
* {{App|haskell-aur|Haskell library for accessing Aurweb RPC interface.|https://hackage.haskell.org/package/aur|{{AUR|haskell-aur}}}}
* {{AUR|python-aur}}: Python modules for interacting with the remote AUR RPC interface (RPCv1).
* {{App|python3-aur|Python 3 modules and helper utilities for accessing AUR package information and automating AUR interactions.|https://xyne.archlinux.ca/projects/python3-aur|{{AUR|python3-aur}}}}
* {{App|python-aur|Python modules for interacting with the remote Aurweb RPC interface (RPCv1).|https://github.com/cdown/aur|{{AUR|python-aur}}}}

Revision as of 17:20, 6 November 2018

The Aurweb RPC interface is a lightweight RPC interface for the AUR. Queries are sent as HTTP GET requests and the server responds with JSON.

Note: This article describes v5 of the RPC Interface API, as updated with AUR v4.7.0 on July 7, 2018.

API usage

Query types

There are two query types:

  • search
  • info


Package searches can be performed by issuing requests of the form:


where keywords is the search argument and field is one of the following values:

  • name (search by package name only)
  • name-desc (search by package name and description)
  • maintainer (search by package maintainer)
  • depends (search for packages that depend on keywords)
  • makedepends (search for packages that makedepend on keywords)
  • optdepends (search for packages that optdepend on keywords)
  • checkdepends (search for packages that checkdepend on keywords)

The by parameter can be skipped and defaults to name-desc. Possible return types are search and error.

If a maintainer search is performed and the search argument is left empty, a list of orphan packages is returned.


Search for foobar:


Search for packages maintained by john:


Search for packages that have foobar as `makedepends`:


Search with callback:



Package information can be performed by issuing requests of the form:


where pkg1, pkg2, … are the exact matches of names of packages to retrieve package details for.

Possible return types are multiinfo and error.


Info for single foobar package:


Info for multiple foobar and bar packages:


Return types

The return payload is of one format and currently has three main types. The response will always return a type so that the user can determine if the result of an operation was an error or not.

The format of the return payload is:


ReturnType is a string, and the value is one of:

  • search
  • multiinfo
  • error

The type of ReturnData is an array of dictionary objects for the search and multiinfo ReturnType, and an empty array for error ReturnType.


The error type has an error response string as the return value. An error response can be returned from either a search or an info query type.

Example of ReturnType error:

{"version":5,"type":"error","resultcount":0,"results":[],"error":"Incorrect by field specified."}


The search type is the result returned from a search request operation. The actual results of a search operation will be the same as an info request for each result. See the info section.

Example of ReturnType search:

{"version":5,"type":"search","resultcount":2,"results":[{"ID":206807,"Name":"cower-git", ...}]}


The info type is the result returned from an info request operation.

Example of ReturnType multiinfo:

        "Description":"A simple AUR agent with a pretentious name",


If you are working with a javascript page, and need a JSON callback mechanism, you can do it. You just need to provide an additional callback variable. This callback is usually handled via the javascript library, but here is an example.

Example Query:


Example Result:

/**/jsonp1192244621103({"version":5,"type":"search","resultcount":1,"results":[{"ID":250608,"Name":"foobar2000","PackageBaseID":37068,"PackageBase":"foobar2000","Version":"1.3.9-1","Description":"An advanced freeware audio player (uses Wine).","URL":"http:\/\/www.foobar2000.org\/","NumVotes":39,"Popularity":0.425966,"OutOfDate":null,"Maintainer":"supermario","FirstSubmitted":1273255356,"LastModified":1448326415,"URLPath":"\/cgit\/aur.git\/snapshot\/foobar2000.tar.gz"}]})

This would automatically call the JavaScript function jsonp1192244621103 with the parameter set to the results of the RPC call.


  • HTTP GET requests are limited to URI of 8190 bytes maximum length. However, the official AUR instance running on a nginx server with HTTP/2 uses the default URI maximum length limit of 4443 bytes. Info requests with more than about 200 packages as an argument will need to be split.
  • The API rate is limited to a maximum of 4000 requests per day per IP.

Reference clients

Sometimes things are easier to understand with examples. A few reference implementations (jQuery, python, ruby) are available at the following URL: https://github.com/cactus/random/tree/2b72a1723bfc8ae64eed6a3c40cb154accae3974/aurjson_examples


  • aur.rs — Rust library for accessing Aurweb RPC interface.
https://github.com/zeyla/aur.rs || –
  • haskell-archlinux — Haskell library to access the AUR and package metadata. Deprecated.
https://hackage.haskell.org/package/archlinux || haskell-archlinuxAUR
  • haskell-aur — Haskell library for accessing Aurweb RPC interface.
https://hackage.haskell.org/package/aur || haskell-aurAUR
  • python3-aur — Python 3 modules and helper utilities for accessing AUR package information and automating AUR interactions.
https://xyne.archlinux.ca/projects/python3-aur || python3-aurAUR
  • python-aur — Python modules for interacting with the remote Aurweb RPC interface (RPCv1).
https://github.com/cdown/aur || python-aurAUR