The Mobile Web Best Practices standard sets out a series of recommendations designed to improve the user experience of the Web on mobile devices. One of these recommendations is:

[CAPABILITIES] Exploit device capabilities to provide an enhanced user experience.

Where appropriate, Web content should be adapted to enhance the user experience based on the capabilities of her device and more generically based on the user's delivery context. In the mobile world, the problem is that no two devices are alike: screen size, markup support, stylesheet support, image format support, etc, each mobile device defines a unique set of capabilities. Thus, one of the first tasks when processing an HTTP request on a server is to determine the capabilities of the delivery context associated with the request. Some of these capabilities are directly defined in the HTTP header fields (e.g. the Accept header field) while others need to be retrieved from some Device Description Repository (DDR).

The Device Description Repository Simple API standard was developed within W3C to define a common API for access to such DDRs. The API has been implemented in e.g. Java, C#, Perl, IDL and WSDL, but there was no open-source implementation of the API in PHP so far.


AskPythia is an open-source conforming implementation of the DDR Simple API in PHP. It is not a DDR but a wrapper to existing DDRs. AskPythia ships with an implementation on top of the WURFL database that maps WURFL capabilities to properties of the Device Description Repository Core Vocabulary standard.

The Overview page provides a high-level overview of the library and explains how to use it in code without having to worry about its internals. The Implementation on top of WURFL page describes the implementation of the API on top of the open-source WURFL database.

AskPythia provides facilities to make wiring to other DDRs straightforward. The How-to page goes deeper into the code and explains how it may be extended to add support for other DDRs.

The source code of the library is distributed under a W3C Software Notice and License. For extensibility reasons, the library uses interfaces and thus requires PHP5. In particular, the library is not compatible with PHP4.

AskPythia is a stand-alone library, part of the mobileOK Pythia suite of tools.

Contact: François Daoust <>