---
title: "Compute or scale to an aspect ratio"
method: POST
path: "/aspect-ratio.php"
tags: ["data"]
---

# Compute or scale to an aspect ratio

`POST /aspect-ratio.php`

## Request

- Base URL: `https://mate.tools/api/v1`
- URL: `https://mate.tools/api/v1/aspect-ratio.php`
- Auth: none declared

Two modes: (1) compute the reduced aspect ratio from `width` + `height`, returning 16:9 / 4:3 / 21:9 / etc. with common-name matching; (2) scale a single dimension to a target `ratio` like "16:9", "4:3", "1.85:1".

## Request body

- object
  - `width` number
  - `height` number
  - `ratio` string

## Response `200`

Success

## Other responses

- `400`: Malformed request
- `429`: Rate limit exceeded (60/min, 600/hour per IP). Includes Retry-After header.

---

[API](https://skmtc.dev/mate/apis/mate-tools-api.md) · [All operations](https://skmtc.dev/mate/apis/mate-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mate/apis/mate-tools-api/revisions/874670b78962?raw)
