Practice app Documentation - bounswe/2021SpringGroup12 GitHub Wiki
- Here is the application: http://18.184.69.221/ . You are free to play around.
- Here is the URI: http://18.184.69.221:5000/api/docs
[GET]
-
- 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.
-
-
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.
-
-
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); });
-
-
{ "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 }
-
-
[POST]
-
- 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.
-
- book_title: string,
- book_author: string
- url: string
- publication_dt: string,
- summary: string,
- uuid: string,
- uri: string,
- isbn13: list of strings
-
-
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)
-
-
Book added succesfully!
[GET]
-
- 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.
-
-
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.
-
-
{ "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]
-
- Users can post a exchange rate value for a specific date for two currencies.
- Date, rate and two currency name must be given.
-
- date: string,
- from: string,
- to: string,
- rate: float
-
- 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 }
-
You have successfully inserted your data to db
[GET]
-
- Users can get the average age for given name and country fields. The resulting information is the combination of data acquired from agify.io and application database.
- Agify API is used to get data.
-
- name : String field with UTF-8
- country : This is optional. The data acquired from the agify api is using "ISO 3166-1 alpha-2" protocol for country codes. The data acquired from the database is what users saved so it can be anything.
-
{ "name": "berk", "age": 32, "count": 12339, "country": "TR" }
{ "name": "berk", "age": 27, "count": 16000 }
[POST]
-
- Users can save new name information to the database to be included later querries.
- All fields denoted below are required.
-
- name: string
- age: int
- country: string
-
-
{
"name": "talha",
"age": 23,
"country": "Turkey"
}
-
-
- "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)
[GET]
-
- 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.
-
- No parameter
-
{ "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." }] }
[GET]
-
- 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.
-
- genre: you should provide a genre that is in the list of the genre list of the application. Some examples
- age ππΌ
- beauty ππΌ
- art ππΌ
- sports ππΌ
- genre: you should provide a genre that is in the list of the genre list of the application. Some examples
-
{ "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." }] }
[POST]
-
- Users can add quotes of anybody or theirselves to the database
-
- _id: string
- quoteAuthor: string
- quoteGenre: string
- quoteText: string
-
-
{
"_id": "id010190",
"quoteAuthor": "Gokay",
"quoteGenre": "learning",
"quoteText": "Learning gets harder when the end of term get closer"
}
-
-
- "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)
Home Page
-
- 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.
[GET]
-
- 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.
-
- keyword : Put space between words. Some examples:
- love story ππΌ
- life ππΌ
- science of ππΌ
- helloagainππΌ
- keyword : Put space between words. Some examples:
-
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); });
-
-
{ "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" } } ```
[POST]
-
- 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
-
- display_title: string,
- mpaa_rating: string,
- critics_pick: string,
- byline: string,
- headline: string,
- summary_short: string,
- link: string
-
-
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)
-
-
Movie Review added succesfully!
[GET]
-
- Downloads and simplifies the last 100 issues in bounswe/2021SpringGroup12 repo to database.
-
- state: all|closed|open ---- By default it is set to all.
-
http://127.0.0.1:5000/download_issues?state=all
http://127.0.0.1:5000/download_issues
-
*
20 Issues downloaded. There are total 102 issues in the system
[GET]
-
- Gets all issues currently in db
-
- max_results: integer
-
http://127.0.0.1:5000/issues?max_results=5
http://127.0.0.1:5000/issues
-
*
[ { "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]
-
- Users can post the information of the issues. Information includes issue number, assignees, description, labels, state.
-
- number: integer,
- assignees: list of strings
- description: string
- labels: list of strings,
- state: open|closed,
-
-
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"
}
-
-
There are total 102 issues in the system
[GET]
-
- Gets the issue with number from db
-
- None
-
http://127.0.0.1:5000/issues/2
-
*
{ "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" }
[GET]
-
- 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: 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.
-
http://127.0.0.1:5000/anime/search/?query=jojo&limit=2
-
-
[ { "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 } ]
-
-
[GET]
-
- 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.
-
- id: MyAnimeList Id of the anime that are getting retrieved. Must be valid MAL id. So searching before requesting something is advised.
-
http://127.0.0.1:5000/anime/14719
-
-
{ "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" ] }
-
-
[POST]
-
- Post User defined animes to the database. Animes posted by user may some lack detail.
-
- title: str
- episodes: int
- image: str
- airing: boolean
- start_date: Date
- end_date: Date
- score: int
- rating: str
- type: str
- synopsis: str
-
http://127.0.0.1:5000/anime/14719
-
Anime added successfully
-
[GET]
-
- 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.
-
- 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 ππΌ
- cocktail_name: user should type a keyword, after this process, the cocktails and the corresponding features including this keyword will return.
Some examples
-
{ "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." } ] }
[POST]
-
- Users can add cocktails they created.
-
- strDrink: string
- strIngredient1: string
- strIngredient2: string
- strIngredient3: string
- strIngredient4: string
- strGlass: string
- strInstructions: string
-
{ "strDrink": "batuhancocktail", "strIngredient1": "gin", "strIngredient2": "tonic", "strIngredient3": "lemon", "strIngredient4": "blueberry", "strGlass": "visky glass", "strInstructions": "squeeze the lemon and mix them all." }
-
- "Cocktail added successfully!"
- "This cocktail name is taken already! Try different cocktail name."
- "Please provide the name of the cocktail!", status=400 (Bad Request)