This commit is contained in:
seb
2026-09-27 18:01:08 +02:00
parent 9f97e3f3c6
commit 65b4ce5098
6 changed files with 516 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
# `POST /serper/image`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Crawl image from URL, crop white/transparency borders, and return AVIF
Fetches the image at the provided `url`, crops surrounding white and
transparent border margins, resizes to max 1000px, and returns the AVIF image.
## Body (JSON)
```json
{
"url": "https://example.com/logo.png"
}
```
## Response `200`
AVIF image bytes
## Errors
| Status | Description |
|--------|-------------|
| 400 | URL missing, invalid input, or image processing error — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
| 502 | Bad Gateway (crawling the upstream image URL failed) — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._