Get API Key
Normal return
{
"code": 0,
"data": {
"imageBase64: "iVBORw0KGgo..." //base64 encoded of the image
},
"msg": null,
"time": 1590462453264
}
Error
{
"code": 1001, //
"data": null
"msg": 'Insufficient balance',
"time": 1590462453264
}
Frames and Borders API
Add text Overlay to images
Parameter | Type | Description |
---|
color | Integer | HTML color code |
width | Integer | Pixels |
Sample code
Curl
curl -H 'key: INSERT_YOUR_API_KEY_HERE' \
-F 'file=@/path/to/file.jpg' \
-F 'color=red' \
-F 'width=40' \
-f 'http://localhost:3000/v1/frame/addFrame' \
-o out.png
Python
import requests
payload = dict(color='red', width=40 );
response = requests.post(
'http://localhost:3000/v1/frame/addFrame',
files={'file': open('/path/to/file.jpg', 'rb')},
data = payload,
headers={'key': 'INSERT_YOUR_API_KEY_HERE'},
)
Node.js
const requestOptions = {
method: 'POST',
headers: {
'key': 'INSERT_YOUR_API_KEY_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({ title: 'Add frame'
color:'red',
width: 40,
})
};
fetch('http://localhost:3000/v1/frame/addFrame', requestOptions)
.then(response => response.json())
.then(data => {
console.log(data);
});