Practice app Documentation - bounswe/2021SpringGroup12 GitHub Wiki

1: /books/

[GET]
  • Definition:

    • Users can get the information of the books of an author. Information includes review url, publication date, summary, isbn numbers, etc.
    • NYTimes API is used to get data. Then those data stored in our database for further reference.
  • Query Parameters

    • name : Put space between words. Some examples:

      • stephen King πŸ‘πŸΌ
      • Stephen king πŸ‘πŸΌ
      • stephen king πŸ‘πŸΌ
      • Stephen King πŸ‘πŸΌ
      • stephenking πŸ‘ŽπŸΌ
      • yuval noah harari πŸ‘πŸΌ
      • victorh ugo πŸ‘ŽπŸΌ
    • max_results : This is optional. You may want to limit the number of books you want to get, this comes handy if that's the case.

  • Example Usages:

    • http://127.0.0.1:5000/books/?name=stephen%20king&max_results=1
    • http://127.0.0.1:5000/books/?name=yuval%20noah%20harari&max_results=5
    • http://127.0.0.1:5000/books/?name=yuval%20noah%20harari
    •     var axios = require('axios');
          var config = {
            method: 'get',
            url: 'http://127.0.0.1:5000/books/?name=stephen king',
            headers: { }
          };
      
          axios(config)
          .then(function (response) {
            console.log(JSON.stringify(response.data));
          })
          .catch(function (error) {
            console.log(error);
          });
  • Example Return:

    • {
        "books": [
            {
                "book_author": "Stephen King",
                "book_title": "11/22/63",
                "isbn13": [
                    "9780307951434",
                    "9780606351461",
                    "9781442344280",
                    "9781442344303",
                    "9781442391635",
                    "9781444727326",
                    "9781451627282",
                    "9781451627299",
                    "9781451627305",
                    "9781451651645",
                    "9781501120602",
                    "9781594135590"
                ],
                "publication_dt": "2011-11-13",
                "summary": "Stephen King’s time traveler tries to undo some painful history.",
                "uri": "nyt://book/00000000-0000-0000-0000-000000000000",
                "url": "http://www.nytimes.com/2011/11/13/books/review/11-22-63-by-stephen-king-book-review.html",
                "uuid": "00000000-0000-0000-0000-000000000000"
            }
        ],
        "num_results": 1
       }
    • {
       "books": [
           {
               "book_author": "Yuval Noah Harari",
               "book_title": "Homo Deus",
               "isbn13": [
                   "9780062464316"
               ],
               "publication_dt": "2017-03-13",
               "summary": "In β€œHomo Deus,” Yuval Noah Harari suggests the natural end of the scientific revolution might be human obsolescence.",
               "uri": "nyt://book/00000000-0000-0000-0000-000000000000",
               "url": "http://www.nytimes.com/2017/03/13/books/review/yuval-noah-harari-homo-deus.html",
               "uuid": "00000000-0000-0000-0000-000000000000"
           },
           {
               "book_author": "Yuval Noah Harari",
               "book_title": "21 Lessons for the 21st Century",
               "isbn13": [
                   "9780525512172"
               ],
               "publication_dt": "2018-09-04",
               "summary": "In β€œ21 Lessons for the 21st Century,” Yuval Noah Harari’s latest book, the historian takes on everything from terrorism to inequality.",
               "uri": "nyt://book/00000000-0000-0000-0000-000000000000",
               "url": "https://www.nytimes.com/2018/09/04/books/review/21-lessons-for-the-21st-century-yuval-noah-harari.html",
               "uuid": "00000000-0000-0000-0000-000000000000"
           }
       ],
       "num_results": 2
      }
  • Screenshots:

    • Screenshot from 2021-06-08 18-07-19
    • Screenshot from 2021-06-08 18-07-54
    • Screenshot from 2021-06-08 18-08-14
