An API to store your notes when you are hearing your favourites audiobooks.
Also, you will be able to receive the bestsellers books from New York Times and see the most scored posts about books in Reddit.
- Create an .env file, and insert a NYT_KEY for using the management command get_bestsellers.
$ docker-compose up
Two management commands are provided.
-
get_bestsellers will return the bestseller books from New York Times, setting the NYT_KEY environment variable.
-
get_books_posts will return the top posts from a book subreddit.
$ make get_bestsellers
$ make get_books_posts
- If you do not want to create the required API key to receive books,
you can use the following command:
$ make restore_db
For API documentation please go to http://127.0.0.1:8000/api/docs
The APIs are protected, for consuming them, you can follow the next steps:
- Send a post request to the endpoint /api/user/create.
- Send a post request ti the endpoint /api/user/token.
- Add an authorization header: -H 'Authorization: token 5b516cd8c4322ea9df068700726ea7bf6d70294b'
$ make test
The management command get_books_posts could not be fully tested.
Receiving too many requests response from Reddit.