Request
curl -X POST https://api.iterationlayer.com/image-transformation/v1/transform \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file": {
"type": "url",
"name": "group-photo.jpg",
"url": "https://example.com/group-photo.jpg"
},
"operations": [
{ "type": "smart_crop", "width_in_px": 400, "height_in_px": 400 },
{ "type": "convert", "format": "jpeg", "quality": 90 }
]
}'Response
{
"success": true,
"data": {
"buffer": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
"mime_type": "image/jpeg"
}
}Request
import { IterationLayer } from "iterationlayer";
const client = new IterationLayer({ apiKey: "YOUR_API_KEY" });
const result = await client.transform({
file: {
type: "url",
name: "group-photo.jpg",
url: "https://example.com/group-photo.jpg",
},
operations: [
{ type: "smart_crop", width_in_px: 400, height_in_px: 400 },
{ type: "convert", format: "jpeg", quality: 90 },
],
});
const imageBuffer = Buffer.from(result.data.buffer, "base64");Response
{
"success": true,
"data": {
"buffer": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
"mime_type": "image/jpeg"
}
}Request
import base64
from iterationlayer import IterationLayer
client = IterationLayer(api_key="YOUR_API_KEY")
result = client.transform(
file={
"type": "url",
"name": "group-photo.jpg",
"url": "https://example.com/group-photo.jpg",
},
operations=[
{"type": "smart_crop", "width_in_px": 400, "height_in_px": 400},
{"type": "convert", "format": "jpeg", "quality": 90},
],
)
with open("result.jpeg", "wb") as f:
f.write(base64.b64decode(result["data"]["buffer"]))Response
{
"success": true,
"data": {
"buffer": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
"mime_type": "image/jpeg"
}
}Request
package main
import il "github.com/iterationlayer/sdk-go"
client := il.NewClient("YOUR_API_KEY")
result, err := client.Transform(il.TransformRequest{
File: il.NewFileFromURL("group-photo.jpg", "https://example.com/group-photo.jpg"),
Operations: []il.TransformOperation{
il.NewSmartCropOperation(400, 400),
il.NewConvertOperation("jpeg"),
},
})Response
{
"success": true,
"data": {
"buffer": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
"mime_type": "image/jpeg"
}
}