Analyze Design
curl --request POST \
--url https://api.example.com/api/v1/analyze \
--header 'Content-Type: application/json' \
--data '
{
"imageUrl": "<string>",
"imageData": "<string>",
"quantity": 123
}
'import requests
url = "https://api.example.com/api/v1/analyze"
payload = {
"imageUrl": "<string>",
"imageData": "<string>",
"quantity": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({imageUrl: '<string>', imageData: '<string>', quantity: 123})
};
fetch('https://api.example.com/api/v1/analyze', 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/api/v1/analyze",
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>',
'imageData' => '<string>',
'quantity' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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/api/v1/analyze"
payload := strings.NewReader("{\n \"imageUrl\": \"<string>\",\n \"imageData\": \"<string>\",\n \"quantity\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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/api/v1/analyze")
.header("Content-Type", "application/json")
.body("{\n \"imageUrl\": \"<string>\",\n \"imageData\": \"<string>\",\n \"quantity\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/analyze")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"imageUrl\": \"<string>\",\n \"imageData\": \"<string>\",\n \"quantity\": 123\n}"
response = http.request(request)
puts response.read_body{
"colors": {
"count": 123,
"dominant": [
{}
],
"pantone": [
{}
]
},
"dimensions": {
"width": 123,
"height": 123,
"aspectRatio": 123,
"hasTransparency": true
},
"recommendation": {
"technique": "<string>",
"reason": "<string>",
"complexity": "<string>"
},
"pricing": {
"dtg": {},
"screen": {}
},
"warnings": [
{}
]
}Endpoints
Analyze Design
Analyze designs for printability and get recommendations
POST
/
api
/
v1
/
analyze
Analyze Design
curl --request POST \
--url https://api.example.com/api/v1/analyze \
--header 'Content-Type: application/json' \
--data '
{
"imageUrl": "<string>",
"imageData": "<string>",
"quantity": 123
}
'import requests
url = "https://api.example.com/api/v1/analyze"
payload = {
"imageUrl": "<string>",
"imageData": "<string>",
"quantity": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({imageUrl: '<string>', imageData: '<string>', quantity: 123})
};
fetch('https://api.example.com/api/v1/analyze', 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/api/v1/analyze",
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>',
'imageData' => '<string>',
'quantity' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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/api/v1/analyze"
payload := strings.NewReader("{\n \"imageUrl\": \"<string>\",\n \"imageData\": \"<string>\",\n \"quantity\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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/api/v1/analyze")
.header("Content-Type", "application/json")
.body("{\n \"imageUrl\": \"<string>\",\n \"imageData\": \"<string>\",\n \"quantity\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/analyze")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"imageUrl\": \"<string>\",\n \"imageData\": \"<string>\",\n \"quantity\": 123\n}"
response = http.request(request)
puts response.read_body{
"colors": {
"count": 123,
"dominant": [
{}
],
"pantone": [
{}
]
},
"dimensions": {
"width": 123,
"height": 123,
"aspectRatio": 123,
"hasTransparency": true
},
"recommendation": {
"technique": "<string>",
"reason": "<string>",
"complexity": "<string>"
},
"pricing": {
"dtg": {},
"screen": {}
},
"warnings": [
{}
]
}Analyze Design
Analyze a design image for color count, complexity, and recommended print technique.This endpoint is free — no tokens required.
Endpoint
POST https://garmint.app/api/v1/analyze
Request Body
string
URL of the design image to analyze. Must be publicly accessible.
string
Base64-encoded image data. Use this for direct uploads.
number
default:"50"
Target print quantity for pricing estimates (1-10,000).
Provide either
imageUrl OR imageData, not both.Response
object
object
object
object
array
Array of potential issues detected.
Example
curl -X POST https://garmint.app/api/v1/analyze \
-H "Authorization: Bearer gm_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "https://example.com/my-design.png",
"quantity": 100
}'
const response = await fetch('https://garmint.app/api/v1/analyze', {
method: 'POST',
headers: {
'Authorization': `Bearer ${GARMINT_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
imageUrl: 'https://example.com/my-design.png',
quantity: 100,
}),
});
const analysis = await response.json();
console.log(`Recommended: ${analysis.recommendation.technique}`);
console.log(`Colors: ${analysis.colors.count}`);
import requests
response = requests.post(
'https://garmint.app/api/v1/analyze',
headers={'Authorization': f'Bearer {GARMINT_API_KEY}'},
json={
'imageUrl': 'https://example.com/my-design.png',
'quantity': 100
}
)
analysis = response.json()
print(f"Recommended: {analysis['recommendation']['technique']}")
Response Example
{
"colors": {
"count": 5,
"dominant": ["#1a1a1a", "#ff6b6b", "#4ecdc4", "#ffffff", "#2c3e50"],
"pantone": ["Black C", "Warm Red C", "3242 C"]
},
"dimensions": {
"width": 2400,
"height": 3000,
"aspectRatio": 0.8,
"hasTransparency": true
},
"recommendation": {
"technique": "dtg",
"reason": "Design has 5 colors with gradients - DTG handles color complexity well",
"complexity": "moderate"
},
"pricing": {
"dtg": {
"perUnit": 8.50,
"currency": "USD"
},
"screen": {
"perUnit": 4.25,
"setup": 125.00,
"minimumQuantity": 24,
"currency": "USD"
}
},
"warnings": [
"Design has significant transparency - consider the garment color"
]
}
Use Cases
Pre-flight Check
Run analysis before generation to catch issues:async function validateDesign(designUrl: string) {
const analysis = await analyzeDesign(designUrl);
if (analysis.colors.count > 12) {
console.warn('High color count may increase costs');
}
if (analysis.dimensions.width < 1000) {
throw new Error('Design resolution too low for quality print');
}
if (analysis.warnings.length > 0) {
console.warn('Warnings:', analysis.warnings);
}
return analysis;
}
Dynamic Pricing
Use analysis to show customers estimated costs:function calculateQuote(analysis: AnalysisResult, quantity: number) {
const { pricing } = analysis;
// Compare DTG vs Screen for this quantity
const dtgTotal = pricing.dtg.perUnit * quantity;
const screenTotal = pricing.screen.setup + (pricing.screen.perUnit * quantity);
return {
dtg: { total: dtgTotal, perUnit: pricing.dtg.perUnit },
screen: { total: screenTotal, perUnit: screenTotal / quantity },
recommended: quantity >= 50 ? 'screen' : 'dtg',
};
}
Print Technique Guide
| Technique | Best For | Color Limit |
|---|---|---|
| DTG | Full-color, photos, gradients | Unlimited |
| Screen | Simple designs, large runs | 1-8 colors |
| Embroidery | Logos, text, premium look | 1-15 colors |
| Vinyl | Names, numbers, simple shapes | 1-3 colors |
⌘I