Hi All
First post here. I'm working on an Android APP which uses Librivox API and had a technical question.
In order to retrieve a set of a books for a specific genre, I'm able to do
https://librivox.org/api/feed/audiobooks?genre=poetry
The above works and i'm able to also specify the limit and offset.
However, how do I specify genres with spaces and apostrophes in the name?
For example, how do I get the books for the genre, for example
Children's Fiction > Action & Adventure ? ( which is available when browsing the catalog )
I tried to guess it but none of the action_adventure,action-and-adventure, childrens_fiction, childrens-fiction, children_fiction works
The Dev notes page only mentions specifying the genre name in the query, but that only works for single word genres.
Thank you
How to specify Apostrophe and Spaces when using API?
I had a look at https://github.com/LibriVox/librivox-catalog/blob/master/application/libraries/Librivox_API.php, which is the code handling these API requests. In your case, that URL would be:
https://librivox.org/api/feed/audiobooks?genre=action%20%26%20adventure
That's not ideal since you also get books from other genres besides Children's Fiction. I'll have a look at the code. It should not be difficult to make the following work:
https://librivox.org/api/feed/audiobooks?genre=Children%27s%20Fiction%20%3E%20Action%20%26%20Adventure
I cannot promise any delivery date, though.
-
- LibriVox Admin Team
- Posts: 38680
- Joined: April 3rd, 2008, 3:55 am
- Location: Melbourne,Australia
This is a thread devoted to ways around the API viewtopic.php?f=24&t=44129 which is used by other app and similar users so you could look there
re the API - unfortunately we ran out of money when the software rewrite happened so things haven't changed.
Anne
re the API - unfortunately we ran out of money when the software rewrite happened so things haven't changed.
Anne