Developer API

Integrate AI-powered face shape detection into your applications. Production-ready REST API with comprehensive documentation.

Low Latency OpenAPI 3.0 REST API
Quick Start Download OpenAPI Spec
Quick Start

Get Started in 30 Seconds

Make your first API call with a simple cURL command

Your First API Call

cURL
curl -X POST https://myfaceshape.online/api/v1/analyze \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "imageBase64": "data:image/jpeg;base64,/9j/4AAQ...",
    "language": "en"
  }'

Replace YOUR_API_KEY with your actual API key. Contact api@myfaceshape.online to get your key.

Authentication

API Key Authentication

All requests require a valid API key in the headers

Header Format

HTTP Header
X-API-Key: your_api_key_here
Header Value Description
X-API-Key string Your unique API key for authentication
Content-Type string Must be application/json
Endpoints

API Reference

Complete documentation for all available endpoints

POST /api/v1/analyze Auth Required

Analyze a face image to determine face shape. Returns detailed analysis including face shape classification, confidence score, style recommendations, and celebrity matches.

Request Body

Parameter Type Description
imageBase64 required* string Base64 encoded image with data URI prefix (max 5MB)
landmarks optional object Facial landmarks for fallback analysis (alternative to image)
language optional string Response language code. Default: "en"

* Either imageBase64 or landmarks is required.

Response

JSON Response (200 OK)
{
  "success": true,
  "data": {
    "face_shape": "oval",
    "confidence_percentage": 92,
    "archetype": "The Classic Beauty",
    "scientific_name": "Facies Ovalis",
    "shape_rarity": "Common (45% of population)",
    "detailed_measurements": {
      "forehead_classification": "average",
      "cheekbone_prominence": "moderate",
      "jawline_angle": "soft",
      "face_length_ratio": "balanced"
    },
    "style_recommendations": {
      "hairstyles": {
        "best_styles": ["Layered cut", "Side-swept bangs"],
        "styles_to_avoid": ["Severe center parts"]
      },
      "eyewear": {
        "ideal_frames": ["Aviator", "Wayfarer", "Cat-eye"],
        "frames_to_avoid": ["Oversized square frames"]
      }
    },
    "celebrity_matches": [
      {"name": "Angelina Jolie", "why_similar": "Similar bone structure"}
    ],
    "shareable_headline": "You Have The Classic Beauty Face"
  },
  "meta": {
    "processing_time_ms": 1234,
    "language": "en",
    "analysis_type": "vision"
  },
  "notice": {
    "powered_by": "MyFaceShape.online",
    "attribution": "Powered by MyFaceShape.online - AI Face Shape Analysis",
    "requirement": "Free tier usage requires a visible backlink."
  }
}
GET /api/v1/health

Health check endpoint. Use this to verify API availability. No authentication required.

JSON Response (200 OK)
{
  "status": "healthy",
  "timestamp": "2026-01-08T17:00:00.000Z",
  "version": "1.0.0",
  "api": "MyFaceShape Developer API"
}
GET /api/v1/info

Get API information including available endpoints and rate limits. No authentication required.

Rate Limits

Pricing & Limits

Choose the plan that fits your needs

Pro Tier

TBD

coming soon

  • 1,000 requests per day
  • Full analysis response
  • All 6 face shapes
  • Style recommendations
  • 10+ languages supported
  • Priority support
Contact Sales

Attribution Requirement (Free Tier)

Free tier usage requires a visible backlink to MyFaceShape.online in your application. This helps us continue providing free access to our API.

<a href="https://myfaceshape.online">Powered by MyFaceShape.online</a>
SDK Examples

Code Examples

Ready-to-use code snippets for popular languages

Python
using requests
import requests
import base64

# Load and encode image
with open("face.jpg", "rb") as f:
    image_data = base64.b64encode(f.read()).decode()

response = requests.post(
    "https://myfaceshape.online/api/v1/analyze",
    headers={
        "Content-Type": "application/json",
        "X-API-Key": "YOUR_API_KEY"
    },
    json={
        "imageBase64": f"data:image/jpeg;base64,{image_data}",
        "language": "en"
    }
)

result = response.json()
print(f"Face Shape: {result['data']['face_shape']}")
print(f"Confidence: {result['data']['confidence_percentage']}%")
Node.js
using axios
const axios = require('axios');
const fs = require('fs');

// Load and encode image
const imageData = fs.readFileSync('face.jpg');
const base64Image = imageData.toString('base64');

const response = await axios.post(
    'https://myfaceshape.online/api/v1/analyze',
    {
        imageBase64: `data:image/jpeg;base64,${base64Image}`,
        language: 'en'
    },
    {
        headers: {
            'Content-Type': 'application/json',
            'X-API-Key': 'YOUR_API_KEY'
        }
    }
);

console.log(`Face Shape: ${response.data.data.face_shape}`);
console.log(`Confidence: ${response.data.data.confidence_percentage}%`);
Error Handling

Error Codes

Common error responses and how to handle them

Status Error Description
400 Missing input No image or landmarks provided in request body
400 Image too large Image exceeds 5MB limit. Compress or resize.
401 Authentication required Missing X-API-Key header
401 Invalid API key The provided API key is not recognized
429 Rate limit exceeded Daily request limit reached. Wait for reset.
500 Analysis failed Server processing error. Retry or contact support.

Ready to Build?

Get your free API key and start integrating face shape detection into your application today.

Request API Key Download OpenAPI Spec