Created
September 12, 2023 09:30
-
-
Save a-sajjad72/c36f873b1bda515adae279312b4f6a6a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openapi: 3.0.0 | |
info: | |
title: Audiobook Recommendation API | |
version: 1.0.0 | |
description: An API of content-based recommendations for Audiobooks. | |
servers: | |
- url: http://localhost:3000 | |
paths: | |
/api/books: | |
get: | |
summary: Search for Audiobooks | |
parameters: | |
- name: name | |
in: query | |
description: The name of the book to search for. | |
required: false | |
schema: | |
type: string | |
- name: id | |
in: query | |
description: The ID of the book to search for. | |
required: false | |
schema: | |
type: integer | |
- name: n_books | |
in: query | |
description: Number of books to retrieve. | |
required: false | |
schema: | |
type: integer | |
- name: offset | |
in: query | |
description: Offset for pagination. | |
required: false | |
schema: | |
type: integer | |
responses: | |
'200': | |
description: Successful response. | |
content: | |
application/json: | |
example: | |
moreSimilar: | |
- book_id: 123 | |
book_title: "Book Title" | |
# Add more book entries as needed | |
lessSimilar: | |
- book_id: 456 | |
book_title: "Another Book Title" | |
# Add more book entries as needed | |
'400': | |
description: Bad request. Check the request parameters. | |
'500': | |
description: Internal server error. Something went wrong. | |
/api/recommendations: | |
get: | |
summary: Get Book Recommendations | |
parameters: | |
- name: name | |
in: query | |
description: The name of the book to get recommendations for. | |
required: false | |
schema: | |
type: string | |
- name: id | |
in: query | |
description: The ID of the book to get recommendations for. | |
required: false | |
schema: | |
type: integer | |
- name: n_recs | |
in: query | |
description: Number of recommendations to retrieve. | |
required: false | |
schema: | |
type: integer | |
- name: offset | |
in: query | |
description: Offset for pagination. | |
required: false | |
schema: | |
type: integer | |
responses: | |
'200': | |
description: Successful response. | |
content: | |
application/json: | |
example: | |
- book_id: 789 | |
book_title: "Recommended Book 1" | |
# Add more recommended book entries as needed | |
'400': | |
description: Bad request. Check the request parameters. | |
'500': | |
description: Internal server error. Something went wrong. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment