Currently undergoing maintenance - Some pages may not work as expected

Random Facts API

Introduction

A simple API that provides random facts about different topics. (Over 2500+ facts)

Usage

To use this API, just send a GET request to the following endpoint:

https://api.jm26.net/random-facts/

For example, if you want to get a random fact, you can send a GET request to the following URL:

curl -X GET "https://api.jm26.net/random-facts/"

The response might look like this (because the facts are random):

{
  "status": "success",
  "fact": "The most money ever paid for a cow in an auction was $1.3 million.",
  "source": "https://www.cs.cmu.edu/~bingbin/"
}

Parameters

The following parameters are available:

Parameter Description Default Required
format The format of the response (json/text/xml/html/iframe/info) json
theme* The theme of the iframe response (light/dark) auto

*Note: The theme parameter is only applicable when the format parameter is set to iframe.

More Examples

Get a random fact in text format

curl -X GET "https://api.jm26.net/random-facts/?format=text"
The Basenji dog is known as the "barkless dog" because it doesn't bark like other dogs.

Get a random fact in iframe format

<iframe src="https://api.jm26.net/random-facts/?format=iframe" width="600px" height="300px"></iframe>

(Actual iframe response below)

Note: To remove the Powered by watermark, just add the theme parameter with a value of light, dark, or auto.