[POST]
  • Definition:

    • Users can post the information of the books. Information includes title, author, review url, publication date, summary, isbn numbers, etc.
    • Title and author must be supplied! Other fields are optional.
  • Request Body

    • book_title: string,
    • book_author: string
    • url: string
    • publication_dt: string,
    • summary: string,
    • uuid: string,
    • uri: string,
    • isbn13: list of strings
  • Example Usages:

    •   POST /books/ HTTP/1.1
        Host: 127.0.0.1:5000
        Content-Type: application/json
        Content-Length: 127
        {
            "book_title": "50 Soruda Yapay Zeka",
            "book_author": "Cem Say",
            "isbn13": [
                "1234",
                "485"
            ]
        }
    •   var axios = require('axios');
        var data = JSON.stringify({
          "url": "",
          "publication_dt": "2018-10-13",
          "byline": "",
          "book_title": "50 Soruda Yapay Zeka",
          "book_author": "Cem Say",
          "summary": "",
          "uuid": "00000000-0000-0000-0000-000000000000",
          "uri": "nyt://book/00000000-0000-0000-0000-000000000000",
          "isbn13": [
            "9786055888589"
          ]
        });
      
        var config = {
          method: 'post',
          url: 'http://127.0.0.1:5000/books/',
          headers: { 
            'Content-Type': 'application/json'
          },
          data : data
        };
      
        axios(config)
        .then(function (response) {
          console.log(JSON.stringify(response.data));
        })
        .catch(function (error) {
          console.log(error);
        });
    •     import requests
          import json
      
          url = "http://127.0.0.1:5000/books/"
      
          payload = json.dumps({
            "url": "",
            "publication_dt": "2018-10-13",
            "byline": "",
            "book_title": "50 Soruda Yapay Zeka",
            "book_author": "Cem Say",
            "summary": "",
            "uuid": "00000000-0000-0000-0000-000000000000",
            "uri": "nyt://book/00000000-0000-0000-0000-000000000000",
            "isbn13": [
              "9786055888589"
            ]
          })
          headers = {
            'Content-Type': 'application/json'
          }
      
          response = requests.request("POST", url, headers=headers, data=payload)
      
          print(response.text)
  • Example Return:

    • Book added succesfully!

Screenshots

  • Screenshot from 2021-06-08 18-08-32
    • Screenshot from 2021-06-08 18-12-05
    • Screenshot from 2021-06-08 18-12-15
    • Screenshot from 2021-06-08 18-12-27

2: /convert/

[GET]
  • Definition:

    • Users can get the information of the daily currency exchange rate. Information includes date, currencies, exchange rate, calculated amount of given money.
    • exchangerate.host API is used to get data. Then the data stored in our database for further reference.
  • Query Parameters

    • from : Default is EUR. If you enter a non-existing currency it uses EUR data

      • USD πŸ‘πŸΌ
      • EUR πŸ‘πŸΌ
      • TRY πŸ‘πŸΌ
      • BTC πŸ‘πŸΌ
    • to: Must be given correctly.

    • amount : This is optional. User may want to calculate the amount of their money in another currency.

  • Example Usages:

  • Example Return:

    • { "date": "2021-05-28", "info": { "rate": 8.50186 }, "query": { "amount": 1, "from": "USD", "to": "TRY" }, "result": 42.5093, "success": true }
    • { "date": "2021-05-28", "info": { "rate": 8.50186 }, "query": { "amount": 1, "from": "USD", "to": "TRY" }, "result": 8.50186, "success": true }
    • { "date": "2021-05-28", "info": { "rate": 1.21882 }, "query": { "amount": 1, "from": "EUR", "to": "USD" }, "result": 1.21882, "success": true }
[POST]
  • Definition:

    • Users can post a exchange rate value for a specific date for two currencies.
    • Date, rate and two currency name must be given.
  • Request Body

    • date: string,
    • from: string,
    • to: string,
    • rate: float
  • Example Usages:

    • POST /convert/ HTTP/1.1 Host: 127.0.0.1:5000 Content-Type: application/json Content-Length: 86

{ "from": "USD", "to": "TRY", "date": "2016-01-09", "rate": 3.2 }

  • Example Return:

    • You have successfully inserted your data to db

3: /name_information

