1 {% extends "base.html" %}
 
   4 {% block title %}{% trans "WolneLektury.pl API" %}{% endblock %}
 
   6 {% block bodyid %}api{% endblock %}
 
  14 WolneLektury.pl API resides under <code>http://www.wolnelektury.pl/api/</code>.
 
  15 You can use it to access information about books, their fragments and
 
  22 Default data serialization format is
 
  23 <a href="http://en.wikipedia.org/wiki/JSON">JSON</a>,
 
  24 but you can also use XML by appending <code>?format=xml</code>
 
  25 query parameter to each URL.
 
  31 The URLs in WolneLektury.pl API are:
 
  36     <li><a href='/api/books/'>/api/books/</a> – {% trans "List of all books" %}
 
  38     <li><a href='/api/authors/'>/api/authors/</a> – {% trans "List of all authors" %}</li>
 
  39     <li><a href='/api/epochs/'>/api/epochs/</a> – {% trans "List of all epochs" %}</li>
 
  40     <li><a href='/api/genres/'>/api/genres/</a> – {% trans "List of all genres" %}</li>
 
  41     <li><a href='/api/kinds/'>/api/kinds/</a> – {% trans "List of all kinds" %}</li>
 
  43     <li><a href='/api/themes/'>/api/themes/</a> – {% trans "List of all themes" %}</li>
 
  47 {% url api_book "studnia-i-wahadlo" as e1 %}
 
  48 {% url api_tag "authors" "edgar-allan-poe" as e2 %}
 
  50 Each element of those lists contains a link (in a "href") attibute
 
  51 which points to individual resource's details, i.e.:
 
  52 <a href="{{e1}}">{{e1}}</a> or
 
  53 <a href="{{e2}}">{{e2}}</a>.
 
  58 {% blocktrans with "/api/authors/adam-mickiewicz/kinds/liryka/books/" as e %}
 
  59 You can combine authors, epochs, genres and kinds to find only books matching
 
  60 those criteria. For instance:
 
  61 <a href="{{e}}">{{e}}</a>.
 
  66 {% blocktrans with "/api/authors/adam-mickiewicz/kinds/liryka/parent_books/" as e %}
 
  67 If you only want top-level books and not all the children, you can use /parent_books/, as in:
 
  68 <a href="{{e}}">{{e}}</a>.
 
  73 {% url api_fragment "sen-nocy-letniej" "1290526312912-3814598192" as f %}
 
  74 {% blocktrans with "/api/authors/william-shakespeare/themes/zabawa/fragments/" as e %}
 
  75 The same way, using also books and themes, you can search for a list of fragments:
 
  76 <a href="{{e}}">{{e}}</a>. 
 
  77 Again, each entry has a "href" attribute which links to the fragment's details, i.e.:
 
  78 <a href="{{f}}">{{f}}</a>.