Files
dashback/docs/api/routes/serper/image.md
2026-09-30 19:29:13 +02:00

39 lines
999 B
Markdown

# `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)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `url` | yes | string | Absolute HTTP/HTTPS URL of the image to crawl |
```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`._