[GET]
[POST]
  • Definition:

    • Users can save new name information to the database to be included later querries.
    • All fields denoted below are required.
  • Request Body

    • name: string
    • age: int
    • country: string
  • Example Body:

    • { "name": "talha", "age": 23, "country": "Turkey" }
  • Example Return:

    • "Your name information has been added to database!", status=200 (Success)
    • "Your information couldnt be saved! Please try again later!", status=403 (Possible DB connection error)
    • "Please provide correct information in body as json", status=400 (Bad Request)

4.1: /randomQuotes/

[GET]
  • Definition:

    • Users can get quotes of the famous people by random subject
    • quoteGarden API is used to get data. Then the data stored in our database for further reference.
  • Query Parameters

    • No parameter
  • Example Usages:

  • Example Return:

    • { "data": [ { "quoteId": "5eb17ab1b69dc744b4e7d144", "quoteAuthor": "Bob Marley", "quoteGenre": "music", "quoteText": "One good thing about music, when it hits you, you feel no pain." }, { "quoteId": "5eb17ab1b69dc744b4e7d145", "quoteAuthor": "William Shakespeare", "quoteGenre": "music", "quoteText": "If music be the food of love, play on." }, { "quoteId": "5eb17ab1b69dc744b4e7d146", "quoteAuthor": "Plato", "quoteGenre": "music", "quoteText": "Music is a moral law. It gives soul to the universe, wings to the mind, flight to the imagination, and charm and gaiety to life and to everything." }] }
    • { "data": [ { "quoteId": "5eb17aadb69dc744b4e71b5d", "quoteAuthor": "Albert Einstein", "quoteGenre": "art", "quoteText": "True art is characterized by an irresistible urge in the creative artist." }, { "quoteId": "5eb17aadb69dc744b4e71b5e", "quoteAuthor": "Vincent Van Gogh", "quoteGenre": "art", "quoteText": "If you hear a voice within you say 'you cannot paint,' then by all means paint, and that voice will be silenced." }, { "quoteId": "5eb17aadb69dc744b4e71b5f", "quoteAuthor": "Abraham Lincoln", "quoteGenre": "art", "quoteText": "The highest art is always the most religious, and the greatest artist is always a devout person." }, { "quoteId": "5eb17aadb69dc744b4e71b60", "quoteAuthor": "Aristotle", "quoteGenre": "art", "quoteText": "The aim of art is to represent not the outward appearance of things, but their inward significance." }] }

4.2: /quotes/

[GET]
  • Definition:

    • Users can get quotes of the famous people by subject
    • quoteGarden API is used to get data. Then the data stored in our database for further reference.
  • Query Parameters

    • genre: you should provide a genre that is in the list of the genre list of the application. Some examples
      • age πŸ‘πŸΌ
      • beauty πŸ‘πŸΌ
      • art πŸ‘πŸΌ
      • sports πŸ‘πŸΌ
  • Example Usages:

  • Example Return:

    • { "data": [ { "quoteId": "5eb17ab1b69dc744b4e7d144", "quoteAuthor": "Bob Marley", "quoteGenre": "music", "quoteText": "One good thing about music, when it hits you, you feel no pain." }, { "quoteId": "5eb17ab1b69dc744b4e7d145", "quoteAuthor": "William Shakespeare", "quoteGenre": "music", "quoteText": "If music be the food of love, play on." }, { "quoteId": "5eb17ab1b69dc744b4e7d146", "quoteAuthor": "Plato", "quoteGenre": "music", "quoteText": "Music is a moral law. It gives soul to the universe, wings to the mind, flight to the imagination, and charm and gaiety to life and to everything." }] }
    • { "data": [ { "quoteId": "5eb17aadb69dc744b4e71b5d", "quoteAuthor": "Albert Einstein", "quoteGenre": "art", "quoteText": "True art is characterized by an irresistible urge in the creative artist." }, { "quoteId": "5eb17aadb69dc744b4e71b5e", "quoteAuthor": "Vincent Van Gogh", "quoteGenre": "art", "quoteText": "If you hear a voice within you say 'you cannot paint,' then by all means paint, and that voice will be silenced." }, { "quoteId": "5eb17aadb69dc744b4e71b5f", "quoteAuthor": "Abraham Lincoln", "quoteGenre": "art", "quoteText": "The highest art is always the most religious, and the greatest artist is always a devout person." }, { "quoteId": "5eb17aadb69dc744b4e71b60", "quoteAuthor": "Aristotle", "quoteGenre": "art", "quoteText": "The aim of art is to represent not the outward appearance of things, but their inward significance." }] }

