Random Cat Facts With curl

Fetch a random cat fact from a free JSON API.

LinuxcurlnetworkapiLow risk
Run curl -s https://catfact.ninja/fact to print a random cat fact as JSON.

01Command

Command
$ curl -s https://catfact.ninja/fact

02What it does

Cat Fact Ninja returns a small JSON object with a fact and its length. Read just the text with jq -r .fact, or use the /facts endpoint to page through the whole list. It needs no API key and is a friendly tutorial API.

03Risk

RiskLow risk
Requirementscurl (preinstalled on most Linux distributions)
!Warning: The service is operated by a small third party, so availability is best-effort.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Cat Fact Ninja API
    catfact.ninja · vendor-doc · 2026-09-20
    Evidence: Documents the /fact endpoint and JSON response shape.

Last verified: 2026-09-20 · Category: Network

06Related solutions