Code Examples
Learn how to integrate Quote3D API into your application with code examples in multiple programming languages. Copy and paste these examples to get started quickly.
Note: Replace YOUR_TOKEN_HERE with your actual API token. Replace FILE_ID_HERE and QUOTE_ID_HERE with actual IDs from your API responses.
Authentication
How to authenticate your API requests
curl -X GET "https://api.quote3d.com/v2/user" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json"import requests
url = "https://api.quote3d.com/v2/user"
headers = {
"Authorization": "Bearer YOUR_TOKEN_HERE",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())const response = await fetch('https://api.quote3d.com/v2/user', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
}
});
const data = await response.json();
log.info('User data', { data });interface UserResponse {
user_id: string;
email: string;
plan: string;
quotes_used: number;
quotes_limit: number;
}
const response = await fetch('https://api.quote3d.com/v2/user', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
}
});
const data: UserResponse = await response.json();
log.info('User data', { data });File Upload
Upload a 3D model file (STL, 3MF, OBJ)
curl -X POST "https://api.quote3d.com/v2/file" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-F "[email protected]"import requests
url = "https://api.quote3d.com/v2/file"
headers = {
"Authorization": "Bearer YOUR_TOKEN_HERE"
}
with open('model.stl', 'rb') as f:
files = {'file': ('model.stl', f, 'application/octet-stream')}
response = requests.post(url, headers=headers, files=files)
print(response.json())const formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch('https://api.quote3d.com/v2/file', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE'
},
body: formData
});
const data = await response.json();
log.info('File data', { data });Public File Upload
Upload a file without authentication using upload_id
curl -X GET "https://api.quote3d.com/v2/file/upload-id" \
-H "Authorization: Bearer YOUR_TOKEN_HERE"curl -X POST "https://api.quote3d.com/v2/file/public/UPLOAD_ID_HERE" \
-F "[email protected]"// Step 1: Get upload ID
const uploadIdResponse = await fetch('https://api.quote3d.com/v2/file/upload-id', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE'
}
});
const { upload_id } = await uploadIdResponse.json();
// Step 2: Upload file (no auth required)
const formData = new FormData();
formData.append('file', fileInput.files[0]);
const uploadResponse = await fetch(`${baseUrl}/v2/file/public/${upload_id}`, {
method: 'POST',
body: formData
});
const result = await uploadResponse.json();
log.info('Upload result', { result });Quote Generation
Start an asynchronous quote calculation for a 3D model. All parameters are optional; if not provided, values from your Dashboard Slice Profile will be used. The endpoint returns a job first, then you can read the completed compact result from GET /v2/jobs/JOB_ID_HERE and the detailed stored quote from GET /v2/quotes/QUOTE_ID_HERE. The currency defaults to your dashboard settings but can be overridden (e.g., 'USD', 'EUR', 'TRY'). The filament_type parameter should match a material name from your Dashboard Material Profile.
# Minimal request - uses all settings from Dashboard Slice Profile
curl -X POST "https://api.quote3d.com/v2/file/quote/FILE_ID_HERE" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"material_config": {
"filament_type": "PLA",
"color": "White"
}
}'# Uses settings from a specific Printer Profile instead of defaults
curl -X POST "https://api.quote3d.com/v2/file/quote/FILE_ID_HERE" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"printer_id": "YOUR_PRINTER_ID_HERE",
"quantity": 1,
"material_config": {
"filament_type": "PLA",
"color": "White"
}
}'# Full request with custom parameters
# Parameters not specified will use Dashboard Slice Profile values
curl -X POST "https://api.quote3d.com/v2/file/quote/FILE_ID_HERE" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"printer_id": "YOUR_PRINTER_ID_HERE",
"quantity": 1,
"printer_config": {
"bed_size_x": 210,
"bed_size_y": 210,
"bed_size_z": 250,
"nozzle_diameter": 0.4,
"nozzle_count": 1,
"print_speed": 60,
"max_print_speed": 120,
"travel_speed": 150,
"first_layer_speed": 30,
"layer_height": 0.2,
"min_layer_height": 0.1,
"max_layer_height": 0.3,
"perimeters": 3,
"top_solid_layers": 4,
"bottom_solid_layers": 4,
"min_wall_count": 2,
"max_wall_count": 5,
"fill_density": 20,
"infill_pattern": "grid",
"support_material": true,
"support_overhang_angle": 45,
"support_density": 15,
"acceleration_print": 800,
"acceleration_travel": 1000,
"acceleration_retraction": 1000,
"jerk_print": 8,
"jerk_travel": 20,
"jerk_retraction": 5,
"min_hotend_temp": 180,
"max_hotend_temp": 260,
"min_bed_temp": 0,
"max_bed_temp": 100,
"hourly_cost": 5.0
},
"material_config": {
"filament_type": "PLA",
"color": "White",
"density": 1.24,
"diameter": 1.75,
"temperature": 210,
"print_temp_min": 190,
"print_temp_max": 230,
"bed_temperature": 60,
"bed_temp_min": 0,
"bed_temp_max": 70,
"fan_speed": 100,
"min_fan_speed": 0,
"retraction_distance": 6.5,
"retraction_speed": 25,
"price_per_kg": 20.0,
"price_per_gram": 0.02,
"support_cost_multiplier": 1.2
},
"quote_config": {
"currency": "USD",
"tax_rate": 20,
"fixed_fee": 2.0,
"energy_cost_per_kwh": 0.12,
"hollowing": "solid",
"post_processing": "standard"
}
}'import requests
# Minimal request - uses Dashboard Slice Profile settings
url = "https://api.quote3d.com/v2/file/quote/FILE_ID_HERE"
headers = {
"Authorization": "Bearer YOUR_TOKEN_HERE",
"Content-Type": "application/json"
}
data = {
"material_config": {
"filament_type": "PLA",
"color": "White"
}
}
job = requests.post(url, headers=headers, json=data).json()
print(job)
status_response = requests.get(f"https://api.quote3d.com{job['data']['statusUrl']}", headers=headers)
print(status_response.json())import requests
url = "https://api.quote3d.com/v2/file/quote/FILE_ID_HERE"
headers = {
"Authorization": "Bearer YOUR_TOKEN_HERE",
"Content-Type": "application/json"
}
data = {
"printer_id": "YOUR_PRINTER_ID_HERE",
"quantity": 1,
"material_config": {
"filament_type": "PLA",
"color": "White"
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())import requests
url = "https://api.quote3d.com/v2/file/quote/FILE_ID_HERE"
headers = {
"Authorization": "Bearer YOUR_TOKEN_HERE",
"Content-Type": "application/json"
}
data = {
"printer_id": "YOUR_PRINTER_ID_HERE",
"quantity": 1,
"printer_config": {
"bed_size_x": 210,
"bed_size_y": 210,
"bed_size_z": 250,
"nozzle_diameter": 0.4,
"nozzle_count": 1,
"print_speed": 60,
"max_print_speed": 120,
"travel_speed": 150,
"first_layer_speed": 30,
"layer_height": 0.2,
"min_layer_height": 0.1,
"max_layer_height": 0.3,
"perimeters": 3,
"top_solid_layers": 4,
"bottom_solid_layers": 4,
"min_wall_count": 2,
"max_wall_count": 5,
"fill_density": 20,
"infill_pattern": "grid",
"support_material": True,
"support_overhang_angle": 45,
"support_density": 15,
"acceleration_print": 800,
"acceleration_travel": 1000,
"acceleration_retraction": 1000,
"jerk_print": 8,
"jerk_travel": 20,
"jerk_retraction": 5,
"min_hotend_temp": 180,
"max_hotend_temp": 260,
"min_bed_temp": 0,
"max_bed_temp": 100,
"hourly_cost": 5.0
},
"material_config": {
"filament_type": "PLA",
"color": "White",
"density": 1.24,
"diameter": 1.75,
"temperature": 210,
"print_temp_min": 190,
"print_temp_max": 230,
"bed_temperature": 60,
"bed_temp_min": 0,
"bed_temp_max": 70,
"fan_speed": 100,
"min_fan_speed": 0,
"retraction_distance": 6.5,
"retraction_speed": 25,
"price_per_kg": 20.0,
"price_per_gram": 0.02,
"support_cost_multiplier": 1.2
},
"quote_config": {
"currency": "USD",
"tax_rate": 20,
"fixed_fee": 2.0,
"energy_cost_per_kwh": 0.12,
"hollowing": "solid",
"post_processing": "standard"
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())// Minimal request - uses Dashboard Slice Profile settings
const response = await fetch('https://api.quote3d.com/v2/file/quote/FILE_ID_HERE', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
material_config: {
filament_type: 'PLA',
color: 'White'
}
})
});
const job = await response.json();
log.info('Job', { job });
const statusResponse = await fetch(`https://api.quote3d.com${job.data.statusUrl}`, {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE'
}
});
const status = await statusResponse.json();
log.info('Job status', { status });// Uses settings from a specific Printer Profile
const response = await fetch('https://api.quote3d.com/v2/file/quote/FILE_ID_HERE', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
printer_id: 'YOUR_PRINTER_ID_HERE',
quantity: 1,
material_config: {
filament_type: 'PLA',
color: 'White'
}
})
});
const data = await response.json();
log.info('Data', { data });// Full request with custom parameters
const response = await fetch('https://api.quote3d.com/v2/file/quote/FILE_ID_HERE', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
printer_id: 'YOUR_PRINTER_ID_HERE',
quantity: 1,
printer_config: {
bed_size_x: 210,
bed_size_y: 210,
bed_size_z: 250,
nozzle_diameter: 0.4,
nozzle_count: 1,
print_speed: 60,
max_print_speed: 120,
travel_speed: 150,
first_layer_speed: 30,
layer_height: 0.2,
min_layer_height: 0.1,
max_layer_height: 0.3,
perimeters: 3,
top_solid_layers: 4,
bottom_solid_layers: 4,
min_wall_count: 2,
max_wall_count: 5,
fill_density: 20,
infill_pattern: 'grid',
support_material: true,
support_overhang_angle: 45,
support_density: 15,
acceleration_print: 800,
acceleration_travel: 1000,
acceleration_retraction: 1000,
jerk_print: 8,
jerk_travel: 20,
jerk_retraction: 5,
min_hotend_temp: 180,
max_hotend_temp: 260,
min_bed_temp: 0,
max_bed_temp: 100,
hourly_cost: 5.0
},
material_config: {
filament_type: 'PLA',
color: 'White',
density: 1.24,
diameter: 1.75,
temperature: 210,
print_temp_min: 190,
print_temp_max: 230,
bed_temperature: 60,
bed_temp_min: 0,
bed_temp_max: 70,
fan_speed: 100,
min_fan_speed: 0,
retraction_distance: 6.5,
retraction_speed: 25,
price_per_kg: 20.0,
price_per_gram: 0.02,
support_cost_multiplier: 1.2
},
quote_config: {
currency: 'USD',
tax_rate: 20,
fixed_fee: 2.0,
energy_cost_per_kwh: 0.12,
hollowing: 'solid',
post_processing: 'standard'
}
})
});
const data = await response.json();
log.info('Data', { data });{
"material_config": {
"filament_type": "PA12",
"density": 1.01,
"powder_bulk_density": 0.45,
"price_per_gram": 0.09,
"sls_refresh_factor": 1.15
},
"quote_config": {
"post_processing": "standard"
}
}{
"success": true,
"data": {
"jobId": "job_01HXYZ123456789",
"status": "queued",
"statusUrl": "/v2/jobs/job_01HXYZ123456789",
"estimatedTime": 120,
"createdAt": "2026-03-14T09:30:00.000Z"
}
}{
"success": true,
"data": {
"jobId": "job_01HXYZ123456789",
"status": "completed",
"progress": 100,
"createdAt": "2026-03-14T09:30:00.000Z",
"startedAt": "2026-03-14T09:30:04.000Z",
"completedAt": "2026-03-14T09:30:26.000Z",
"result": {
"user_id": "usr_123",
"status": "success",
"timestamp": "2026-03-14T09:30:26.000Z",
"quote_duration": 22,
"file_path": "/uploads/example.stl",
"currency": "USD",
"estimated_time": "2h 15m",
"estimated_time_seconds": 8100,
"filament_weight": 42.8,
"filament_cost": 1.07,
"total_price": 12.50,
"quote_id": "job_01HXYZ123456789",
"quantity": 2,
"printInfo": {
"technology": "FDM",
"printerName": "Prusa MK4",
"material": "PLA",
"color": "Black",
"layerHeight": 0.2,
"infillDensity": 20,
"infillPattern": "grid",
"wallCount": 3,
"quantity": 2,
"hollowing": "solid",
"postProcessing": "standard"
},
"modelInfo": {
"volume": 34.5,
"weight": 42.8,
"bounds": {
"x": 98.2,
"y": 44.1,
"z": 27.6
}
},
"pricing": {
"total": 12.5,
"currency": "USD",
"materialCost": 1.07
},
"geometricIntegrity": {
"isValid": true,
"description": "Model is manifold and ready for printing"
},
"adhesionRisk": {
"value": 0.12,
"needsBrim": false,
"brimWidth": 0
},
"totalTravelLength": "305.3m"
}
}
}{
"quote_id": "job_01HXYZ123456789",
"file_id": "file_123",
"result": {
"success": true,
"modelInfo": {
"fileName": "example.stl",
"fileSize": 512000,
"triangleCount": 84200,
"volume": 34.5,
"surfaceArea": 98.2,
"bounds": { "x": 98.2, "y": 44.1, "z": 27.6 },
"weight": { "model": 39.1, "support": 3.7, "total": 42.8 }
},
"printInfo": {
"printerName": "Prusa MK4",
"material": "PLA",
"color": "Black",
"technology": "FDM",
"layerHeight": 0.2,
"infillDensity": 20,
"infillPattern": "grid",
"wallCount": 3,
"postProcessing": "standard",
"hollowing": "solid",
"quantity": 2,
"layerCount": 146,
"supportVolume": 3.2,
"filamentLength": { "model": 12500, "support": 980, "total": 13480 }
},
"timeEstimation": {
"printingTime": 7940,
"totalTime": 8100,
"breakdown": {
"technology": "FDM",
"walls": 2810,
"infill": 2180,
"support": 760,
"travel": 940,
"other": 1410
},
"humanReadable": "2h 15m"
},
"pricing": {
"materialCost": 1.07,
"timeCost": 5.62,
"supportCost": 0.23,
"total": 12.5,
"currency": "USD"
},
"recommendations": [
"Use the selected orientation for lower support usage."
],
"processedAt": "2026-03-14T09:30:26.000Z",
"processingTimeMs": 22134,
"version": "2.0"
}
}Printability Check
Check if a model fits in your printer
curl -X POST "https://api.quote3d.com/v2/printability/FILE_ID_HERE" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"x": 210,
"y": 210,
"z": 250
}'import requests
url = "https://api.quote3d.com/v2/printability/FILE_ID_HERE"
headers = {
"Authorization": "Bearer YOUR_TOKEN_HERE",
"Content-Type": "application/json"
}
data = {
"x": 210,
"y": 210,
"z": 250
}
response = requests.post(url, headers=headers, json=data)
print(response.json())const response = await fetch('https://api.quote3d.com/v2/printability/FILE_ID_HERE', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
x: 210,
y: 210,
z: 250
})
});
const data = await response.json();
log.info('Data', { data });{
"user_id": "usr_123",
"file_path": "/uploads/models/gearbox-housing.stl",
"fits_printer": true,
"technology": "FDM",
"fits_without_orientation": false,
"orientation_optimized": true,
"volume": 42.15,
"surface_area": 128.4,
"triangle_count": 84200,
"model_dimensions": {
"x": 62.4,
"y": 88.1,
"z": 47.2
},
"printer_dimensions": {
"x": 210,
"y": 210,
"z": 250
},
"original_model_dimensions": {
"x": 88.1,
"y": 62.4,
"z": 47.2
},
"optimized_model_dimensions": {
"x": 62.4,
"y": 88.1,
"z": 47.2
},
"orientation": {
"rotation": {
"x": 0,
"y": 90,
"z": 0
},
"score": 0.91,
"support_ratio": 0.08,
"overhang_score": 0.94
},
"geometric_integrity": {
"is_valid": true,
"open_edges": 0,
"non_manifold_edges": 0,
"description": "Geometry is valid and watertight"
}
}Quote History
Retrieve your quote history
curl -X GET "https://api.quote3d.com/v2/quotes?offset=0&limit=10" \
-H "Authorization: Bearer YOUR_TOKEN_HERE"curl -X GET "https://api.quote3d.com/v2/quotes/QUOTE_ID_HERE" \
-H "Authorization: Bearer YOUR_TOKEN_HERE"import requests
# Get all quotes
url = "https://api.quote3d.com/v2/quotes"
headers = {
"Authorization": "Bearer YOUR_TOKEN_HERE"
}
params = {"offset": 0, "limit": 10}
response = requests.get(url, headers=headers, params=params)
quotes = response.json()
print(quotes)
# Get specific quote
quote_id = "QUOTE_ID_HERE"
quote_response = requests.get(f"{baseUrl}/v2/quotes/{quote_id}", headers=headers)
quote = quote_response.json()
print(quote)// Get all quotes
const quotesResponse = await fetch('https://api.quote3d.com/v2/quotes?offset=0&limit=10', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE'
}
});
const quotes = await quotesResponse.json();
log.info('Quotes', { quotes });
// Get specific quote
const quoteId = 'QUOTE_ID_HERE';
const quoteResponse = await fetch(`${baseUrl}/v2/quotes/${quoteId}`, {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE'
}
});
const quote = await quoteResponse.json();
log.info('Quote', { quote });Webhooks
Create and manage webhooks for real-time notifications
curl -X POST "https://api.quote3d.com/v2/webhooks" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/webhook",
"events": ["quote.completed", "quote.failed"]
}'import requests
url = "https://api.quote3d.com/v2/webhooks"
headers = {
"Authorization": "Bearer YOUR_TOKEN_HERE",
"Content-Type": "application/json"
}
data = {
"url": "https://your-app.com/webhook",
"events": ["quote.completed", "quote.failed"]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())const response = await fetch('https://api.quote3d.com/v2/webhooks', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://your-app.com/webhook',
events: ['quote.completed', 'quote.failed']
})
});
const webhook = await response.json();
log.info('Webhook', { webhook });Analytics
Get analytics and usage statistics
curl -X GET "https://api.quote3d.com/v2/analytics/quotes" \
-H "Authorization: Bearer YOUR_TOKEN_HERE"curl -X GET "https://api.quote3d.com/v2/analytics/popular" \
-H "Authorization: Bearer YOUR_TOKEN_HERE"import requests
headers = {
"Authorization": "Bearer YOUR_TOKEN_HERE"
}
# Get quote statistics
quotes_stats = requests.get("https://api.quote3d.com/v2/analytics/quotes", headers=headers).json()
print(quotes_stats)
# Get popular materials
popular = requests.get("https://api.quote3d.com/v2/analytics/popular", headers=headers).json()
print(popular)const headers = {
'Authorization': 'Bearer YOUR_TOKEN_HERE'
};
// Get quote statistics
const quotesStats = await fetch('https://api.quote3d.com/v2/analytics/quotes', { headers }).then(r => r.json());
log.info('Quotes statistics', { quotesStats });
// Get popular materials
const popular = await fetch('https://api.quote3d.com/v2/analytics/popular', { headers }).then(r => r.json());
log.info('Popular materials', { popular });Need More Help?
Check out our interactive API Playground to test endpoints directly in your browser, or explore the Core Concepts guide for detailed explanations.