Infralok API Documentation
Build powerful applications with our comprehensive RESTful API. Integrate house planning and design services into your platform.
Fast & Reliable
99.9% uptime SLA
Secure
OAuth 2.0 & JWT
RESTful
Standard HTTP methods
Versioned
Stable API v1
API Overview
The Infralok API provides programmatic access to our house planning and design services. Build applications that can create projects, generate floor plans, retrieve 3D visualizations, and manage the entire design workflow.
Base URL
https://api.infralok.com/v1Current Version
v1.0.0 (Stable)RESTful Design
Standard HTTP methods and status codes for predictable API behavior
JSON Responses
All responses in JSON format with consistent structure
Secure Access
API key authentication with OAuth 2.0 for user context
Rate Limiting
Fair usage with 1000 requests per hour per API key
Standard Response Format
Success Response
{
"success": true,
"data": {
// Response data here
},
"message": "Request successful",
"timestamp": "2024-01-17T10:30:00Z"
}Error Response
{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Missing required field: plot_size",
"field": "plot_size"
},
"timestamp": "2024-01-17T10:30:00Z"
}HTTP Status Codes
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request successful |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Access denied to resource |
| 404 | Not Found | Resource not found |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error occurred |
Authentication
The Infralok API uses API keys to authenticate requests. You can view and manage your API keys in your account dashboard. Your API keys carry many privileges, so be sure to keep them secure!
Security Notice
Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, or public websites.
Using API Keys
Include your API key in the request header:
curl https://api.infralok.com/v1/projects \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"OAuth 2.0 (User Context)
For actions on behalf of users, use OAuth 2.0:
curl https://api.infralok.com/v1/user/projects \
-H "Authorization: Bearer USER_ACCESS_TOKEN" \
-H "Content-Type: application/json"API Key Types
Test Keys
Use test keys for development and testing. Test mode data is separate from production and can be cleared anytime.
sk_test_4eC39HqLyjWDarjtT1zdp7dcLive Keys
Use live keys for production. All API requests with live keys will create real projects and incur charges.
sk_live_51H3PwhqLyjWDarjtT1zdp...Rate Limiting
API requests are limited to prevent abuse and ensure service quality:
Rate limit information is included in response headers:X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1642684800
API Endpoints
Complete reference for all available API endpoints
Code Examples
Ready-to-use code examples in popular programming languages
Request Examples
Create a New Project
curlcurl -X POST https://api.infralok.com/v1/projects \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Modern Family Home",
"plot_size": {
"length": 40,
"width": 60
},
"floors": 2,
"style": "modern",
"requirements": {
"bedrooms": 3,
"bathrooms": 2,
"kitchen_type": "modular",
"parking_spaces": 2
}
}'Generate Floor Plan
javascriptconst response = await fetch('https://api.infralok.com/v1/projects/proj_123/designs', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'floor_plan',
options: {
include_furniture: true,
vastu_compliant: true,
style: 'modern'
}
})
});
const design = await response.json();
console.log('Design created:', design.data.id);Calculate Quote
pythonimport requests
url = "https://api.infralok.com/v1/quotes/calculate"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"plot_size": {
"length": 30,
"width": 40
},
"floors": 1,
"plan_type": "professional",
"add_ons": ["interior_design", "structural_design"]
}
response = requests.post(url, json=data, headers=headers)
quote = response.json()
print(f"Estimated cost: ₹{quote['data']['total_cost']}")
print(f"Delivery time: {quote['data']['delivery_days']} days")List Project Designs
php<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.infralok.com/v1/projects/proj_123/designs',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
$data = json_decode($response, true);
foreach ($data['data']['designs'] as $design) {
echo "Design: " . $design['type'] . " - Status: " . $design['status'] . "\n";
if ($design['status'] === 'completed') {
echo "Download URL: " . $design['download_url'] . "\n";
}
}
?>Response Examples
Project Creation Response
JSON Response{
"success": true,
"data": {
"id": "proj_123abc",
"name": "Modern Family Home",
"status": "draft",
"plot_size": {
"length": 40,
"width": 60,
"area": 2400
},
"floors": 2,
"style": "modern",
"created_at": "2024-01-17T10:30:00Z",
"estimated_completion": "2024-01-19T10:30:00Z"
},
"message": "Project created successfully"
}Quote Calculation Response
JSON Response{
"success": true,
"data": {
"base_cost": 9999,
"add_on_costs": {
"interior_design": 15000,
"structural_design": 8000
},
"total_cost": 32999,
"currency": "INR",
"delivery_days": 3,
"valid_until": "2024-01-24T10:30:00Z",
"breakdown": {
"2d_floor_plan": 4999,
"3d_visualization": 5000,
"cost_estimation": 2000,
"add_ons": 23000
}
},
"message": "Quote calculated successfully"
}Official SDKs Coming Soon
We're working on official SDKs for popular programming languages to make integration even easier. Subscribe to our newsletter to get notified when they're available.