Get Random Questions
Send a GET request to /api/questions
to receive a random array of questions. Available query parameters are outlined in the form below.
[
{
"category": "music",
"id": "62506471e12f6dec240bdfb3",
"correctAnswer": "House of Pain",
"incorrectAnswers": [
"Haddaway",
"Digable Planets",
"Brownsville Station"
],
"question": {
"text": "Who had a hit in 1992 with Jump Around?"
},
"tags": [
"songs",
"one_hit_wonders",
"1990's",
"music"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "science",
"id": "63a03952c7d86251f9b65c40",
"correctAnswer": "2.73 K",
"incorrectAnswers": [
"273 K",
"2730 K",
"27.3 K"
],
"question": {
"text": "What is the approximate temperature of the universe?"
},
"tags": [
"astrophysics",
"science",
"space"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "society_and_culture",
"id": "639c9dae929b90846f2fc98e",
"correctAnswer": "Salam",
"incorrectAnswers": [
"Hola",
"Namaste",
"Shalom"
],
"question": {
"text": "What is the name of the Islamic greeting for 'hello'?"
},
"tags": [
"islam",
"religion",
"society_and_culture"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "film_and_tv",
"id": "622a1c377cc59eab6f950735",
"correctAnswer": "Ralph Fiennes",
"incorrectAnswers": [
"Brian Cox",
"Mark Wahlberg",
"Leonardo DiCaprio"
],
"question": {
"text": "Which actor has starred in films including Harry Potter and Schindler's List?"
},
"tags": [
"acting",
"film",
"film_and_tv"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "society_and_culture",
"id": "639c9db5929b90846f2fc99e",
"correctAnswer": "Krishna",
"incorrectAnswers": [
"Vishnu",
"Brihaspati",
"Shiva"
],
"question": {
"text": "What is the name of the Hindu god of love and compassion?"
},
"tags": [
"hinduism",
"religion",
"society_and_culture"
],
"type": "text_choice",
"difficulty": "hard",
"regions": [],
"isNiche": false
},
{
"category": "geography",
"id": "62602e064b176d54800e3cbc",
"correctAnswer": "Napoli",
"incorrectAnswers": [
"Dublin",
"Leipzig",
"Athens"
],
"question": {
"text": "Which of these cities is in Italy?"
},
"tags": [
"cities",
"europe",
"italy",
"geography"
],
"type": "text_choice",
"difficulty": "easy",
"regions": [],
"isNiche": false
},
{
"category": "history",
"id": "622a1c3c7cc59eab6f95181f",
"correctAnswer": "Abraham Lincoln",
"incorrectAnswers": [
"John F. Kennedy",
"James Garfield",
"William McKinley"
],
"question": {
"text": "Which American president was assassinated in a theatre?"
},
"tags": [
"presidents",
"usa",
"assassinations",
"events",
"history"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "sport_and_leisure",
"id": "6384b46a83dddfb71ee5e37b",
"correctAnswer": "Tennis",
"incorrectAnswers": [
"Cricket",
"Ice Hockey",
"Soccer"
],
"question": {
"text": "Which sport is played at Roland-Garros?"
},
"tags": [
"sport"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "history",
"id": "62611f714b176d54800e3d59",
"correctAnswer": "1967",
"incorrectAnswers": [
"1973",
"1979",
"1985"
],
"question": {
"text": "When was the first heart transplant?"
},
"tags": [
"events",
"firsts",
"medicine",
"history"
],
"type": "text_choice",
"difficulty": "hard",
"regions": [],
"isNiche": false
},
{
"category": "sport_and_leisure",
"id": "622a1c367cc59eab6f950024",
"correctAnswer": "Tennis",
"incorrectAnswers": [
"Soccer",
"Badminton",
"Volleyball"
],
"question": {
"text": "With which sport is Chris Evert Lloyd identified?"
},
"tags": [
"people",
"sport"
],
"type": "text_choice",
"difficulty": "hard",
"regions": [],
"isNiche": false
}
]
Get Question
Send a GET request to /api/question/{id}
to receive that question.
[
{
"category": "music",
"id": "62506471e12f6dec240bdfb3",
"correctAnswer": "House of Pain",
"incorrectAnswers": [
"Haddaway",
"Digable Planets",
"Brownsville Station"
],
"question": {
"text": "Who had a hit in 1992 with Jump Around?"
},
"tags": [
"songs",
"one_hit_wonders",
"1990's",
"music"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "science",
"id": "63a03952c7d86251f9b65c40",
"correctAnswer": "2.73 K",
"incorrectAnswers": [
"273 K",
"2730 K",
"27.3 K"
],
"question": {
"text": "What is the approximate temperature of the universe?"
},
"tags": [
"astrophysics",
"science",
"space"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "society_and_culture",
"id": "639c9dae929b90846f2fc98e",
"correctAnswer": "Salam",
"incorrectAnswers": [
"Hola",
"Namaste",
"Shalom"
],
"question": {
"text": "What is the name of the Islamic greeting for 'hello'?"
},
"tags": [
"islam",
"religion",
"society_and_culture"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "film_and_tv",
"id": "622a1c377cc59eab6f950735",
"correctAnswer": "Ralph Fiennes",
"incorrectAnswers": [
"Brian Cox",
"Mark Wahlberg",
"Leonardo DiCaprio"
],
"question": {
"text": "Which actor has starred in films including Harry Potter and Schindler's List?"
},
"tags": [
"acting",
"film",
"film_and_tv"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "society_and_culture",
"id": "639c9db5929b90846f2fc99e",
"correctAnswer": "Krishna",
"incorrectAnswers": [
"Vishnu",
"Brihaspati",
"Shiva"
],
"question": {
"text": "What is the name of the Hindu god of love and compassion?"
},
"tags": [
"hinduism",
"religion",
"society_and_culture"
],
"type": "text_choice",
"difficulty": "hard",
"regions": [],
"isNiche": false
},
{
"category": "geography",
"id": "62602e064b176d54800e3cbc",
"correctAnswer": "Napoli",
"incorrectAnswers": [
"Dublin",
"Leipzig",
"Athens"
],
"question": {
"text": "Which of these cities is in Italy?"
},
"tags": [
"cities",
"europe",
"italy",
"geography"
],
"type": "text_choice",
"difficulty": "easy",
"regions": [],
"isNiche": false
},
{
"category": "history",
"id": "622a1c3c7cc59eab6f95181f",
"correctAnswer": "Abraham Lincoln",
"incorrectAnswers": [
"John F. Kennedy",
"James Garfield",
"William McKinley"
],
"question": {
"text": "Which American president was assassinated in a theatre?"
},
"tags": [
"presidents",
"usa",
"assassinations",
"events",
"history"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "sport_and_leisure",
"id": "6384b46a83dddfb71ee5e37b",
"correctAnswer": "Tennis",
"incorrectAnswers": [
"Cricket",
"Ice Hockey",
"Soccer"
],
"question": {
"text": "Which sport is played at Roland-Garros?"
},
"tags": [
"sport"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "history",
"id": "62611f714b176d54800e3d59",
"correctAnswer": "1967",
"incorrectAnswers": [
"1973",
"1979",
"1985"
],
"question": {
"text": "When was the first heart transplant?"
},
"tags": [
"events",
"firsts",
"medicine",
"history"
],
"type": "text_choice",
"difficulty": "hard",
"regions": [],
"isNiche": false
},
{
"category": "sport_and_leisure",
"id": "622a1c367cc59eab6f950024",
"correctAnswer": "Tennis",
"incorrectAnswers": [
"Soccer",
"Badminton",
"Volleyball"
],
"question": {
"text": "With which sport is Chris Evert Lloyd identified?"
},
"tags": [
"people",
"sport"
],
"type": "text_choice",
"difficulty": "hard",
"regions": [],
"isNiche": false
}
]
Search
Send a POST request to /api/questions/search
to search for questions. Unlike the /api/questions
endpoint, this is not random and will return the same questions to every request.
[
{
"category": "music",
"id": "62506471e12f6dec240bdfb3",
"correctAnswer": "House of Pain",
"incorrectAnswers": [
"Haddaway",
"Digable Planets",
"Brownsville Station"
],
"question": {
"text": "Who had a hit in 1992 with Jump Around?"
},
"tags": [
"songs",
"one_hit_wonders",
"1990's",
"music"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "science",
"id": "63a03952c7d86251f9b65c40",
"correctAnswer": "2.73 K",
"incorrectAnswers": [
"273 K",
"2730 K",
"27.3 K"
],
"question": {
"text": "What is the approximate temperature of the universe?"
},
"tags": [
"astrophysics",
"science",
"space"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "society_and_culture",
"id": "639c9dae929b90846f2fc98e",
"correctAnswer": "Salam",
"incorrectAnswers": [
"Hola",
"Namaste",
"Shalom"
],
"question": {
"text": "What is the name of the Islamic greeting for 'hello'?"
},
"tags": [
"islam",
"religion",
"society_and_culture"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "film_and_tv",
"id": "622a1c377cc59eab6f950735",
"correctAnswer": "Ralph Fiennes",
"incorrectAnswers": [
"Brian Cox",
"Mark Wahlberg",
"Leonardo DiCaprio"
],
"question": {
"text": "Which actor has starred in films including Harry Potter and Schindler's List?"
},
"tags": [
"acting",
"film",
"film_and_tv"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "society_and_culture",
"id": "639c9db5929b90846f2fc99e",
"correctAnswer": "Krishna",
"incorrectAnswers": [
"Vishnu",
"Brihaspati",
"Shiva"
],
"question": {
"text": "What is the name of the Hindu god of love and compassion?"
},
"tags": [
"hinduism",
"religion",
"society_and_culture"
],
"type": "text_choice",
"difficulty": "hard",
"regions": [],
"isNiche": false
},
{
"category": "geography",
"id": "62602e064b176d54800e3cbc",
"correctAnswer": "Napoli",
"incorrectAnswers": [
"Dublin",
"Leipzig",
"Athens"
],
"question": {
"text": "Which of these cities is in Italy?"
},
"tags": [
"cities",
"europe",
"italy",
"geography"
],
"type": "text_choice",
"difficulty": "easy",
"regions": [],
"isNiche": false
},
{
"category": "history",
"id": "622a1c3c7cc59eab6f95181f",
"correctAnswer": "Abraham Lincoln",
"incorrectAnswers": [
"John F. Kennedy",
"James Garfield",
"William McKinley"
],
"question": {
"text": "Which American president was assassinated in a theatre?"
},
"tags": [
"presidents",
"usa",
"assassinations",
"events",
"history"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "sport_and_leisure",
"id": "6384b46a83dddfb71ee5e37b",
"correctAnswer": "Tennis",
"incorrectAnswers": [
"Cricket",
"Ice Hockey",
"Soccer"
],
"question": {
"text": "Which sport is played at Roland-Garros?"
},
"tags": [
"sport"
],
"type": "text_choice",
"difficulty": "medium",
"regions": [],
"isNiche": false
},
{
"category": "history",
"id": "62611f714b176d54800e3d59",
"correctAnswer": "1967",
"incorrectAnswers": [
"1973",
"1979",
"1985"
],
"question": {
"text": "When was the first heart transplant?"
},
"tags": [
"events",
"firsts",
"medicine",
"history"
],
"type": "text_choice",
"difficulty": "hard",
"regions": [],
"isNiche": false
},
{
"category": "sport_and_leisure",
"id": "622a1c367cc59eab6f950024",
"correctAnswer": "Tennis",
"incorrectAnswers": [
"Soccer",
"Badminton",
"Volleyball"
],
"question": {
"text": "With which sport is Chris Evert Lloyd identified?"
},
"tags": [
"people",
"sport"
],
"type": "text_choice",
"difficulty": "hard",
"regions": [],
"isNiche": false
}
]
Create a Quiz
Quizzes are collections of questions (with a user-friendly title) that can be used to give end users a repeatable set of questions to answer.
To create a quiz, send a POST request to /api/quiz
, passing your API key in the x-api-key header, and a request body containing:
- The quiz title in the
title
property - An array of question IDs in the
questionIds
property
The response will contain an ID that you can use to get the quiz.
{
"id": "622a1c3c7cc59eab6f9519ab"
}
Get a Quiz
Quizzes are collections of questions (with a user-friendly title) that can be used to give end users a repeatable set of questions to answer.
To get a quiz, send a GET request to /api/quiz/{id}
. The response will contain the quiz title and all of the questions on the quiz.
{
"id": "someQuizId",
"title": "A fun quiz",
"questions": [
{
"category": "Film & TV",
"correctAnswer": "Marlon Brando",
"difficulty": "hard",
"id": "622a1c347cc59eab6f94f8fb",
"incorrectAnswers": [
"Humphrey Bogart",
"Harrison Ford",
"Robert Shaw"
],
"isNiche": false,
"question": "Which actor played the role of Stanley Kowalski in A Streetcar Named Desire?",
"regions": [],
"tags": [
"acting",
"film",
"film_and_tv"
],
"type": "Multiple Choice"
},
{
"category": "Music",
"correctAnswer": "The Beach Boys",
"difficulty": "hard",
"id": "622a1c397cc59eab6f950d9b",
"incorrectAnswers": [
"Swans",
"Three 6 Mafia",
"The Velvet Underground"
],
"isNiche": false,
"question": "Which band includes 'Dennis Wilson'?",
"regions": [],
"tags": [
"music"
],
"type": "Multiple Choice"
}
]
}
Get All of Your Quizzes
To get all quizzes you have created, send a GET request to /api/quizzes
, including your API key in the x-api-key header. The response will be an array of all of your quizzes.
[
{
"id": "someQuizId",
"title": "A fun quiz",
"numberOfQuestions": 2
},
{
"id": "someOtherQuizId",
"title": "Another quiz",
"questions": 1
}
]
Delete a Quiz
To delete a quiz, send a DELETE request to /api/quiz/{id}
, including your API key in the x-api-key header. The response code will be 204, with no data.
{}
Create a Session
Sessions are used to ensure that you don't receive duplicate questions. To create a session, send a GET request to /api/session
, passing your API key in the x-api-key header.
Once the session has been created, you can request questions from that session by passing the session ID as a query parameter to the getQuestions endpoint, e.g. /api/questions?session=<SESSION_ID>
. Subsequent requests to this endpoint will return different questions. Once all questions have been returned, you will receive no more questions.
You can find information on your session by sendinga GET request to /api/session/<SESSION_ID>
.
{
"remainingQuestions": 9032,
"categories": [],
"difficulty": null,
"id": "s0me_se55ion_k3y",
"tags": [],
"totalQuestions": 9062,
"region": null,
"createdAt": "2022-12-21T08:57:47.480Z",
"updatedAt": "2022-12-21T08:57:47.480Z"
}
Get Categories
Send a GET request to /api/categories
to receive information on the categories of question available to request. The keys of the returned object are the labels for each category, and the values can be sent in the comma-separated categories
query parameter when getting questions.
{
"Arts & Literature": [
"arts",
"literature",
"arts_and_literature"
],
"Film & TV": [
"movies",
"film",
"film_and_tv"
],
"Food & Drink": [
"food_and_drink",
"food",
"drink"
],
"General Knowledge": [
"general_knowledge"
],
"Geography": [
"geography"
],
"History": [
"history"
],
"Music": [
"music"
],
"Science": [
"science"
],
"Society & Culture": [
"society_and_culture",
"society",
"culture"
],
"Sport & Leisure": [
"sport_and_leisure",
"sports",
"sport"
]
}
Get Metadata
Send a GET request to /api/metadata
to receive information on the number of questions in the database and the distribution of questions across categories.
{
"byCategory": {
"General Knowledge": 231,
"Society & Culture": 343,
"History": 477,
"Sport & Leisure": 509,
"Geography": 1269,
"Music": 1119,
"Film & TV": 1271,
"Science": 960,
"Food & Drink": 484,
"Arts & Literature": 858
},
"byState": {
"rejected": 3511,
"approved": 7521,
"pending": 5024
},
"byDifficulty": {
"hard": 4239,
"null": 117,
"easy": 608,
"medium": 2557
},
"lastCreated": "2022-04-19T11:42:20.471+00:00",
"lastReviewed": "2022-04-19T20:57:47.644+00:00"
}
Get Tags
Send a GET request to /api/tags
to receive information on the set of all tags that have been added to questions. Each tag can be passed as a value to the tags
queryParameter of the getQuestions
endpoint, e.g. /api/questions?tags=mountains,medicine
[
"00's",
"1400's",
"1600's",
"1700's",
"1800's",
"1910's",
"1920's",
"1930's",
"1940's",
"1950's",
"1960's",
"1970's",
"1980's",
"1990's",
"2010's",
"academy_awards",
"acronyms",
"acting",
"actors",
"advertising",
"africa",
"albums",
"alcohol",
"american_football",
"anatomy",
"ancient_egypt",
"ancient_greece",
"animals",
"architecture",
"art",
"arts_and_literature",
"asia",
"assassinations",
"astronomy",
"athletics",
"australia",
"baltimore",
"bands",
"baseball",
"basketball",
"batman",
"battles",
"biology",
"birds",
"bodies_of_water",
"boston",
"boxing",
"bridges",
"buddhism",
"bugs",
"buildings",
"business",
"cambodia",
"canada",
"capital_cities",
"cartoons",
"central_america",
"cheese",
"chemistry",
"chicago",
"childrens_literature",
"china",
"christianity",
"christmas",
"cities",
"civil_rights",
"classic_novels",
"classical_music",
"classics",
"cocktails",
"cold_war",
"colours",
"comics",
"computing",
"countries",
"cover_song",
"cricket",
"crime",
"cuba",
"cult_films",
"currency",
"dallas",
"darts",
"dc",
"deserts",
"dinosaurs",
"disney",
"drink",
"drinks",
"empires",
"europe",
"events",
"exploration",
"fantasy",
"fashion",
"fiction",
"fictitious_characters",
"film",
"film_and_tv",
"firsts",
"fish",
"flags",
"food",
"food_and_drink",
"football",
"formula_1",
"france",
"games",
"general_knowledge",
"geography",
"geology",
"germany",
"golf",
"greece",
"halloween",
"harry_potter",
"hinduism",
"history",
"hock",
"hockey",
"horror",
"india",
"initials",
"inventions",
"iran",
"islam",
"islands",
"italy",
"james_bond",
"japan",
"jazz",
"judaism",
"kings",
"kpop",
"lakes",
"language",
"las_vegas",
"leaders",
"literature",
"liverpool",
"logos",
"london",
"lord_of_the_rings",
"lyrics",
"manchester",
"marketing",
"martial_arts",
"marvel",
"mathematics",
"mcu",
"medicine",
"medieval",
"mediterranean",
"meteorology",
"middle_ages",
"mlb",
"mls",
"moldova",
"motoring",
"motown",
"mountains",
"music",
"music_albums",
"musicals",
"musicians",
"mythology",
"names",
"natural_disasters",
"natural_wonders",
"nba",
"nbl",
"new_orleans",
"new_york",
"new_zealand",
"nfl",
"nhl",
"nicknames",
"numbers",
"oceans",
"olympics",
"one_hit_wonders",
"organisations",
"painting",
"paris",
"pastry",
"people",
"philosophy",
"physics",
"places",
"plants",
"politics",
"pop_music",
"presidents",
"previous_names",
"pseudonyms",
"quotes",
"racing",
"rap",
"rap_music",
"records",
"religion",
"revolutions",
"rivers",
"rock_music",
"romans",
"rugby",
"russia",
"salvador_dali",
"scandinavia",
"science",
"science_fiction",
"scientific_discoveries",
"shakespeare",
"soccer",
"society_and_culture",
"songs",
"soundtracks",
"south_america",
"southampton",
"southeast_asia",
"space",
"space_exploration",
"spain",
"sport",
"star_wars",
"statues",
"swimming",
"symbols",
"technology",
"tennis",
"the_ancient_world",
"the_beatles",
"the_human_body",
"the_internet",
"the_middle_east",
"the_netherlands",
"the_simpsons",
"the_solar_system",
"theater",
"tourist_attractions",
"toys",
"traditions",
"translations",
"tv",
"uk",
"ukraine",
"us_states",
"usa",
"video_games",
"vietnam",
"vikings",
"volcanoes",
"wars",
"waterfalls",
"wine",
"words",
"world_cup",
"world_war_1",
"world_war_2",
"young_adult"
]