Cat Facts (catfact.ninja) Facts API
Random cat trivia, individually or in paginated lists.
Random cat trivia, individually or in paginated lists.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/cat-facts-catfact-facts-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Cat Breeds Facts API
description: 'A free, no-authentication REST API at catfact.ninja serving random cat trivia and a catalog of cat breeds. Three GET endpoints: /fact (a single random fact), /facts (paginated list of facts), and /breeds (paginated list of breeds). Designed as a canonical "hello world" public API for tutorials, demos, and agent tool examples.'
contact:
name: Cat Facts API
email: contact@catfact.ninja
url: https://catfact.ninja/
license:
name: Free Public API
url: https://catfact.ninja/
version: 1.0.0
x-generated-from: documentation
x-source-url: https://catfact.ninja/docs?api-docs.json
x-last-validated: '2026-05-30'
servers:
- url: https://catfact.ninja
description: Cat Facts API production server.
tags:
- name: Facts
description: Random cat trivia, individually or in paginated lists.
paths:
/fact:
get:
tags:
- Facts
summary: Get Random Fact
description: Returns a single random cat fact. An optional max_length query parameter caps the returned fact length, which is useful for SMS, push notifications, and any other length-constrained surface.
operationId: getRandomFact
parameters:
- name: max_length
in: query
description: Maximum length, in characters, of the returned fact.
required: false
schema:
type: integer
format: int32
minimum: 1
example: 140
responses:
'200':
description: A random cat fact.
content:
application/json:
schema:
$ref: '#/components/schemas/CatFact'
examples:
GetRandomFact200Example:
summary: Default getRandomFact 200 response
x-microcks-default: true
value:
fact: People who are allergic to cats are actually allergic to cat saliva or to cat dander.
length: 89
'404':
description: No fact matched the given constraints.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
GetRandomFact404Example:
summary: Default getRandomFact 404 response
value:
message: Fact not found
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/facts:
get:
tags:
- Facts
summary: Get a List of Facts
description: Returns a paginated list of cat facts. Supports max_length (character cap per fact) and limit (page size) query parameters. The response follows Laravel's paginator format with current_page, per_page, total, last_page, links, and a data array of CatFact objects.
operationId: getFacts
parameters:
- name: max_length
in: query
description: Maximum length, in characters, of each returned fact.
required: false
schema:
type: integer
format: int32
minimum: 1
example: 140
- name: limit
in: query
description: Number of facts to return per page.
required: false
schema:
type: integer
format: int32
minimum: 1
example: 10
responses:
'200':
description: A paginated list of cat facts.
content:
application/json:
schema:
$ref: '#/components/schemas/CatFactList'
examples:
GetFacts200Example:
summary: Default getFacts 200 response
x-microcks-default: true
value:
current_page: 1
data:
- fact: Unlike dogs, cats do not have a sweet tooth.
length: 45
- fact: When a cat chases its prey, it keeps its head level.
length: 53
first_page_url: https://catfact.ninja/facts?page=1
from: 1
last_page: 111
last_page_url: https://catfact.ninja/facts?page=111
next_page_url: https://catfact.ninja/facts?page=2
path: https://catfact.ninja/facts
per_page: 2
prev_page_url: null
to: 2
total: 332
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
components:
schemas:
PaginationLink:
type: object
title: PaginationLink
description: A single navigation link in a Laravel-style paginator response.
properties:
url:
type:
- string
- 'null'
description: Target URL of the link, or null for disabled controls.
example: https://catfact.ninja/facts?page=2
label:
type: string
description: Display label (page number, "Previous", "Next", or "...").
example: '2'
active:
type: boolean
description: Whether this link represents the current page.
example: false
CatFact:
type: object
title: CatFact
description: A single cat trivia fact and its character length.
properties:
fact:
type: string
description: The cat fact text.
example: Cats sleep 70% of their lives.
length:
type: integer
format: int32
description: Character length of the fact string.
example: 30
required:
- fact
- length
Error:
type: object
title: Error
description: Generic error response payload.
properties:
message:
type: string
description: Human-readable error message.
example: Fact not found
CatFactList:
type: object
title: CatFactList
description: Laravel-style paginated wrapper around a list of CatFact objects.
properties:
current_page:
type: integer
format: int32
example: 1
data:
type: array
items:
$ref: '#/components/schemas/CatFact'
first_page_url:
type: string
example: https://catfact.ninja/facts?page=1
from:
type:
- integer
- 'null'
format: int32
example: 1
last_page:
type: integer
format: int32
example: 111
last_page_url:
type: string
example: https://catfact.ninja/facts?page=111
links:
type: array
items:
$ref: '#/components/schemas/PaginationLink'
next_page_url:
type:
- string
- 'null'
example: https://catfact.ninja/facts?page=2
path:
type: string
example: https://catfact.ninja/facts
per_page:
type: integer
format: int32
example: 10
prev_page_url:
type:
- string
- 'null'
example: null
to:
type:
- integer
- 'null'
format: int32
example: 10
total:
type: integer
format: int32
example: 332