REST reference
Fingerprint a cigar band
Extract a structured visual fingerprint from one or more cigar-band images.
POST
/
v1
/
ai
/
cigars
/
fingerprint
Fingerprint a cigar band
curl --request POST \
--url https://api.example.com/v1/ai/cigars/fingerprint \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-boxpressd-key: <x-boxpressd-key>' \
--data '
{
"imageUrl": "<string>",
"imageUrls": [
"<string>"
]
}
'import requests
url = "https://api.example.com/v1/ai/cigars/fingerprint"
payload = {
"imageUrl": "<string>",
"imageUrls": ["<string>"]
}
headers = {
"x-boxpressd-key": "<x-boxpressd-key>",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-boxpressd-key': '<x-boxpressd-key>',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({imageUrl: '<string>', imageUrls: ['<string>']})
};
fetch('https://api.example.com/v1/ai/cigars/fingerprint', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/ai/cigars/fingerprint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'imageUrl' => '<string>',
'imageUrls' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"x-boxpressd-key: <x-boxpressd-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/ai/cigars/fingerprint"
payload := strings.NewReader("{\n \"imageUrl\": \"<string>\",\n \"imageUrls\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-boxpressd-key", "<x-boxpressd-key>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/ai/cigars/fingerprint")
.header("x-boxpressd-key", "<x-boxpressd-key>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"imageUrl\": \"<string>\",\n \"imageUrls\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/ai/cigars/fingerprint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-boxpressd-key"] = '<x-boxpressd-key>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"imageUrl\": \"<string>\",\n \"imageUrls\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyThe fingerprint describes band colors, color roles, typography, shapes, and other visible design evidence. Use it as input to fingerprint recognition or focused band analysis.
Pass the complete returned fingerprint to
Fingerprint recognition uses stored catalog evidence and does not invoke paid model inference.
string
required
Your developer application key with the
api.ai entitlement.string
required
A unique key for this paid operation.
string
One retrievable cigar-band image URL.
string[]
Up to eight retrievable images. Supply this instead of
imageUrl.curl "https://api.boxpressd.com/v1/ai/cigars/fingerprint" \
--request POST \
--header "x-boxpressd-key: $BOXPRESSD_DEVELOPER_API_KEY" \
--header "Idempotency-Key: fingerprint-7f52b86d" \
--header "Content-Type: application/json" \
--data "{\"imageUrl\":\"$CIGAR_BAND_IMAGE_URL\"}"
POST /v1/ai/cigars/fingerprint/recognize. Do not construct or truncate the fingerprint yourself.
curl "https://api.boxpressd.com/v1/ai/cigars/fingerprint/recognize" \
--request POST \
--header "x-boxpressd-key: $BOXPRESSD_DEVELOPER_API_KEY" \
--header "Content-Type: application/json" \
--data "{\"fingerprint\":$FINGERPRINT_JSON,\"limit\":10}"
⌘I
Fingerprint a cigar band
curl --request POST \
--url https://api.example.com/v1/ai/cigars/fingerprint \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-boxpressd-key: <x-boxpressd-key>' \
--data '
{
"imageUrl": "<string>",
"imageUrls": [
"<string>"
]
}
'import requests
url = "https://api.example.com/v1/ai/cigars/fingerprint"
payload = {
"imageUrl": "<string>",
"imageUrls": ["<string>"]
}
headers = {
"x-boxpressd-key": "<x-boxpressd-key>",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-boxpressd-key': '<x-boxpressd-key>',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({imageUrl: '<string>', imageUrls: ['<string>']})
};
fetch('https://api.example.com/v1/ai/cigars/fingerprint', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/ai/cigars/fingerprint",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'imageUrl' => '<string>',
'imageUrls' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"x-boxpressd-key: <x-boxpressd-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/ai/cigars/fingerprint"
payload := strings.NewReader("{\n \"imageUrl\": \"<string>\",\n \"imageUrls\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-boxpressd-key", "<x-boxpressd-key>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/ai/cigars/fingerprint")
.header("x-boxpressd-key", "<x-boxpressd-key>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"imageUrl\": \"<string>\",\n \"imageUrls\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/ai/cigars/fingerprint")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-boxpressd-key"] = '<x-boxpressd-key>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"imageUrl\": \"<string>\",\n \"imageUrls\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body