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": "supplier-image.jpg",
"url": "https://cdn.example.com/supplier/product-001.jpg"
},
"operations": [
{
"type": "smart_crop",
"width_in_px": 1000,
"height_in_px": 1000
}
]
}'Response
{
"success": true,
"data": {
"buffer": "/9j/4AAQSkZJRgABAQEASABI...",
"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: "supplier-image.jpg",
url: "https://cdn.example.com/supplier/product-001.jpg",
},
operations: [
{
type: "smart_crop",
width_in_px: 1000,
height_in_px: 1000,
},
],
});Response
{
"success": true,
"data": {
"buffer": "/9j/4AAQSkZJRgABAQEASABI...",
"mime_type": "image/jpeg"
}
}Request
from iterationlayer import IterationLayer
client = IterationLayer(api_key="YOUR_API_KEY")
result = client.transform(
file={
"type": "url",
"name": "supplier-image.jpg",
"url": "https://cdn.example.com/supplier/product-001.jpg",
},
operations=[
{
"type": "smart_crop",
"width_in_px": 1000,
"height_in_px": 1000,
},
],
)Response
{
"success": true,
"data": {
"buffer": "/9j/4AAQSkZJRgABAQEASABI...",
"mime_type": "image/jpeg"
}
}Request
package main
import il "github.com/iterationlayer/sdk-go"
func main() {
client := il.NewClient("YOUR_API_KEY")
result, err := client.Transform(il.TransformRequest{
File: il.NewFileFromURL(
"supplier-image.jpg",
"https://cdn.example.com/supplier/product-001.jpg",
),
Operations: []il.TransformOperation{
il.NewSmartCropOperation(1000, 1000),
},
})
if err != nil {
panic(err)
}
}Response
{
"success": true,
"data": {
"buffer": "/9j/4AAQSkZJRgABAQEASABI...",
"mime_type": "image/jpeg"
}
}