# Cat Facts

> Pull cat facts and cat breed data from catfact.ninja, the free keyless cat trivia API. Draw one fact at random or a batch of different ones, cap the length so a fact fits a Slack status or a subject line, search every fact for a word, walk the whole catalogue a page at a time, or pick a fact of the day that stays the same all day so a scheduled post never tells two. It also publishes a breed table: list the breeds by country, coat, pattern or origin, or look one up by name.

App · Misc References · 8 actions. Web page: https://docs.lodol.com/docs/integrations/cat-facts

## Actions

### Check service status

Check whether catfact.ninja is answering, how quickly, and how much of the rate limit is left. This is the one action that reports a problem as a value instead of failing the step, so a workflow can decide what to do about it. Being throttled is reported separately from being down.

**Inputs**: None.

**Outputs**

- `message` (text)
- `online` (true/false)
- `rate_limit` (number)
- `rate_limit_remaining` (number)
- `rate_limited` (true/false)
- `reachable` (true/false)
- `response_time_ms` (number)
- `status_code` (number)

**Example output**

```json
{
  "message": "catfact.ninja is up and answering.",
  "online": true,
  "rate_limit": 100,
  "rate_limit_remaining": 99,
  "rate_limited": false,
  "reachable": true,
  "response_time_ms": 74.2,
  "status_code": 200
}
```

### Get a cat breed

Look up one cat breed by name and get the country, coat, pattern and origin recorded for it. The service has no route that takes a name, so the table is read and matched here: an exact name always wins, and failing that a partial one resolves when it lands on a single breed, so 'bobtail' and 'Bengal cat' both work. A name matching two breeds is reported with both rather than guessed between.

**Inputs**

- Breed (`breed`, text, required): The breed to look up. Pick one from the list, or type a name from an earlier step: a partial name works when only one breed matches it.

**Outputs**

- `breed` (object)
- `matched_exactly` (true/false)
- `requested_breed` (text)

**Example output**

```json
{
  "breed": {
    "breed": "Abyssinian",
    "coat": "Short",
    "country": "Ethiopia",
    "origin": "Natural/Standard",
    "pattern": "Ticked"
  },
  "matched_exactly": true,
  "requested_breed": "Abyssinian"
}
```

### Get a random cat fact

Get one random cat fact, ready to post. Cap its length when it has to fit somewhere, such as a Slack status or a subject line, and the service picks a fact that fits.

**Inputs**

- Maximum length (`max_length`, number): Only allow facts up to this many characters, which is useful when the fact has to fit somewhere: a tweet, a Slack status, a subject line. Every fact comes back with its own length beside it. Leave empty to allow any fact. At least 1.

**Outputs**

- `fact` (object)
- `max_length` (number)

**Example output**

```json
{
  "fact": {
    "fact": "A cat\u2019s jaw can\u2019t move sideways, so a cat can\u2019t chew large chunks of food.",
    "length": 74
  },
  "max_length": null
}
```

### Get random cat facts

Get several different cat facts at once, up to 25. No fact is drawn twice in the same batch. The catalogue is read once and the batch sampled from it, so twenty facts cost one request rather than twenty; asking for more than the catalogue holds returns what there is rather than failing.

**Inputs**

- Number of facts (`count`, number): How many facts to draw, from 1 to 25. Defaults to 5. From 1 to 25.
- Maximum length (`max_length`, number): Only allow facts up to this many characters, which is useful when the fact has to fit somewhere: a tweet, a Slack status, a subject line. Every fact comes back with its own length beside it. Leave empty to allow any fact. At least 1.

**Outputs**

- `fact_count` (number)
- `facts` (list)
- `max_length` (number)
- `requested_count` (number)
- `total` (number)

**Example output**

```json
{
  "fact_count": 2,
  "facts": [
    {
      "fact": "Unlike dogs, cats do not have a sweet tooth. Scientists believe this is due to a mutation in a key taste receptor.",
      "length": 114
    },
    {
      "fact": "A cat\u2019s jaw can\u2019t move sideways, so a cat can\u2019t chew large chunks of food.",
      "length": 74
    }
  ],
  "max_length": null,
  "requested_count": 2,
  "total": 332
}
```

### Get the cat fact of the day

Pick one cat fact for a day and keep picking that same fact all day. A random draw gives a different one on every call, so a daily workflow that retries, or that two people run an hour apart, posts two different facts for the one day. This one is fixed by the date: the same date always gives the same fact, and tomorrow gives a different one. Add a seed of your own to have two workspaces post different facts on the same day.

**Inputs**

- Day (`date`, date): The day to pick a fact for. Leave empty for today in UTC, which is what a scheduled step wants.
- Seed (`seed`, text): Any text you like, mixed into the day so that two workspaces running this on the same day get different facts. Leave empty to share the day's fact with everyone else.
- Maximum length (`max_length`, number): Only allow facts up to this many characters, which is useful when the fact has to fit somewhere: a tweet, a Slack status, a subject line. Every fact comes back with its own length beside it. Leave empty to allow any fact. At least 1.

**Outputs**

- `date` (text)
- `fact` (object)
- `max_length` (number)
- `pool_size` (number)
- `seed` (text)

**Example output**

