Application Programming Interface (API)

Overview

Contents

Overview

OPDS Primer

Comments

 

Related Links

OPDS Spec

Atom Format

AtomPub

Link Header Draft

Feedbooks is open to third party developpers via an Application Programming Interface (API), based on the principle of a Representational State Transfer (REST) architecture.

In its current version, the API is read mostly, aside from the publishing service and comments in AtomPub.

RESTful Resources

Our API and our website share similar resources, and most of the time you'll just have to change the file extension or ask for a different type in your HTTP header to use the API instead of the website. For example, if you'd like to search for a book with the query "Paper":

We use this design pattern everywhere on the website, for example for a book you'll have:

To distribute content, Feedbooks is a participant in the OPDS effort. Therefore most of our endpoints are in this particular flavor of Atom.

We highly recommend following the OPDS group, as this standard is still a work in progress and can evolve in the upcoming months.

Aside from the OPDS Spec we also provide an OPDS Primer in order to understand the key concepts associated to this standard.

Endpoints

You'll find our main catalog at http://www.feedbooks.com/catalog.atom

Most of our URIs accept both XHTML and Atom: try sending a different Accept header or append .atom to the URI.

You can discover most of our OPDS endpoints while navigating our catalog and starting from our main catalog.

We recommend against hard-coding any of our URIs in your application, aside from the main OPDS catalog.

Instead, follow links based on relationships and mimetypes to access the right URI.

Encoding

All requests and answers on Feedbooks are in UTF-8. If you're using parameters, remember to correctly encode your URI.

Authentication

Some endpoints on Feedbooks require to be authenticated, while some other might provide additional features if you're authenticated (for example, sending your credentials while requesting a download will log your download).

To use HTTP Basic Auth with curl: curl -u username:password https://url

Always use HTTPS when sending credentials.

Auto-discovery

To auto-discover our endpoints, we use links in the head of our XHTML pages and in our OPDS feeds.

Based on the type and rel value, you can guess the nature of the link.

We do not define new rel values and strictly use rel values defined in the Link header draft or the OPDS spec.

Language

On some of our endpoints, we filter the content displayed based on the Accept-Language header.

If the language is not defined or if we don't use the language defined in this header, we automatically use English as the default language.

To override this behavior, you can use a parameter in the URI of these endpoints.

Client Side Caching

Feedbooks relies heavily on HTTP caching to optimize the quality of service through the API.

We highly recommend using the ETags specified in our HTTP headers to avoid duplicate requests that are unecessary.

For our images we also use the Cache-Control header.

In a mobile environment, you should absolutely use these headers.

Compression

GZip support is available to speed things up on our endpoints.