API Documentation

Get started with the DermIQ skin analysis API in minutes. Upload a face image, get 15+ clinical skin metrics and 26 mask visualizations.

Base URL

https://api.dermiq.dev

Authentication

All API requests require a Bearer token. Generate an API key in your dashboard. Include it in every request header.

Authorization: Bearer diq_sk_your_key_here

POST /v1/analyze

Upload a face image for full skin analysis. Returns an analysis ID for polling. Full analysis includes all 15+ metrics and 26 mask visualizations. Consumes 1 credit per analysis.

Parameters

FieldTypeDescription
filemultipartFace image (JPEG/PNG, max 10MB)
age_overrideintegerOptional. Override detected age
gender_overridestringOptional. "male" or "female"
curl -X POST https://api.dermiq.dev/v1/analyze \
  -H "Authorization: Bearer diq_sk_..." \
  -F "file=@face.jpg"

# Response (202 Accepted):
{
  "analysis_id": "uuid",
  "status": "pending",
  "message": "Analysis queued for processing"
}

POST /v1/analyze/quick

Quick analysis — scores only, no mask visualizations. Faster processing, ideal for real-time applications. Consumes 1 credit.

GET /v1/results/:id

Poll for analysis results. Status progresses: pendingprocessingcompleted. Most analyses complete in 1.5-2.5 seconds.

Response Fields

FieldTypeDescription
statusstringpending, processing, completed, failed
result_jsonobjectAll skin metrics and analysis data
mask_filenamesstring[]List of 26 mask PNG filenames
overall_scorenumberOverall skin health score (0-100)
skin_ageintegerEstimated skin age
processing_time_msintegerProcessing time in milliseconds
# Response when completed:
{
  "id": "uuid",
  "status": "completed",
  "analysis_type": "full",
  "result_json": {
    "all": { "score": 78.5 },
    "skin_age": 32,
    "skin_tone": {
      "fitzpatrick": "III",
      "monk": "05",
      "ita_angle": 34.2
    },
    "hd_acne": { "raw_score": 91.2, "ui_score": 91.2 },
    "hd_wrinkle": {
      "whole": { "ui_score": 72.1 },
      "forehead": { "ui_score": 65.3 },
      "crow_feet": { "ui_score": 80.4 }
    },
    "hd_pore": { "ui_score": 68.9 },
    "hd_redness": { "ui_score": 82.5 },
    "hd_oiliness": { "ui_score": 55.0 },
    "hd_texture": { "ui_score": 74.3 },
    "hd_dark_circles": { "ui_score": 60.1 },
    "hd_firmness": { "ui_score": 71.8 },
    "faceshape": "Oval",
    "eye_color": { "hex": "#6B8E23", "name": "Hazel" },
    "lip_color": { "hex": "#C75B76" },
    "hair_color": { "hex": "#3B2F2F", "name": "Dark Brown" }
  },
  "mask_filenames": [
    "hd_acne_output.png",
    "hd_wrinkle_output_all.png",
    "hd_pore_output.png",
    "hd_redness_output.png"
  ],
  "overall_score": 78.5,
  "skin_age": 32,
  "processing_time_ms": 2150
}

GET /v1/results/:id/masks/:name

Download a specific mask PNG visualization. Returns the image file directly.

curl https://api.dermiq.dev/v1/results/{id}/masks/hd_acne_output.png \
  -H "Authorization: Bearer diq_sk_..." \
  --output acne_mask.png

Skin Metrics Reference

All metrics returned in result_json. Scores are 0-100 (higher = healthier).

MetricKeyDescription
Acnehd_acneAcne severity detection
Wrinkleshd_wrinkleWrinkle depth (whole, forehead, crow feet, nasolabial)
Poreshd_porePore size and visibility
Rednesshd_rednessRedness and rosacea detection
Oilinesshd_oilinessSkin oiliness level
Texturehd_textureSkin texture smoothness
Dark Circleshd_dark_circlesUnder-eye dark circle severity
Firmnesshd_firmnessSkin firmness and elasticity
Skin Ageskin_ageEstimated skin age in years
Skin Toneskin_toneFitzpatrick, Monk scale, ITA angle
Face ShapefaceshapeOval, Round, Square, Heart, etc.
Eye Coloreye_colorHex value and named color
Lip Colorlip_colorHex value
Hair Colorhair_colorHex value and named color
Overall Scoreall.scoreComposite skin health score

Rate Limits & Pricing

PlanRate LimitCreditsPrice
Free30/min10$0
Credit Pack30/min100$5 ($0.05/analysis)
Enterprise120/minCustomContact sales

Error Codes

CodeDescription
401Invalid or missing API key
403No credits remaining
404Analysis not found
413Image too large (max 10MB)
429Rate limit exceeded