```json
{
  "date": "2026-08-31",
  "fact": {
    "fact": "The technical term for a cat\u2019s hairball is a \u201cbezoar.\u201d",
    "length": 54
  },
  "max_length": null,
  "pool_size": 332,
  "seed": "2026-08-31"
}
```

### List cat breeds

List the cat breeds the service records, with the country, coat, pattern and origin it holds for each. Narrow by any of those fields: the service itself offers no filter at all, so the table is read once and narrowed here on whole words, which is what lets one spelling find another. The number of breeds matching is always reported, however many are returned.

**Inputs**

- Country (`country`, text): Only keep breeds whose country mentions this. Matched on whole words rather than exactly, so the table's inconsistent spellings still find each other. Many entries read like 'developed in the United States (founding stock from Asia)', so 'United States' finds those too.
- Coat (`coat`, text): Only keep breeds with this coat. The table records Short, Long, Semi-long, Short/Long, Rex and Hairless among others. Matched on whole words rather than exactly, so the table's inconsistent spellings still find each other.
- Pattern (`pattern`, text): Only keep breeds with this coat pattern, such as Ticked, Spotted, Solid or Colorpoint. Matched on whole words rather than exactly, so the table's inconsistent spellings still find each other.
- Origin (`origin`, text): Only keep breeds with this origin, such as Natural, Mutation, Crossbreed or Hybrid. Matched on whole words rather than exactly, so the table's inconsistent spellings still find each other.
- Number of breeds (`limit`, number): How many breeds to return, from 1 to 200. Defaults to 25, which is the service's own page size. From 1 to 200.

**Outputs**

- `breed_count` (number)
- `breeds` (list)
- `coat` (text)
- `country` (text)
- `origin` (text)
- `pattern` (text)
- `requested_count` (number)
- `total_matches` (number)

**Example output**

```json
{
  "breed_count": 3,
  "breeds": [
    {
      "breed": "Abyssinian",
      "coat": "Short",
      "country": "Ethiopia",
      "origin": "Natural/Standard",
      "pattern": "Ticked"
    },
    {
      "breed": "Aegean",
      "coat": "Semi-long",
      "country": "Greece",
      "origin": "Natural/Standard",
      "pattern": "Bi- or tri-colored"
    },
    {
      "breed": "Arabian Mau",
      "coat": "Short",
      "country": "Arabian Peninsula",
      "origin": "Natural",
      "pattern": null
    }
  ],
  "coat": null,
  "country": null,
  "origin": null,
  "pattern": null,
  "requested_count": 3,
  "total_matches": 98
}
```

### List cat facts

Walk the cat fact catalogue a page at a time, in the service's own order, with the total and the page counts beside the facts. Use this to work through every fact; use Get random cat facts for a handful to post.

**Inputs**

- Facts per page (`limit`, number): How many facts to return, from 1 to 500. Defaults to 10, which is the service's own page size. From 1 to 500.
- Page (`page`, number): Which page to fetch, counting from 1. The result says how many pages there are and whether another follows. At least 1.
- Maximum length (`max_length`, number): Only allow facts up to this many characters, which is useful when the fact has to fit somewhere: a tweet, a Slack status, a subject line. Every fact comes back with its own length beside it. Leave empty to allow any fact. At least 1.

**Outputs**

- `current_page` (number)
- `fact_count` (number)
- `facts` (list)
- `has_more` (true/false)
- `last_page` (number)
- `max_length` (number)
- `per_page` (number)
- `requested_count` (number)
- `total` (number)

**Example output**

```json
{
  "current_page": 1,
  "fact_count": 2,
  "facts": [
    {
      "fact": "Unlike dogs, cats do not have a sweet tooth. Scientists believe this is due to a mutation in a key taste receptor.",
      "length": 114
    },
    {
      "fact": "The technical term for a cat\u2019s hairball is a \u201cbezoar.\u201d",
      "length": 54
    }
  ],
  "has_more": true,
  "last_page": 166,
  "max_length": null,
  "per_page": 2,
  "requested_count": 2,
  "total": 332
}
```

### Search cat facts

Find the cat facts that mention something, a word, a breed or a place, best match first. The service has no search of its own, so the whole catalogue is read and matched here, and ranked with a whole-word hit worth far more than one buried inside a longer word. The total number of matches is always reported, however many are returned.

**Inputs**

- Search for (`query`, text, required): The word or phrase to look for in the facts, 2 to 120 characters.
- Number of results (`limit`, number): How many matches to return, from 1 to 100. Defaults to 10. From 1 to 100.
- Maximum length (`max_length`, number): Only allow facts up to this many characters, which is useful when the fact has to fit somewhere: a tweet, a Slack status, a subject line. Every fact comes back with its own length beside it. Leave empty to allow any fact. At least 1.

**Outputs**

- `match_count` (number)
- `matches` (list)
- `max_length` (number)
- `query` (text)
- `searched_count` (number)
- `total_matches` (number)

**Example output**

```json
{
  "match_count": 1,
  "matches": [
    {
      "fact": "Unlike dogs, cats do not have a sweet tooth. Scientists believe this is due to a mutation in a key taste receptor.",
      "length": 114
    }
  ],
  "max_length": null,
  "query": "sweet tooth",
  "searched_count": 332,
  "total_matches": 1
}
```
