Convertors
Image, CSV, and ZIP pack/extract APIs — REST and TypeScript SDK.
TypeScript SDK
Namespace: ty.convertors. Pass file as image (or route-specific field). Full table: SDK Tool Map → Convertors.
import { ToolYour } from "@toolyour/sdk";
const ty = ToolYour({ apiKey: process.env.TOOLYOUR_API_KEY! });
await ty.convertors.convertToJpg({ image: fileBlob });
await ty.convertors.compressImage({ image: fileBlob });
await ty.convertors.csvToJson({ csvFile: fileBlob });Base path: /api/v1/convertors
All endpoints are POST and require X-Api-Key. Image routes use multipart/form-data. ZIP pack/extract also accept JSON urls.
Image uploads
Most routes accept an image file field:
curl -X POST "https://api.toolyour.com/api/v1/convertors/to-jpg" \
-H "X-Api-Key: $API_KEY" \
-F "image=@photo.png"Default response is JSON with result.downloadUrl (presigned link, 1 hour). See Calling Tools for the full envelope and download step.
Common routes:
| Path | Description |
|---|---|
/to-jpg | Convert to JPG |
/to-png | Convert to PNG |
/to-webp | Convert to WebP |
/to-svg | Convert to SVG |
/compress-image | Compress image |
/to-grayscale | Grayscale |
/image-to-pdf | Image to PDF |
/image-metadata | Read metadata (JSON, not a file URL) |
/folder-to-zip | Pack files or urls into a ZIP (files field, up to 50) |
/zip-extract | Extract a ZIP (file or urls) — bundle ZIP + per-file links |
ZIP pack / extract
Public pages: /file-conversion/folder-to-zip and /file-conversion/zip-extract. Same routes via REST and MCP (1 credit). Extract does not return a filesystem folder — HTTP returns download URLs.
curl -X POST "https://api.toolyour.com/api/v1/convertors/folder-to-zip" \
-H "X-Api-Key: $API_KEY" \
-F "files=@logo.png" \
-F "files=@styles.css"
curl -X POST "https://api.toolyour.com/api/v1/convertors/zip-extract" \
-H "X-Api-Key: $API_KEY" \
-F "file=@assets.zip"JSON URL mode (no multipart):
curl -X POST "https://api.toolyour.com/api/v1/convertors/folder-to-zip" \
-H "X-Api-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"urls":["https://example.com/logo.png"]}'await ty.convertors.folderToZip({ files: fileBlob });
await ty.convertors.folderToZip({ urls: ["https://example.com/logo.png"] });
await ty.convertors.zipExtract({ file: zipBlob });CSV / JSON
| Path | File field | Response |
|---|---|---|
/csv-2-json | csvFile | JSON in body |
/json-2-csv | jsonFile | ToolFileResponse + downloadUrl |
Query parameter
| Name | Values | Default |
|---|---|---|
delivery | url, binary | url |
See the Convertors tag in the API reference for the full list and schemas.