Tutorial ============ Get an API key ---------------- To use the API, you will first need to register for an API key. You can do that by clicking on the “SIGN UP” tab. Using the API key --------------------- When you have signed up, please login at http://api-account.luzme.com. You should see a screen with 2 sections, "ID" and "Keys". The "ID" is your access into the API; add "app_id=<1234abcd>" into your requests (changing "1234abcd" into your id, of course!) You do not need to create an API key. But if you do, then you must also send that in your requests ("&app_key="). Make an API Request ---------------------- The API accepts HTTP requests. You can use any language to access the API: Python, PHP, Perl, Java or any other – whichever is easiest for you. All API requests should start http://luzme.com/api/beta/.... Output Formats ----------------------- By default, we will send XML. If you prefer, you can receive: * json * jsonp * xml * yaml Just add "format=json" (or jsonp or yaml) to your API call Error 403 ----------------------- If you use the API without a valid app_id, or if you've exceeded your limit for the day, we will return a "403 Forbidden" error. API Limits ---------------------- The Free use of the API allows you a limited number of API requests per day. We will be offering a paid service for commercial customers; if you think you have a valid reason for an increased free limit, please get in touch. Listing the Books --------------------------- :: /api/beta/book/ http://luzme.com/api/beta/book/?format=json Searching the Authors ------------------------------- :: /api/beta/author/?name=Robert Crais /api/beta/author/?name__contains=Crais http://luzme.com/api/beta/author/?name=Robert Crais&format=json http://luzme.com/api/beta/author/?name__contains=Crais Searching the Books ---------------------------- You can search the book list by author and/or title. For example, :: /api/beta/book/?author=Robert%20Crais /api/beta/book/?title__endswith=Dragon%20Tattoo http://luzme.com/api/beta/book/?author=Robert%20Crais&format=json By default, the search will look for an exact match. But you can also append "__startswith", "__endswith", "__contains" for a finer search. You can combine the searches, for example :: /api/beta/book/?title=foo&author=bar /api/beta/book/?title__endswith=Dragon%20Tattoo&author__contains=Larsson Case-Insensitive Searching ----------------------------- By default, the searches are case-sensitive. If you want to do a case-insensitive search, then just add an "i" in front of the command :: /api/beta/book/?author__icontains=larsson /api/beta/book/?title__iendswith=dragon%20tattoo What are these "%20" in the example URLs? -------------------------------------------------- To conform to the HTTP standard, some characters in the URL (such as spaces) have to be changed to a different sequence. This is known as url encoding or url escaping. %20 is equivalent to a space. There should be a urlencode() function in your language (although it may go by a different name) Getting the Prices ----------------------------- When you get a book, you will also get a list of its prices. http://luzme.com/api/beta/price/9781409094760:apple_gb:apple/?format=json