Coverthing
This is a proposal to build coverthing, an open repository of book covers.
It is a website, where anyone can upload an image of a book cover or request a cover that we have, associate metadata, which can be queried later.
API
Get
Get image for a record id. The following image sizes are available.
thumbnail 50x50
small 100x100
medium 200x200
large 500x500
original uploaded size
(Tentetive image sizes. These will change in future.)
Example
http://covers.openlibary.org/api/get/1234/small.jpg
http://covers.openlibary.org/api/get/1234/thumbnail.jpg
Upload
Upload a new image and create a new record for it.
Send a post request to the following URL:
http://covers.openlibrary.org/api/upload
Arguments
image - image data
arbitrary key value pairs.
Errors
-
Filesize was zero
- Filetype was not recognised
Example Response
{'status': 'ok', 'id': '1234'}
New Record
Creates a new record for an existing image.
Send a POST request to the following URL.
http://covers.openlibrary.org/api/new_record
Arguments
-
base_record: use image from this record
- additional key value pairs
Errors
- Invalid record id
Example Response
{'status': 'ok', 'id': '1234'}
Query
query the database for matching records.
Send a GET request to the following URL:
http://covers.openlibrary.org/api/query
Arguments
any key value pairs.
Example
The following query finds all records which have isbn=1234 and returns the ids of the matching records in sorted order of priority.
http://covers.openlibrary.org/api/query?isbn=1234&sort=priority
Example Response
{'status': 'ok', 'result': ['1', '34', '54']}
Suggest
Search the database for nearly matching records.
Send a GET request to the following URL:
http://covers.openlibrary.org/api/suggest
Arguments
any key value pairs.
Example
The following query finds all records which have either isbn="1234567890" or title="The Adventures of Tom Sawyer".
http://covers.openlibrary.org/api/query?isbn=1234567890&title=The+Adventures+of+Tom+Sawyer
Example Response
{'status': 'ok', 'result': ['1', '34', '54']}
Open Issues
Extending coverthing to author photographs
We need to specify a parameter to distinguish between book covers and author photos. Here are the available options.
new subdomain. Same API can be used.
- http://covers.openlibrary.org/api/get/1234/small.jpg
- http://authors.openlibrary.org/api/get/1234/small.jpg
new dir
- http://covers.openlibrary.org/bookcovers/api/get/1234/small.jpg
- http://covers.openlibrary.org/authors/api/get/1234/small.jpg
as a query string (ugly)
- http://covers.openlibrary.org/api/get/1234/small.jpg?category=bookcovers
Option#2 looks like the best option.
We can extend this to store even OL static images by defining a new category.
Any suggestions for a better name?
Can you suggest any better name?
How about calling it http://media.openlibrary.org or http://static.openlibrary.org?
Shortcut API for search+get?
How about providing quick image search based on one condition which returns the first image from the results?
For example, find the image of the book with isbn=1234567890.
http://covers.openlibrary.org/api/get/isbn/1234567890/small.jpg
If no such image is found, it should return a default image.
/api/get
is already used for returning images based on record id. Will be better is use the same for this purpose also or use a different name?
History
- Created August 11, 2008
- 8 revisions
August 12, 2008 | Edited by Anand Chitipothu | Edited without comment. |
August 12, 2008 | Edited by Anand Chitipothu | Edited without comment. |
August 12, 2008 | Edited by Anand Chitipothu | add info about collections |
August 11, 2008 | Edited by Anand Chitipothu | fix spaces |
August 11, 2008 | Created by Anand Chitipothu | coverthing |