Cat Facts

These endpoints allow you to retrieve all cat facts, a single cat fact by its id, or a random cat fact. The response will be an array of JSON objects if you request all facts, or a single JSON object if you request a single fact or a random fact.

The Cat Fact model

PropTypeDefault
id
integer
-
text
string
-

All cat facts

GET/cat-facts

Retrieve all cat facts.

Response
{
  "data": [
    {
      "id": 1,
      "text": "On average, cats spend 2/3 of every day sleeping"
    },
    {
      "id": 2,
      "text": "Unlike dogs, cats do not have a sweet tooth"
    }
    // ...
  ],
  "meta": {
    "isFirstPage": true,
    "isLastPage": true,
    "currentPage": 1,
    "previousPage": null,
    "nextPage": null,
    "pageCount": 1,
    "totalCount": 2
  }
}

Single cat fact

GET/cat-facts/<id>

Retrieve a single cat fact by its id.

Response
{
  "data": {
    "id": 1,
    "text": "On average, cats spend 2/3 of every day sleeping"
  },
  "meta": {}
}

Random cat fact

GET/cat-facts/random

Retrieve a random cat fact.

Response
{
  "data": {
    "id": 70,
    "text": "Genetically, cats' brains are more similar to that of a human than a dog's brain"
  },
  "meta": {}
}