openapi-directory
Version:
Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS
1 lines • 15.6 kB
JSON
{"openapi":"3.0.0","servers":[{"url":"https://api.fungenerators.com"}],"info":{"contact":{"name":"Fun Generators","url":"http://fungenerators.com/"},"description":"A full featured Facts API. REST access with json/xml/jsonp result support. On this day birth and death support, random fact, keyword search support etc. Below is the documentation for the Random Facts API calls. You can try them out right here. [Click here to subscribe](http://fungenerators.com/api/facts/)\n","termsOfService":"https://fungenerators.com/terms","title":"Facts API","version":"1.5","x-apisguru-categories":["text"],"x-origin":[{"format":"swagger","url":"https://fungenerators.com/yaml/facts.yaml","version":"2.0"}],"x-providerName":"fungenerators.com","x-serviceName":"random-facts"},"tags":[{"description":"Get fact of the day on various categories. This is refreshed daily.","externalDocs":{"description":"Find out more","url":"http://fungenerators.com/api/facts#fact-of-the-day"},"name":"Fact of the day"},{"description":"Get a random interesting fact about a number.","externalDocs":{"description":"Find out more","url":"http://fungenerators.com/api/facts#number"},"name":"Number Facts"},{"description":"Get random facts based on category and other criteria.","externalDocs":{"description":"Find out more","url":"http://fungenerators.com/api/facts#number"},"name":"Random Facts"},{"description":"On this day historical events for birth, death and other events.","externalDocs":{"description":"Find out more","url":"http://fungenerators.com/api/facts#number"},"name":"On this day"},{"description":"Store and manage your own Facts online","externalDocs":{"description":"Find out more","url":"http://fungenerators.com/api/facts#private"},"name":"Private Facts"}],"paths":{"/fact":{"delete":{"description":"Delete a Fact entry identified by the id.","parameters":[{"description":"Fact ID","in":"query","name":"id","required":true,"schema":{"format":"string","type":"string"}}],"responses":{"200":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"success\": {\n \"total\": 1\n },\n \"contents\": {\n \"mesg\": \"Fact 62D6iKM9GSlJxK5nrMf9XwrE is deleted\"\n }\n}"}}}},"description":"200 response"},"401":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n}"}}}},"description":"401 response"}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["Private Facts"]},"get":{"description":"Get a Fact belonging to the id.","parameters":[{"description":"ID of the fact to fetch","in":"query","name":"id","required":false,"schema":{"format":"string","type":"string"}}],"responses":{"200":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"success\":{\"total\":1},\n \"contents\":{\n \"fact\":\"There are more than 1,100 known tributaries flowing into the Amazon River. Tributaries are sources of water such as a small river, stream or other water flow that reaches the river.\",\n \"id\":\"LCN5KlSn6BMpcm3ruXhfGweF\",\n \"category\":null,\n \"subcategory\":null\n \n }\n\n \n}"}}}},"description":"200 response"},"401":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n}"}}}},"description":"401 response"}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["Random Facts","Private Facts"]},"put":{"description":"Add a Fact entry to the database (private collection).","parameters":[{"description":"Fact Text","in":"query","name":"fact","required":true,"schema":{"format":"string","type":"string"}},{"description":"Category of the fact","in":"query","name":"category","required":true,"schema":{"format":"string","type":"string"}},{"description":"Sub Category of the fact","in":"query","name":"subcategory","required":true,"schema":{"format":"string","type":"string"}},{"description":"Tags","in":"query","name":"tags","required":true,"schema":{"format":"string","type":"string"}}],"responses":{"200":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"success\": {\n \"total\": 1\n },\n \"contents\": {\n \"id\": \"62D6iKM9GSlJxK5nrMf9XwrE\"\n }\n}"}}}},"description":"200 response"},"401":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n}"}}}},"description":"401 response"}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["Private Facts"]}},"/fact/categories":{"get":{"description":"Get a random Fact.","parameters":[{"description":"start","in":"query","name":"start","required":false,"schema":{"format":"integer","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"examples":{"response":{"value":"{\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}"}}}},"description":"200 response"},"401":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n}"}}}},"description":"401 response"}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["Random Facts"]}},"/fact/fod":{"get":{"description":"Get fact of the day for the given category.","parameters":[{"description":"Category to get the fact of the day from. Must be one from the list returned from /fact/fod/categories","in":"query","name":"category","required":false,"schema":{"format":"string","type":"string"}}],"responses":{"200":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"success\": {\n \"total\": 1\n },\n \"contents\": {\n \"facts\": [\n {\n \"description\": \"Science Fact of the day\",\n \"language\": \"en\",\n \"background\": \"\",\n \"category\": \"Science\",\n \"date\": \"2019-10-09\",\n \"fact\": \"In 1932 it was discovered that astronomical objects emit radio waves, and a system has been developed that makes it possible to create pictures from the radio waves. Astronomers use radio telescopes to study the radio waves being emitted from planets, dust, stars, gas clouds, comets, and other galaxies.\",\n \"subcategory\": \"Radio Waves\"\n }\n ],\n \"copyright\": \"2019-22 https://fungenerators.com\"\n }\n}"}}}},"description":"200 response"},"401":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n} "}}}},"description":"401 response"}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["Fact of the day"]}},"/fact/fod/categories":{"get":{"description":"Get the list of supported fact of the day categories.","responses":{"200":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"success\": {\n \"total\": 2\n },\n \"contents\": {\n \"categories\": [\n {\n \"name\": \"random\",\n \"description\": \"Random Fact of the day\",\n \"language\": \"en\",\n \"background\": \"\"\n },\n {\n \"name\": \"science\",\n \"description\": \"Science Fact of the day\",\n \"language\": \"en\",\n \"background\": \"\"\n }\n ],\n \"copyright\": \"2019-22 https://fungenerators.com\"\n }\n}"}}}},"description":"200 response"},"401":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n}"}}}},"description":"401 response"}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["Fact of the day"]}},"/fact/numbers":{"get":{"description":"Get a random fact about a number","parameters":[{"description":"Number value","in":"query","name":"number","required":true,"schema":{"format":"integer","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"success\": {\n \"total\": 1\n },\n \"copyright\": \"2019-22 https://fungenerators.com\",\n \"contents\": {\n \"number\": 11,\n \"fact\": \"11 is the largest known multiplicative persistence.\"\n }\n}"}}}},"description":"200 Success response"},"401":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n} "}}}},"description":"401 Unauthorized response"}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["Number Facts"]}},"/fact/onthisday/born":{"get":{"description":"Returns a random ( famous/ relatively famous ) person born on a given day and month","parameters":[{"description":"Optional month (1-12). Defaults to current month","in":"query","name":"month","required":false,"schema":{"format":"string","type":"string"}},{"description":"Optional day of the month (1- 28/30/31 based on the month). Defaults to current day of the month.","in":"query","name":"day","required":false,"schema":{"format":"string","type":"string"}}],"responses":{"200":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"success\": {\n \"total\": 1\n },\n \"contents\": [\n {\n \"name\": \"Edward R. Bradley\",\n \"occupation\": \"American businessman and horse owner (1st to own 4 Kentucky Derby winners)\",\n \"notable\": null,\n \"born\": \"1859-12-12\",\n \"died\": \"1946-08-15\"\n }\n ]\n}"}}}},"description":"200 response"},"401":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n}"}}}},"description":"401 response"}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["On this day"]}},"/fact/onthisday/died":{"get":{"description":"Returns a random ( famous/ relatively famous ) person died on a given day and month","parameters":[{"description":"Optional month (1-12). Defaults to current month","in":"query","name":"month","required":false,"schema":{"format":"string","type":"string"}},{"description":"Optional day of the month (1- 28/30/31 based on the month). Defaults to current day of the month.","in":"query","name":"day","required":false,"schema":{"format":"string","type":"string"}}],"responses":{"200":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"success\": {\n \"total\": 1\n },\n \"contents\": [\n {\n \"name\": \"Edward R. Bradley\",\n \"occupation\": \"American businessman and horse owner (1st to own 4 Kentucky Derby winners)\",\n \"notable\": null,\n \"born\": \"1859-12-12\",\n \"died\": \"1946-08-15\"\n }\n ]\n}"}}}},"description":"200 response"},"401":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n}"}}}},"description":"401 response"}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["On this day"]}},"/fact/onthisday/event":{"get":{"description":"Returns a random ( famous/ relatively famous ) historic event on a given day and month","parameters":[{"description":"Optional month (1-12). Defaults to current month","in":"query","name":"month","required":false,"schema":{"format":"string","type":"string"}},{"description":"Optional day of the month (1- 28/30/31 based on the month). Defaults to current day of the month.","in":"query","name":"day","required":false,"schema":{"format":"string","type":"string"}}],"responses":{"200":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"success\": {\n \"total\": 1\n },\n \"contents\": {\n \"id\": \"KVlPpVL119DtLFtphgOxqQeF\",\n \"day\": \"26\",\n \"month\": \"8\",\n \"year\": \"1883\",\n \"date\": \"1883-8-26\",\n \"event_type\": \"event\",\n \"event\": \"The Indonesian island of Krakatoa erupts in the largest explosion recorded in history, heard 2,200 miles away in Madagascar. The resulting destruction sends volcanic ash up 50 miles into the atmosphere and kills almost 36,000 people–both on the island itself and from the resulting 131-foot tidal waves that obliterate 163 villages on the shores of nearby Java and Sumatra.\"\n }\n}"}}}},"description":"200 response"},"401":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n}"}}}},"description":"401 response"}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["On this day"]}},"/fact/random":{"get":{"description":"Get a random Fact for a given category(optional) and subcategory(optional).","parameters":[{"description":"Category to get the fact from","in":"query","name":"category","required":false,"schema":{"format":"string","type":"string"}},{"description":"Sub Category to get the fact from","in":"query","name":"subcategory","required":false,"schema":{"format":"string","type":"string"}}],"responses":{"200":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"success\":{\"total\":1},\n \"contents\":{\n \"fact\":\"There are more than 1,100 known tributaries flowing into the Amazon River. Tributaries are sources of water such as a small river, stream or other water flow that reaches the river.\",\n \"id\":\"LCN5KlSn6BMpcm3ruXhfGweF\",\n \"category\":null,\n \"subcategory\":null\n \n }\n\n \n}"}}}},"description":"200 response"},"401":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n} "}}}},"description":"401 response"}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["Random Facts"]}},"/fact/search":{"get":{"description":"Search for random Fact which has the text in the query, for a given category(optional) and subcategory(optional).","parameters":[{"description":"Text to search for in the facts","in":"query","name":"query","required":false,"schema":{"format":"string","type":"string"}},{"description":"Category to get the fact from","in":"query","name":"category","required":false,"schema":{"format":"string","type":"string"}},{"description":"Sub Category to get the fact from","in":"query","name":"subcategory","required":false,"schema":{"format":"string","type":"string"}}],"responses":{"200":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"success\":{\"total\":1},\n \"contents\":{\n \"fact\":\"There are more than 1,100 known tributaries flowing into the Amazon River. Tributaries are sources of water such as a small river, stream or other water flow that reaches the river.\",\n \"id\":\"LCN5KlSn6BMpcm3ruXhfGweF\",\n \"category\": \"Rivers\",\n \"subcategory\": \"Amazon River\"\n \n }\n\n \n}"}}}},"description":"200 response"},"401":{"content":{"application/json":{"examples":{"response":{"value":"{\n \"error\": {\n \"code\": 401,\n \"message\": \"Unauthorized\"\n }\n} "}}}},"description":"401 response"}},"security":[{"X-Fungenerators-Api-Secret":[]}],"tags":["Random Facts"]}}},"components":{"securitySchemes":{"X-Fungenerators-Api-Secret":{"in":"header","name":"X-Fungenerators-Api-Secret","type":"apiKey"}}}}