API Reference
Complete API documentation for DigitalSkeleton
Base URL
All API requests should be made to:
https://your-domain.com/api/
Authentication
Currently, DigitalSkeleton operates without authentication for public use. For enterprise deployments, consider implementing API keys:
Authorization: Bearer YOUR_API_KEY
Endpoints
POST /analyze
Analyze a website's PWA readiness and return comprehensive assessment.
Request Body:
{
"url": "https://example.com"
}
Response:
{
"metadata": {
"title": "Example Website",
"description": "Website description",
"icon_url": "https://example.com/icon.png",
"theme_color": "#000000"
},
"pwa_assessment": {
"is_pwa_ready": false,
"pwa_score": 65,
"checks": {
"https": {
"passed": true,
"details": "Website uses HTTPS"
},
"manifest": {
"passed": false,
"details": "No web app manifest found"
},
"service_worker": {
"passed": false,
"details": "No service worker detected"
}
},
"recommendations": [
{
"title": "Add Web App Manifest",
"description": "Create a manifest.json file",
"action": "Add manifest with required fields",
"priority": "high"
}
]
}
}
HTTP Status Codes:
200
- Success400
- Invalid URL format500
- Analysis failed
POST /build
Generate app package for specified platform.
Request Body:
{
"url": "https://example.com",
"package_type": "apk"
}
Package Types:
apk
- Android Studio projectipa
- Xcode projectmsix
- Visual Studio projectappx
- UWP project
Response:
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "pending",
"package_type": "apk",
"progress_url": "/progress/550e8400-e29b-41d4-a716-446655440000"
}
GET /progress/{job_id}
Check build progress and get download link when ready.
Response (In Progress):
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"progress": 45,
"message": "Generating Android project files..."
}
Response (Completed):
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"progress": 100,
"download_url": "/download/550e8400-e29b-41d4-a716-446655440000",
"filename": "ExampleApp_android_project.zip",
"file_size": "2.4 MB"
}
GET /download/{job_id}
Download the generated app package.
Response:
Binary file download with appropriate content headers.
Content-Type: application/zip
Content-Disposition: attachment; filename="project.zip"
POST /generate-pwa
Generate PWA files and setup instructions for non-PWA websites.
Request Body:
{
"url": "https://example.com"
}
Response:
{
"job_id": "660e8400-e29b-41d4-a716-446655440001",
"pwa_files": {
"manifest.json": "{ \"name\": \"Example App\", ... }",
"sw.js": "// Service Worker code...",
"index.html": ""
},
"instructions": [
"Upload manifest.json to your website root",
"Upload sw.js to your website root",
"Add meta tags to your HTML head section"
]
}
Error Handling
All API errors return a consistent format:
{
"error": "Error message description",
"code": "ERROR_CODE",
"details": {
"field": "Additional error context"
}
}
Common Error Codes:
INVALID_URL
- URL format is invalidUNREACHABLE_URL
- Website cannot be accessedUNSUPPORTED_PACKAGE_TYPE
- Invalid package typeBUILD_FAILED
- Package generation failedJOB_NOT_FOUND
- Invalid job ID
Rate Limits
Current rate limits for public use:
- Analysis: 10 requests per minute
- Build: 5 requests per minute
- Download: No limit
Rate limit headers are included in responses:
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 8
X-RateLimit-Reset: 1640995200
SDK Examples
JavaScript/Node.js
const response = await fetch('/analyze', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com'
})
});
const data = await response.json();
console.log(data.pwa_assessment);
Python
import requests
response = requests.post('/analyze', json={
'url': 'https://example.com'
})
data = response.json()
print(data['pwa_assessment'])