Fun Generators API
Below is the documentation for the API calls
COMMUNITYAPI KEY0 INSTALLS
OpenAPI Specificationv3.0
{
"swagger": "2.0",
"schemes": [
"https",
"http"
],
"host": "api.fungenerators.com",
"info": {
"description": "Below is the documentation for the API calls. You can try them out right here. \n",
"title": "Fun Generators API",
"version": "1.5",
"x-apisguru-categories": [
"text"
],
"x-origin": [
{
"format": "swagger",
"url": "https://fungenerators.com/yaml/trivia.yaml",
"version": "2.0"
}
],
"x-providerName": "fungenerators.com",
"x-serviceName": "trivia",
"x-logo": {
"url": "https://api.apis.guru/v2/cache/logo/https_apis.guru_assets_images_no-logo.svg"
}
},
"consumes": [
"application/json"
],
"produces": [
"application/json",
"application/xml",
"application/js"
],
"securityDefinitions": {
"X-Fungenerators-Api-Secret": {
"in": "header",
"name": "X-Fungenerators-Api-Secret",
"type": "apiKey"
}
},
"tags": [
{
"description": "Trivia API",
"externalDocs": {
"description": "Find out more",
"url": "http://fungenerators.com/api/trivia"
},
"name": "Trivia"
}
],
"paths": {
"/trivia": {
"delete": {
"description": "Create a random Trivia entry.",
"parameters": [
{
"description": "Trivia ID",
"format": "string",
"in": "query",
"name": "id",
"required": true,
"type": "string"
}
],
"produces": [
"application/json",
"application/xml",
"application/js"
],
"responses": {
"200": {
"description": "200 response",
"examples": {
"application/json": "{\n \"success\": {\n \"total\": 1\n },\n \"contents\": {\n \"mesg\": \"Trivia 62D6iKM9GSlJxK5nrMf9XwrE is deleted\"\n }\n}"
}
},
"401": {
"description": "401 response",
"examples": {
"application/json": "{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n}"
}
}
},
"security": [
{
"X-Fungenerators-Api-Secret": []
}
],
"tags": [
"Trivia"
]
},
"get": {
"description": "Get a Trivia entry for a given id. Retrieves a trivia question and answer based on the id.",
"parameters": [
{
"description": "ID of the trivia to fetch",
"format": "string",
"in": "query",
"name": "id",
"required": false,
"type": "string"
}
],
"produces": [
"application/json",
"application/xml",
"application/js"
],
"responses": {
"200": {
"description": "200 response",
"examples": {
"application/json": "{\n \"success\": {\n \"total\": 1\n },\n \"contents\": [\n {\n \"id\": \"VO_foToeaTPvaDn_utYcOweF\",\n \"question\": \"What is the unit of currency in the United States of America\",\n \"category\": \"usa\",\n \"category_name\": \"USA\",\n \"answer\": [\n \"Dollar\"\n ]\n }\n ]\n}"
}
},
"401": {
"description": "401 response",
"examples": {
"application/json": "{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n}"
}
}
},
"security": [
{
"X-Fungenerators-Api-Secret": []
}
],
"tags": [
"Trivia"
]
},
"put": {
"description": "Create a random Trivia entry.",
"parameters": [
{
"description": "Trivia Question",
"format": "string",
"in": "query",
"name": "question",
"required": true,
"type": "string"
},
{
"description": "Category of the trivia",
"format": "string",
"in": "query",
"name": "category",
"required": true,
"type": "string"
},
{
"description": "Answer(s) to the trivia question",
"format": "string",
"in": "query",
"name": "answer",
"required": true,
"type": "string"
}
],
"produces": [
"application/json",
"application/xml",
"application/js"
],
"responses": {
"200": {
"description": "200 response",
"examples": {
"application/json": "{\n \"success\": {\n \"total\": 1\n },\n \"contents\": {\n \"id\": \"62D6iKM9GSlJxK5nrMf9XwrE\"\n }\n}"
}
},
"401": {
"description": "401 response",
"examples": {
"application/json": "{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n}"
}
}
},
"security": [
{
"X-Fungenerators-Api-Secret": []
}
],
"tags": [
"Trivia"
]
}
},
"/trivia/categories": {
"get": {
"description": "Get a random Trivia.",
"parameters": [
{
"description": "start",
"format": "integer",
"in": "query",
"name": "start",
"required": false,
"type": "integer"
}
],
"produces": [
"application/json",
"application/xml",
"application/js"
],
"responses": {
"200": {
"description": "200 response",
"examples": {
"application/json": "{\n \"success\": {\n \"total\": 1\n },\n \"contents\": [\n {\n \"id\": \"VO_foToeaTPvaDn_utYcOweF\",\n \"question\": \"What is the unit of currency in the United States of America\",\n \"category\": \"usa\",\n \"category_name\": \"USA\",\n \"answer\": [\n \"Dollar\"\n ]\n }\n ]\n}"
}
},
"401": {
"description": "401 response",
"examples": {
"application/json": "{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n}"
}
}
},
"security": [
{
"X-Fungenerators-Api-Secret": []
}
],
"tags": [
"Trivia"
]
}
},
"/trivia/random": {
"get": {
"description": "Get a random trivia for a given category(optional)",
"parameters": [
{
"description": "Category to get the trivia from",
"format": "string",
"in": "query",
"name": "category",
"required": false,
"type": "string"
}
],
"produces": [
"application/json",
"application/xml",
"application/js"
],
"responses": {
"200": {
"description": "200 response",
"examples": {
"application/json": "{\n \"success\": {\n \"total\": 1\n },\n \"contents\": [\n {\n \"id\": \"YYUsmCE2ztoACb_smt0PrgeF\",\n \"question\": \"Which country won the World Cup of Soccer in 1982\",\n \"category\": \"sports\",\n \"category_name\": \"Sports\",\n \"answer\": [\n \"Italy\"\n ]\n }\n ]\n}"
}
},
"401": {
"description": "401 response",
"examples": {
"application/json": "{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n} "
}
}
},
"security": [
{
"X-Fungenerators-Api-Secret": []
}
],
"tags": [
"Trivia"
]
}
},
"/trivia/search": {
"get": {
"description": "Search for random trivia which has the text in the query, for a given category(optional).",
"parameters": [
{
"description": "Text to search for in the trivia",
"format": "string",
"in": "query",
"name": "query",
"required": false,
"type": "string"
},
{
"description": "Category to get the trivia from",
"format": "string",
"in": "query",
"name": "category",
"required": false,
"type": "string"
}
],
"produces": [
"application/json",
"application/xml",
"application/js"
],
"responses": {
"200": {
"description": "200 response",
"examples": {
"application/json": "{\n \"success\": {\n \"total\": 1\n },\n \"contents\": {\n \"trivia\": \"What natural hydrocarbon polymer comes from the hevea brasiliensis tree\",\n \"id\": \"DFoazRj5O7x8PAVib9wROweF\",\n \"category\": \"Whatnot\",\n \"subcategory\": null\n }\n}"
}
},
"401": {
"description": "401 response",
"examples": {
"application/json": "{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n} "
}
}
},
"security": [
{
"X-Fungenerators-Api-Secret": []
}
],
"tags": [
"Trivia"
]
}
}
}
}