API Endpoint Access URL
https://api.pixlab.io/msgfit
Get Your API Key & Try MSGFIT Now ↗Description
Generate a 640x480px thumbnail optimized for use in presentation. This API endpoint is a just wrapper around thumbnail with width & height set respectively to 640 and 480.
HTTP Methods
GET, POST
HTTP Parameters
Required
Fields | Type | Description |
---|---|---|
img |
URL | Input media URL. If you want to upload your image directly from your app, submit a multipart/form-data POST request. |
key |
String | Your PixLab API Key ↗. You can also embed your key in the WWW-Authenticate: HTTP header and omit this parameter. |
Optional
Fields | Type | Description |
---|---|---|
blob |
Boolean | By default, returns a JSON Object with the output image link. Set to true to receive the raw binary data instead. |
POST Request Body
Use POST instead of GET by submitting one of these Content-Type headers:
multipart/form-data
application/json
For direct file uploads, use multipart/form-data
(see REST API code samples). For JSON, the file must be hosted elsewhere. Upload images first via store if needed.
HTTP Response
Fields | Type | Description |
---|---|---|
status |
Integer | Status code 200 indicates success, any other code indicates failure. |
link |
URL | Link to the image output which is usually stored on the pixlab.xyz storage server unless you set your own S3 keys (refer to your dashboard ↗ on how to do that). |
id |
String | Unique media ID. |
error |
String | Error message if status != 200. |
Code Samples
import requests
def fetch_image_metadata(image_url: str, api_key: str) -> None:
try:
response = requests.get(
'https://api.pixlab.io/msgfit',
params={
'img': image_url,
'key': api_key
},
timeout=10
)
response.raise_for_status()
data = response.json()
if data.get('status') == 200:
print(f"Pic location: {data['link']}")
else:
print(data.get('error', 'Unknown error occurred'))
except requests.exceptions.RequestException as e:
print(f"Error fetching image metadata: {e}")
if __name__ == '__main__':
fetch_image_metadata(
image_url='http://www.drodd.com/images15/nature31.jpg',
api_key='My_PIXLAB_API_KEY'
)
fetch('https://api.pixlab.io/msgfit?img=http://www.drodd.com/images15/nature31.jpg&key=My_PIXLAB_API_KEY')
.then(response => response.json())
.then(reply => {
if (reply.status !== 200) {
console.log(reply.error);
} else {
console.log("Pic location: " + reply.link);
}
})
.catch(error => console.error('Error:', error));
# Refer to the PixLab Github Repository at: https://github.com/symisc/pixlab for the full list of production ready code samples..
require 'net/http'
require 'uri'
require 'json'
uri = URI.parse('https://api.pixlab.io/msgfit')
params = {
'img' => 'http://www.drodd.com/images15/nature31.jpg',
'key' => 'My_PIXLAB_API_KEY'
}
uri.query = URI.encode_www_form(params)
response = Net::HTTP.get_response(uri)
reply = JSON.parse(response.body)
if reply['status'] != 200
puts reply['error']
else
puts "Pic location: #{reply['link']}"
end
Similar API Endpoints
scale, minify, magnify, crop, resize, smartresize, remap, resample, thumbnail, merge, composite, avatar, emailfit, webfit, favicon, screencapture