API Endpoint Access URL
https://api.pixlab.io/tagimg
Get your API key and test tagimg ↗Description
The TAGIMG API endpoint analyzes an image and returns confidence-scored labels that describe the visible content. It is useful for search indexing, catalog metadata, asset organization, moderation pipelines, accessibility tooling, and internal review workflows that need fast visual classification.
Each response contains a ranked list of tags with associated confidence values, making it easy to filter low-confidence labels or combine the output with downstream rules. Developers can use the endpoint to enrich product images, organize media libraries, or feed visual metadata into business systems and developer tools.
HTTP Methods
GET, POST
HTTP Parameters
Required
| Fields | Type | Description |
|---|---|---|
img |
URL | Input image URL. If you want to upload an image directly from your app, submit a multipart/form-data POST request. |
key |
String | Your PixLab API Key ↗. You can also send the key in the WWW-Authenticate HTTP header and omit this parameter. |
POST Request Body
Use this section when you want to send the request with POST instead of a simple GET call.
Allowed Content-Types:
multipart/form-dataapplication/json
Use multipart/form-data if you want to upload an image directly from your app. Refer to the REST API code samples or the PixLab GitHub Repository ↗ for a working example. If you're using application/json, pass a public image URL or a previously stored asset reference in img. The store endpoint can help when you want to upload an image before invoking this endpoint.
HTTP Response
application/jsonThis endpoint returns a JSON response containing image tag data. The
tags array contains detected labels with their name & confidence values. Response fields include:| Fields | Type | Description |
|---|---|---|
status |
Integer | HTTP 200 indicates success. Any other code indicates failure. |
tags |
Array |
Contains detected image labels with name & confidence values.
|
error |
String |
Error details returned when status != 200.
|
Code Samples
import requests
import json
# Tag an image based on detected visual content.
# Target Image: Change to any link or switch to POST if you want to upload your image directly, refer to the REST API code samples for more info.
img = 'https://pixlab.io/assets/images/nature31.jpg'
key = 'PIXLAB_API_KEY' # Get your API key from https://console.pixlab.io/
req = requests.get('https://api.pixlab.io/tagimg',params={'img':img,'key':key})
reply = req.json()
if reply['status'] != 200:
print (reply['error'])
else:
total = len(reply['tags']) # Total tags
print(f"Total tags: {total}")
for tag in reply['tags']:
print(f"Tag: {tag['name']} - Confidence: {tag['confidence']}")
// Tag an image based on detected visual content.
// https://pixlab.io/endpoints/tagimg for more info.
// Target Image: Change to any link or switch to POST if you want to upload your image directly, refer to the REST API code samples for more info.
const img = 'https://pixlab.io/assets/images/nature31.jpg';
// Your PixLab key
const key = 'PIXLAB_API_KEY';
fetch(`https://api.pixlab.io/tagimg?img=${encodeURIComponent(img)}&key=${encodeURIComponent(key)}`)
.then(response => response.json())
.then(reply => {
if (reply.status !== 200) {
console.log(reply.error);
} else {
const total = reply.tags.length; // Total tags
console.log(`Total tags: ${total}`);
reply.tags.forEach(tag => {
console.log(`Tag: ${tag.name} - Confidence: ${tag.confidence}`);
});
}
})
.catch(error => console.error('Error:', error));
<?php
$img = 'https://pixlab.io/assets/images/nature31.jpg';
$key = 'PIXLAB_API_KEY';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.pixlab.io/tagimg?img=' . urlencode($img) . '&key=' . urlencode($key));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$reply = json_decode($response, true);
if ($reply['status'] != 200) {
echo $reply['error'];
} else {
$total = count($reply['tags']);
echo "Total tags: " . $total . "\n";
foreach ($reply['tags'] as $tag) {
echo "Tag: " . $tag['name'] . " - Confidence: " . $tag['confidence'] . "\n";
}
}
require 'net/http'
require 'uri'
require 'json'
# Tag an image based on detected visual content which means running a CNN on top of it.
# https://pixlab.io/endpoints/tagimg for more info.
# Target Image: Change to any link or switch to POST if you want to upload your image directly, refer to the REST API code samples for more info.
img = 'https://pixlab.io/assets/images/nature31.jpg'
# Your PixLab key
key = 'PIXLAB_API_KEY'
uri = URI.parse('https://api.pixlab.io/tagimg')
params = { img: img, key: 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
total = reply['tags'].length # Total tags
puts "Total tags: #{total}"
reply['tags'].each do |tag|
puts "Tag: #{tag['name']} - Confidence: #{tag['confidence']}"
end
end
Similar API Endpoints
bg-remove, nsfw, sfw, docscan, describe, query, crop, mogrify, facelookup ↗, faceverify ↗, screencapture