Integrate our API into your website or app, then use any image to generate unique designs.
$ curl -H 'X-API-Key:YOUR_API_KEY' \
-F 'image_file=@/path/to/file.jpg' \
-f https://api.designify.com/v1.0/designify/:designId -o design.png
Design used to be complex, but now it's just an API call away. Upload an image from any website, mobile app, or any other programming language, then save the final result in seconds.
By default you can process up to 1,000 images per month. Review your usage and set a custom limit in your dashboard.
Any design you save has a unique ID. To get the Design ID, edit a new design or open an existing one and then click Start Batch > API Upload.
The following samples show the minimal code needed to use the API. For more in depth usage examples take a look at our demo repository.
$ curl -H 'X-API-Key: INSERT_YOUR_API_KEY_HERE' \
-F 'image_file=@/path/to/file.jpg' \
-f https://api.designify.com/v1.0/designify/:designId -o design.png
// Requires "axios" and "form-data" to be installed (see https://www.npmjs.com/package/axios and https://www.npmjs.com/package/form-data)
const axios = require("axios");
const FormData = require("form-data");
const fs = require("fs");
const form = new FormData();
form.append("image_file", fs.createReadStream("/path/to/file.jpg"));
axios({
method: "post",
url: "https://api.designify.com/v1.0/designify/:designId",
data: form,
responseType: "arraybuffer",
encoding: null,
headers: {
...form.getHeaders(),
"X-Api-Key": "INSERT_YOUR_API_KEY_HERE",
},
})
.then((response) => {
if (response.status != 200) {
return console.error("Error:", response.status, response.statusText);
}
fs.writeFileSync("design.png", response.data);
})
.catch((error) => {
const decoder = new TextDecoder();
console.log(decoder.decode(error.response.data));
});
# Requires "requests" to be installed (see python-requests.org)
import requests
file = open('/path/to/file.jpg','rb')
response = requests.post(
'https://api.designify.com/v1.0/designify/:designId',
files=[('image_file', (file.name, file, 'image/jpeg'))],
headers={'X-Api-Key': 'INSERT_YOUR_API_KEY_HERE'},
)
if response.status_code == requests.codes.ok:
with open('design.png', 'wb') as out:
out.write(response.content)
else:
print("Error:", response.status_code, response.text)
// Requires "guzzle" to be installed (see guzzlephp.org)
$client = new GuzzleHttp\Client();
$res = $client->post('https://api.designify.com/v1.0/designify/:designId', [
'multipart' => [
[
'name' => 'image_file',
'contents' => fopen('/path/to/file.jpg', 'r')
]
],
'headers' => [
'X-Api-Key' => 'INSERT_YOUR_API_KEY_HERE'
]
]);
$fp = fopen("design.png", "wb");
fwrite($fp, $res->getBody());
fclose($fp);
// Requires "Apache HttpComponents" to be installed (see hc.apache.org)
import java.io.File;
import java.nio.file.Files;
import org.apache.http.client.fluent.Request;
import org.apache.http.client.fluent.Response;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
// ...
File imageFile = new File("/path/to/file.jpg");
String filename = imageFile.getName();
String mimeType = Files.probeContentType(imageFile.toPath());
ContentType contentType = ContentType.create(mimeType);
Response response = Request.Post("https://api.designify.com/v1.0/designify/:designId")
.addHeader("X-Api-Key", "INSERT_YOUR_API_KEY_HERE")
.body(
MultipartEntityBuilder.create()
.addBinaryBody("image_file", imageFile, contentType, filename)
.build()
).execute();
response.saveContent(new File("design.png"));
using (var client = new HttpClient())
using (var formData = new MultipartFormDataContent())
{
var fileContent = new ByteArrayContent(File.ReadAllBytes("/path/to/file.jpg"));
fileContent.Headers.Add("Content-Type", "image/jpeg");
fileContent.Headers.Add("Content-Disposition", $"form-data; name=\"image\"; filename=\"image.jpg\"");
formData.Add(fileContent, "image_file", "file.jpg");
formData.Headers.Add("X-Api-Key", "INSERT_YOUR_API_KEY_HERE");
var response = client.PostAsync("https://api.designify.com/v1.0/designify/:designId", formData).Result;
if (response.IsSuccessStatusCode)
{
FileStream fileStream = new FileStream("design.png", FileMode.Create, FileAccess.Write, FileShare.None);
await response.Content.CopyToAsync(fileStream).ContinueWith((copyTask) => { fileStream.Close(); });
}
else
{
Console.WriteLine("Error: " + response.Content.ReadAsStringAsync().Result);
}
}
// Requires Alamofire to be installed (see https://github.com/Alamofire/Alamofire)
guard let fileUrl = Bundle.main.url(forResource: "file", withExtension: "jpg"),
let data = try? Data(contentsOf: fileUrl) else { return }
Alamofire
.upload(
multipartFormData: { builder in
builder.append(
data,
withName: "image_file",
fileName: "file.jpg",
mimeType: "image/jpeg"
)
},
to: URL(string: "https://api.designify.com/v1.0/designify/:designId")!,
headers: [
"X-Api-Key": "INSERT_YOUR_API_KEY_HERE"
]
) { result in
switch result {
case .success(let upload, _, _):
upload.responseJSON { imageResponse in
guard let imageData = imageResponse.data,
let image = UIImage(data: imageData) else { return }
self.imageView.image = image
}
case .failure:
return
}
}
// Requires AFNetworking to be installed (see https://github.com/AFNetworking/AFNetworking)
NSURL *fileUrl = [NSBundle.mainBundle URLForResource:@"file" withExtension:@"jpg"];
NSData *data = [NSData dataWithContentsOfURL:fileUrl];
if (!data) {
return;
}
AFHTTPSessionManager *manager =
[[AFHTTPSessionManager alloc] initWithSessionConfiguration:
NSURLSessionConfiguration.defaultSessionConfiguration];
manager.responseSerializer = [AFImageResponseSerializer serializer];
[manager.requestSerializer setValue:@"INSERT_YOUR_API_KEY_HERE"
forHTTPHeaderField:@"X-Api-Key"];
NSURLSessionDataTask *dataTask = [manager
POST:@"https://api.designify.com/v1.0/designify/:designId"
parameters:nil
constructingBodyWithBlock:^(id _Nonnull formData) {
[formData appendPartWithFileData:data
name:@"image_file"
fileName:@"file.jpg"
mimeType:@"image/jpeg"];
}
progress:nil
success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
if ([responseObject isKindOfClass:UIImage.class] == false) {
return;
}
self.imageView.image = responseObject;
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
// Handle error here
}];
[dataTask resume];