4.3: /addQuotes/

[POST]
  • Definition:

    • Users can add quotes of anybody or theirselves to the database
  • Request Body

    • _id: string
    • quoteAuthor: string
    • quoteGenre: string
    • quoteText: string
  • Example Body:

    • { "_id": "id010190", "quoteAuthor": "Gokay", "quoteGenre": "learning", "quoteText": "Learning gets harder when the end of term get closer" }
  • Example Return:

    • "Quote added succesfully!", status=200 (Success)
    • "UNIQUE constraint failed: Quotes.quoteId", status=403 (Adding quote with same id)
    • "Please provide the quote", status=400 (Bad Request)

5 /movies_home/

Home Page
  • Definition:

    • Home page for movies which includes 2 options. Add review or Search for keyword.
    • Redirect the user for a different page according to which button they press.

Screenshots

  • image

5.1: /movies/

[GET]
  • Definition:

    • Users can get the reviews of movies.
    • Information includes title of the movie, mpaa rating, critics pick, name of the reviewer, title of the review, short summary of the review and the link of the review.
    • NYTimes API is used to get data. Then those data stored in our database for further reference.
  • Query Parameters

    • keyword : Put space between words. Some examples:
      • love story πŸ‘πŸΌ
      • life πŸ‘πŸΌ
      • science of πŸ‘πŸΌ
      • helloagainπŸ‘ŽπŸΌ
  • Example Usages:

    • http://127.0.0.1:5000/movies/?keyword=life%20of HTTP/1.1
    • http://127.0.0.1:5000/movies/?keyword=hello HTTP/1.1
    •     var axios = require('axios');
          var config = {
            method: 'get',
            url: 'http://127.0.0.1:5000/movies/?keyword=hello HTTP/1.1',
            headers: { }
          };
      
          axios(config)
          .then(function (response) {
            console.log(JSON.stringify(response.data));
          })
          .catch(function (error) {
            console.log(error);
          });
  • Example Return:

