Skip to content

Generate Mockup

Generate a device mockup from a screenshot.

POST /api/v1/mockup

Request

Headers

HeaderValueRequired
AuthorizationBearer YOUR_API_KEYYes
Content-Typeapplication/jsonYes

Body Parameters

ParameterTypeRequiredDescription
typestringYesRequest type. Must be "screenshot"
screenshotobjectYesScreenshot source configuration
screenshot.typestringYesSource type: "url" or "base64"
screenshot.srcstringYesURL or base64-encoded image data
settingsobjectNoRender settings (see below)
fastbooleanNoEnable faster rendering (lower quality)

Query Parameters

ParameterDefaultDescription
outputjsonResponse format: json or raw

When output=raw, the response is the raw image bytes instead of JSON.

Settings Object

json
{
  "settings": {
    "device": "iphone-15-pro-max",
    "appearance": {
      "backgroundColor": "#1a1a2e",
      "gradientEnabled": true,
      "gradientColor": "#16213e",
      "deviceColor": "#000000"
    },
    "deviceTransform": {
      "scale": 1.0,
      "positionY": 0,
      "rotationX": 0,
      "rotationY": 0
    },
    "shadow": {
      "enabled": true,
      "opacity": 0.5,
      "blur": 5,
      "color": "#000000"
    },
    "reflection": {
      "enabled": true,
      "intensity": 1.0,
      "environment": "studio"
    },
    "postProcessing": {
      "bloom": false,
      "vignette": false,
      "grain": false
    },
    "export": {
      "format": "png",
      "quality": 90,
      "scale": 2
    }
  }
}

See the Settings section for detailed documentation on each option:

Response

JSON Response (default)

json
{
  "success": true,
  "image": {
    "data": "iVBORw0KGgoAAAANSUhEUgAA...",
    "mimeType": "image/png",
    "width": 1920,
    "height": 1080
  },
  "duration": 2340
}
FieldTypeDescription
successbooleanAlways true for successful requests
image.datastringBase64-encoded image data
image.mimeTypestringimage/png, image/jpeg, or image/webp
image.widthnumberImage width in pixels
image.heightnumberImage height in pixels
durationnumberRender time in milliseconds

Raw Response

When ?output=raw is specified, the response is the raw image bytes with appropriate headers:

HeaderDescription
Content-TypeImage MIME type
X-Duration-MsRender time in milliseconds

Examples

Minimal Request

bash
curl -X POST https://shotprose.com/api/v1/mockup \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "screenshot",
    "screenshot": {
      "type": "url",
      "src": "https://example.com/screenshot.png"
    }
  }'

With Custom Settings

bash
curl -X POST https://shotprose.com/api/v1/mockup \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "screenshot",
    "screenshot": {
      "type": "url",
      "src": "https://example.com/screenshot.png"
    },
    "settings": {
      "device": "iphone-15-pro-max",
      "appearance": {
        "backgroundColor": "#1a1a2e",
        "gradientEnabled": true,
        "gradientColor": "#16213e"
      },
      "shadow": {
        "enabled": true,
        "opacity": 0.6
      },
      "export": {
        "format": "png",
        "quality": 95,
        "scale": 2
      }
    }
  }'

Raw Image Output

bash
curl -X POST "https://shotprose.com/api/v1/mockup?output=raw" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "screenshot",
    "screenshot": {
      "type": "url",
      "src": "https://example.com/screenshot.png"
    }
  }' \
  --output mockup.png

Base64 Input

bash
curl -X POST https://shotprose.com/api/v1/mockup \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "screenshot",
    "screenshot": {
      "type": "base64",
      "src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
    }
  }'

Error Responses

CodeStatusDescription
INVALID_REQUEST400Invalid request body or missing screenshot
MISSING_AUTH401Authorization header missing
INVALID_API_KEY401API key is invalid or revoked
SUBSCRIPTION_REQUIRED403Active Pro subscription required
RATE_LIMITED429Rate limit exceeded
RENDER_TIMEOUT504Render operation timed out
RENDER_FAILED500Failed to generate mockup

Shotprose API Documentation