This is a version of a python module called Randfacts but it is a rest API, so you don't need to install anything. You can use a deployed vesion of this at https://randfacts-api.herokuapp.com/
Currently this is fairly new so you can only access https://randfacts-api.herokuapp.com/fact/safe for safe facts and https://randfacts-api.herokuapp.com/fact/unsafe for unsafe facts.
The origional python module: Randfacts