{ "Breaking Boundaries: The Science of Our Planet": { "display_title": "Breaking Boundaries: The Science of Our Planet", "mpaa_rating": "", "critics_pick": 0, "byline": "Calum Marsh", "headline": "\u2018Breaking Boundaries: The Science of Our Planet\u2019 Review: A Dire Warning", "summary_short": "We have a lot more than just climate change to worry about, argues this nature doc narrated by Sir David Attenborough.", "link": "https://www.nytimes.com/2021/06/04/movies/breaking-boundaries-the-science-of-our-planet-review.html" }, "The Science of Sleep": { "display_title": "The Science of Sleep", "mpaa_rating": "R", "critics_pick": 1, "byline": "By A.O. SCOTT", "headline": "A Parisian Love Story in Forward, and Sideways, Motion", "summary_short": "Michel Gondry's beguiling new film is so profoundly idiosyncratic, and so confident in its oddity, that any attempt to describe it is bound to be misleading. ", "link": "https://www.nytimes.com/2006/09/22/movies/22slee.html" }, "Thrill Ride: The Science of Fun": { "display_title": "Thrill Ride: The Science of Fun", "mpaa_rating": "G", "critics_pick": 0, "byline": "Lawrence Van Gelder", "headline": "Thrill Ride: The Science of Fun (Movie) ", "summary_short": "", "link": "https://www.nytimes.com/1997/07/11/movies/ah-terror-the-ecstasy-of-roller-coaster-agony.html" } } ```

  • Screenshots:

    • image
    • image

5.2: /movies_addReview/

[POST]
  • Definition:

    • Users can post movie reviews.
    • Information includes title of the movie, mpaa rating, critics pick, name of the reviewer, title of the review, short summary of the review and the link of the review.
    • Title, link and the reviewer name must be given.Also, critics pick can only take value 1 or 0
  • Request Body

    • display_title: string,
    • mpaa_rating: string,
    • critics_pick: string,
    • byline: string,
    • headline: string,
    • summary_short: string,
    • link: string
  • Example Usages:

    •   POST /books/ HTTP/1.1
        Host: 127.0.0.1:5000
        Content-Type: application/json
        {
        "display_title": "Apocalypse '45",
        "mpaa_rating": "",
        "critics_pick": 0,
        "byline": "Natalia Winkelman",
        "headline": "β€˜Apocalypse ’45’ Review: Graphic Images of Wartime",
        "summary_short": "Candid testimonies from World War II veterans accompany vivid archival footage in this immersive documentary that showcases the myths we tell ourselves about war.",
        "link": "https://www.nytimes.com/2021/05/27/movies/apocalypse-45-review.html"
        }
    •   var axios = require('axios');
        var data = JSON.stringify({
          "display_title": "Apocalypse '45",
        "mpaa_rating": "",
        "critics_pick": 0,
        "byline": "Natalia Winkelman",
        "headline": "β€˜Apocalypse ’45’ Review: Graphic Images of Wartime",
        "summary_short": "Candid testimonies from World War II veterans accompany vivid archival footage in this immersive documentary that showcases the myths we tell ourselves about war.",
        "link": "https://www.nytimes.com/2021/05/27/movies/apocalypse-45-review.html"
        });
      
        var config = {
          method: 'post',
          url: 'http://127.0.0.1:5000/movies_addReview/',
          headers: { 
            'Content-Type': 'application/json'
          },
          data : data
        };
      
        axios(config)
        .then(function (response) {
          console.log(JSON.stringify(response.data));
        })
        .catch(function (error) {
          console.log(error);
        });
    •     import requests
          import json
      
          url = "http://127.0.0.1:5000/books/"
      
          payload = json.dumps({
            "display_title": "Apocalypse '45",
        "mpaa_rating": "",
        "critics_pick": 0,
        "byline": "Natalia Winkelman",
        "headline": "β€˜Apocalypse ’45’ Review: Graphic Images of Wartime",
        "summary_short": "Candid testimonies from World War II veterans accompany vivid archival footage in this immersive documentary that showcases the myths we tell ourselves about war.",
        "link": "https://www.nytimes.com/2021/05/27/movies/apocalypse-45-review.html"
          })
          headers = {
            'Content-Type': 'application/json'
          }
      
          response = requests.request("POST", url, headers=headers, data=payload)
      
          print(response.text)
  • Example Return:

    • Movie Review added succesfully!

Screenshots

  • image
  • image
  • image

6.1: /download_issues

[GET]
  • Definition:

    • Downloads and simplifies the last 100 issues in bounswe/2021SpringGroup12 repo to database.
  • Query Parameters

    • state: all|closed|open ---- By default it is set to all.
  • Example Usages:

    • http://127.0.0.1:5000/download_issues?state=all
    • http://127.0.0.1:5000/download_issues
  • Example Return:

    *20 Issues downloaded. There are total 102 issues in the system

6.2: /issues

[GET]
  • Definition:

    • Gets all issues currently in db
  • Query Parameters

    • max_results: integer
  • Example Usages:

    • http://127.0.0.1:5000/issues?max_results=5
    • http://127.0.0.1:5000/issues
  • Example Return:

    *[ { "number": 1, "assignees": [ "asd" ], "description": "asd", "labels": [ "asd" ], "state": "open" }, { "number": 12, "assignees": [ "asd" ], "description": "asd", "labels": [ "asd" ], "state": "open" }, { "number": 69, "assignees": [ "Refref18" ], "description": "creation of mockup home page", "labels": [ "priority: high", "status: in progress" ], "state": "closed" }, { "number": 70, "assignees": [ "Refref18", "batuhanovski" ], "description": "", "labels": [ "priority: high", "status: Review Request" ], "state": "closed" }, { "number": 71, "assignees": [ "Refref18" ], "description": "Android design of scenario#1 which is setting goals, subgoals and a task ", "labels": [ "priority: high", "status: Review Request" ], "state": "closed" } ]
[POST]
  • Definition:

    • Users can post the information of the issues. Information includes issue number, assignees, description, labels, state.
  • Request Body

    • number: integer,
    • assignees: list of strings
    • description: string
    • labels: list of strings,
    • state: open|closed,
  • Example Usages:

    •   POST /issues/ HTTP/1.1
        Host: 127.0.0.1:5000
        Content-Type: application/json
        Content-Length: 127
        {
        "assignees": [
            "deneme"
        ],
        "description": "deneme",
        "labels": [
            "deneme",
            "priority: deneme"
        ],
        "number": 2,
        "state": "open"

    }

    
    
  • Example Return:

    • There are total 102 issues in the system

6.3: /issues/:issue number:

[GET]
  • Definition:

    • Gets the issue with number from db
  • Query Parameters

    • None
  • Example Usages:

    • http://127.0.0.1:5000/issues/2
  • Example Return:

    *{ "number": 86, "assignees": [ "yamanogluberk" ], "description": "Update the customer questions according to TAs feedback to properly reference the initial project description.\r\n-5.3 \r\n-Remove repetition\r\n-Remove unnecessary questions", "labels": [ "documentation", "priority: high" ], "state": "closed" }

7.1: /anime/search/

[GET]
  • Definition:

    • Search the MAL Database for given query string and returns limited amount of results
    • Jikan API was used to retrieve anime from database of MyAnimeList.
  • Query Parameters

    • query: A valid string at least three characters long.
    • limit: A valid integer. Larger values than 50 does not work properly since used API only returns maximum of 50 results.
  • Example Usages:

    • http://127.0.0.1:5000/anime/search/?query=jojo&limit=2
  • Example Return:

    • [
        {
          "title": "JoJo no Kimyou na Bouken", 
          "image": "https://cdn.myanimelist.net/images/anime/1171/106036.jpg?s=09307fb4b030b5e6f578c6ba6cbf84ab", 
          "synopsis": "Kujo Jotaro is a normal, popular Japanese high-schooler, until he thinks that he is possessed by a spirit, and locks himself in prison. After seeing his grandfather, Joseph Joestar, and fighting Josep...", 
          "type": "OVA", 
          "start_date": "1993-11-19T00:00:00+00:00", 
          "end_date": "1994-11-18T00:00:00+00:00", 
          "score": 7.35, 
          "rating": "R", 
          "airing": false, 
          "mal_id": 666
        }, 
        {
          "title": "JoJo no Kimyou na Bouken (TV)", 
          "image": "https://cdn.myanimelist.net/images/anime/3/40409.jpg?s=eade1f76434383f5af5243cc52d50316", 
          "synopsis": "In 1868, Dario Brando saves the life of an English nobleman, George Joestar. By taking in Dario's son Dio when the boy becomes fatherless, George hopes to repay the debt he owes to his savior. However...", 
          "type": "TV", 
          "start_date": "2012-10-06T00:00:00+00:00", 
          "end_date": "2013-04-06T00:00:00+00:00", 
          "score": 7.99, 
          "rating": "R", 
          "airing": false, 
          "mal_id": 14719
        }
      ]
  • Screenshots:

    • image

7.2: /anime/

[GET]
  • Definition:

    • Get detailed results about one anime. Before responding anime info is posted to database as MalAnime.
    • Jikan API was used to retrieve anime from database of MyAnimeList.
  • Path Parameters

    • id: MyAnimeList Id of the anime that are getting retrieved. Must be valid MAL id. So searching before requesting something is advised.
  • Example Usages:

    • http://127.0.0.1:5000/anime/14719
  • Example Return:

    •   {
            "title": "JoJo no Kimyou na Bouken (TV)",
            "mal_id": 14719,
            "episodes": 26,
            "image": "https://cdn.myanimelist.net/images/anime/3/40409.jpg",
            "airing": false,
            "start_date": "2012-10-06T00:00:00+00:00",
            "end_date": "2013-04-06T00:00:00+00:00",
            "score": 7.99,
            "rating": "R - 17+ (violence & profanity)",
            "type": "TV",
            "synopsis": "In 1868, Dario Brando saves the life of an English nobleman, George Joestar. By taking in Dario's son Dio when the boy becomes fatherless, George hopes to repay the debt he owes to his savior. However Dio, unsatisfied with his station in life, aspires to seize the Joestar house for his own. Wielding an Aztec stone mask with supernatural properties, he sets out to destroy George and his son, Jonathan \"JoJo\" Joestar, and triggers a chain of events that will continue to echo through the years to come. Half a century later, in New York City, Jonathan's grandson Joseph Joestar discovers the legacy his grandfather left for him. When an archeological dig unearths the truth behind the stone mask, he realizes that he is the only one who can defeat the Pillar Men, mystical beings of immeasurable power who inadvertently began everything. Adapted from the first two arcs of Hirohiko Araki's outlandish manga series, JoJo no Kimyou na Bouken follows the many thrilling expeditions of JoJo and his descendants. Whether it's facing off with the evil Dio, or combatting the sinister Pillar Men, there's always plenty of bizarre adventures in store. [Written by MAL Rewrite]",
            "duration": 24,
            "sequel": [
                "JoJo no Kimyou na Bouken Part 3: Stardust Crusaders",
                20899
            ],
            "prequel": null,
            "genres": [
                "Action",
                "Adventure",
                "Supernatural",
                "Vampire",
                "Shounen"
            ]
        }
  • Screenshot:

    • image

7.3: /anime/

[POST]
  • Definition:

    • Post User defined animes to the database. Animes posted by user may some lack detail.
  • Body Parameters

    • title: str
    • episodes: int
    • image: str
    • airing: boolean
    • start_date: Date
    • end_date: Date
    • score: int
    • rating: str
    • type: str
    • synopsis: str
  • Example Usages:

    • http://127.0.0.1:5000/anime/14719
  • Example Return:

    • Anime added successfully
  • Screenshots:

    • image
    • image
    • image

8.1: /cocktails/get_cocktails/

[GET]
  • Definition:

    • Users can get the cocktails' ingredients, glass type and the instructions with the keyword
    • TheCocktailDB API is used to get data. Then the data stored in our database for further reference.
  • Query Parameters

    • cocktail_name: user should type a keyword, after this process, the cocktails and the corresponding features including this keyword will return. Some examples
      • margarita πŸ‘πŸΌ
      • cosmopolitan πŸ‘πŸΌ
      • cosmo πŸ‘πŸΌ
      • godmother πŸ‘πŸΌ
  • Example Usages:

  • Example Return:

    • { "cocktails": [ { "cocktail_name": "Cosmopolitan", "ingredient_1": "Absolut Citron", "ingredient_2": "Lime juice", "ingredient_3": "Cointreau", "ingredient_4": "Cranberry juice", "glass": "Cocktail glass", "instructions": "Add all ingredients into cocktail shaker filled with ice. Shake well and double strain into large cocktail glass. Garnish with lime wheel." }, { "cocktail_name": "Cosmopolitan Martini", "ingredient_1": "Cointreau", "ingredient_2": "Vodka", "ingredient_3": "Lime", "ingredient_4": "Cranberry juice", "glass": "Cocktail Glass", "instructions": "Pour all ingredients in mixing glass half filled with ice, shake and strain into chilled Martini glass." } ] }
    • { "cocktails": [ { "cocktail_name": "Godmother", "ingredient_1": "Vodka", "ingredient_2": "Amaretto", "ingredient_3": "", "ingredient_4": "", "glass": "Old-fashioned glass", "instructions": "Pour vodka and amaretto into an old-fashioned glass over ice and serve." } ] }

8.2: /cocktails/create_cocktail/

[POST]
  • Definition:

    • Users can add cocktails they created.
  • Request Body

    • strDrink: string
    • strIngredient1: string
    • strIngredient2: string
    • strIngredient3: string
    • strIngredient4: string
    • strGlass: string
    • strInstructions: string
  • Example Body:

    • { "strDrink": "batuhancocktail", "strIngredient1": "gin", "strIngredient2": "tonic", "strIngredient3": "lemon", "strIngredient4": "blueberry", "strGlass": "visky glass", "strInstructions": "squeeze the lemon and mix them all." }
  • Example Return:

    • "Cocktail added successfully!"
    • "This cocktail name is taken already! Try different cocktail name."
    • "Please provide the name of the cocktail!", status=400 (Bad Request)
⚠️ **GitHub.com Fallback** ⚠️