How to Filter and Customize Cat Images from the CATAAS API
Updated
You can filter and customize CATAAS cat images with query parameters on the /cat endpoint: type sets the image shape (xsmall, small, medium, square), filter applies blur, mono, negate, or custom effects, width/height resize the image, and filter=custom accepts brightness, lightness, saturation, hue, or RGB values. All of these can be combined with tag paths and the says text endpoint, so a single request can return, for example, a square, monochrome, resized cat saying "Hello."
The parameters at a glance
| Parameter | Accepted values | What it does |
|---|---|---|
type |
xsmall, small, medium, square |
Returns the cat image in the given image type |
filter |
blur, mono, negate, custom |
Applies a preset filter to the image |
filter=custom + brightness, lightness, saturation, hue |
Numeric values | Adjusts those four properties |
filter=custom + r, g, b |
Numeric values | Applies an RGB-based filter |
width or height |
Numeric value | Returns the cat at a custom size |
These are documented as query parameters on /cat, so they attach after a ? and are joined with &.
Step-by-step: build a customized request
- Start from the base endpoint. A plain
GET /catreturns a random cat. - Add a shape if you need one.
GET /cat?type=squarereturns a square cat; the other documented values arexsmall,small, andmedium. - Add a filter.
GET /cat?filter=monoreturns a monochrome cat. The presets areblur,mono, andnegate. - Or tune the filter yourself.
GET /cat?filter=custom&brightness=:brightness&lightness=:lightness&saturation=:saturation&hue=:hueadjusts those four properties, whileGET /cat?filter=custom&r=:red&g=:green&b=:blueapplies an RGB filter. - Resize.
GET /cat?width=:widthorGET /cat?height=:heightreturns the cat at your chosen dimension. - Combine everything. The documentation's own combo example is
/cat/gif/says/Hello?filter=mono&fontColor=orange&fontSize=20&type=square, which mixes a GIF, overlay text, a filter, text styling, and an image type in one request.
Expected result: the response is the image itself, unless you ask for another format (see below). Verify it worked by checking that the returned image shows the shape, filter, and size you requested; if a parameter seems ignored, confirm the spelling and that it is attached to /cat with ? and &.
Combining filters with tags and text
Filters are query parameters, so they stack on top of the path-based features:
- Tags:
/cat/:tagreturns a random cat with that tag, and multiple tags can be combined with the:tagseparator (the docs show "Random orange cute cat" as the example). Add filters after the path, e.g./cat/:tag?filter=blur. - Text overlay:
/cat/says/:textreturns a cat saying your text, and/cat/:tag/says/:textcombines a tag with text. Text styling is also available viafontSizeandfontColor, as in/cat/says/:text?fontSize=:size&fontColor=:color. - Everything at once: a tag path,
says, and query filters can all appear in one URL, following the combo pattern above.
Choosing between presets and custom filters
- Use a preset (
blur,mono,negate) when you want a predictable, one-word effect and don't need fine control — it keeps URLs short and readable. - Use
filter=customwhen you need a specific look: the brightness/lightness/saturation/hue route for perceptual adjustments, or the r/g/b route for color-channel control. Note that the two custom forms are documented separately, so pick one per request rather than assuming they merge. - Use
typevs.width/heightdepending on intent:typeselects a documented image variant, whilewidth/heightgives you an explicit dimension. If you need an exact pixel size, the width/height parameters are the direct route.
Getting JSON instead of an image
If your client needs metadata rather than the binary image, the docs describe two options: /cat?json=true returns a random cat as a JSON object, and the newer behavior returns JSON when the request contains an application/json header. For browsing the collection, /api/cats?tags=tag1,tag2&skip=0&limit=10 returns cats filtered by tags with pagination, and /api/tags returns all available tags — useful for discovering valid tag values before building filtered image URLs.
Common snags
- Tag search behavior changed: the site notes a fix for tags search and for tags combined with a
,separator, so if you relied on older tag syntax, check the current API doc. - Mixing parameters: keep the
?/&structure intact when combiningfilter,type, and text options; a malformed query is the most likely reason a customization silently doesn't apply. - JSON vs. image: decide up front whether you want the image or the JSON object, since
json=trueor the JSON header changes the response type.