REST API Reference
The Emuluxe REST API allows developers to automate mobile-first simulation, hardware-aware site audits, and CI/CD visual regressions. All endpoints are secured via industry-standard Bearer authentication.
Base URL
All API requests should be made to:
https://app.emuluxe.com/api
Authentication
Identify your requests using an API Token (generated in Platform Settings -> Integrations).
Authorization: Bearer <your_secure_token>
1. Simulation Engine
Manage high-fidelity hardware sessions programmatically.
POST /cli/session
Initializes a new cloud-backed simulation.
Request Body (JSON):
{
"device": "iphone-15-pro-max",
"url": "https://your-site.com",
"source": "cli"
}
Response (200 OK):
{
"success": true,
"sessionId": "b4cf...9a2",
"launchUrl": "https://app.emuluxe.com/simulate?sessionId=...",
"embedUrl": "https://app.emuluxe.com/simulate/embed?..."
}
Example (cURL):
curl -X POST https://app.emuluxe.com/api/cli/session \
-H "Authorization: Bearer $EMX_TOKEN" \
-H "Content-Type: application/json" \
-d '{"device": "pixel-8-pro", "url": "https://example.com"}'
2. Hardware Registry
Retrieve the full library of 80+ hardware fingerprints.
GET /cli/devices
Returns all compatible profiles for your license tier.
Response Example:
{
"devices": [
{
"id": "iphone-15-pro-max",
"name": "iPhone 15 Pro Max",
"os": "iOS 17",
"isLocked": false,
"size": { "w": 430, "h": 932 }
}
]
}
3. AI Site Audits
Run deep architectural and UX audits using the SimulateAI engine.
POST /ai/analyze
Compare cross-device rendering with AI-powered insights.
Request Body:
{
"globalUrl": "https://example.com",
"category": "performance",
"devices": [
{ "deviceName": "iPhone 15 Pro", "viewport": {"width": 393, "height": 852}, "html": "..." }
]
}
Response Example:
{
"success": true,
"devices": [
{
"deviceName": "iPhone 15 Pro",
"score": 92,
"summary": "Excellent mobile reflow, but detected a large LCP.",
"issues": [
{ "severity": "high", "title": "Large Image LCP", "detail": "Hero component exceeds 2.5s." }
]
}
]
}
Error Handling
Emuluxe uses standard HTTP status codes and descriptive error slugs.
| Code | Slug | Description |
|---|---|---|
401 | INVALID_TOKEN | Authentication failed. Check your API token. |
403 | SESSION_LIMIT_REACHED | Monthly session pool exhausted. |
403 | CONCURRENCY_LIMIT_REACHED | Too many active sessions for your tier. |
400 | INVALID_REQUEST | Payload validation failed (check data types). |
Usage Example (JavaScript)
const startSession = async () => {
const res = await fetch('https://app.emuluxe.com/api/cli/session', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.EMX_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
device: 'iphone-15-pro-max',
url: 'https://staging.acme.com'
})
});
const data = await res.json();
console.log('Session Launched:', data.launchUrl);
};
Next, explore Webhook Subscriptions.