Ev Dekorasyonu API Belgeleme#
Temel URL:
https://api.ideal.house
Sürüm: v1
Güncellendi: 2026-05-21
📖 Genel Bakış#
Ev Dekorasyonu API, bir iç mekan görseli için dekorasyon fikirleri üretir. İsteğe bağlı metin yönlendirmesini, referans görseli, stil seçimlerini ve model modlarını destekler.
İş akışı asenkroniktir:
- Görev oluşturma —
imageUrlve isteğe bağlı parametreleri gönderin, ardından birtaskIdalın. - Sonuçları sorgulama — Görev durumunu ve oluşturulan görseli almak için
taskIdkullanın.
🔐 Kimlik Doğrulama#
| Başlık | Değer |
|---|---|
APIKEY | your_api_key_here |
💰 Kredi Kesintisi#
[!WARNING] Görev başarıyla oluşturulduğunda krediler kesilir. Görev nihayetinde başarısız olursa, kesilen krediler otomatik olarak iade edilir.
Yetersiz kredi,9051hata kodunu döndürür. Kredi Kesintisi Referansı bölümüne bakın.
Model (modelType) | Kesilen Kredi |
|---|---|
Base | 3 kredi |
Pro | 10 kredi |
modelType sağlanmazsa, varsayılan olarak Base kullanılır.
🎨 Stil Seçenekleri#
Bu API, API Stil Yapılandırması uç noktası tarafından döndürülen isteğe bağlı stil parametrelerini destekler.
Kullanım:
GET /api/v1/style/home_decor_ideas/getStyles
| Stil Grubu | İstek Alanı | Açıklama |
|---|---|---|
spaceType | spaceStyleId | Alan veya oda tipi seçeneği |
decorStyle | homeDecorStyleId | Dekorasyon stili seçeneği |
Her seçenek name, id ve url içerir. Seçenek id değerini ilgili istek alanına geçirin.
📌 API Uç Noktaları#
1. Ev Dekorasyonu Görevi Oluşturma#
Uç Nokta
POST /api/v1/homeDecor/generate
İstek Başlıkları
| Başlık | Zorunlu | Açıklama |
|---|---|---|
APIKEY | ✅ Evet | API kimlik doğrulama anahtarınız |
Content-Type | ✅ Evet | application/json |
İstek Gövdesi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
imageUrl | string | ✅ Evet | Kaynak iç mekan görselinin URL |
referenceUrl | string | ❌ İsteğe Bağlı | Dekorasyon stili yönlendirmek için referans görsel URL |
spaceStyleId | string | ❌ İsteğe Bağlı | spaceType stil seçeneklerinden alan tipi kimlik numarası |
homeDecorStyleId | string | ❌ İsteğe Bağlı | decorStyle stil seçeneklerinden dekor stili kimlik numarası |
prompt | string | ❌ İsteğe Bağlı | İstenen sonuç için metin yönlendirmesi |
modelType | string | ❌ İsteğe Bağlı | Sayısal: Base, Pro. Varsayılan Base |
Yalnızca
imageUrlzorunludur. Diğer tüm alanlar isteğe bağlıdır.
🖼️ Görsel gereksinimleri: Tüm kaynak ve referans görseller JPG/JPEG, PNG veya WebP formatında olmalıdır. Her görsel en fazla 20 MB boyutunda olabilir; boyutları 128 × 128 px ile 6,000 × 6,000 px (dahil) arasında olmalıdır. Maksimum piksel boyutlarını aşan görseller, işleme başlamadan önce 6,000 × 6,000 px sınırlarına sığacak şekilde orantılı olarak otomatik küçültülür. Görsel URLs'ları, API sunucusu tarafından doğrudan erişilebilir olmalıdır.
📥 İstek Örnekleri#
cURL
curl -X POST "https://api.ideal.house/api/v1/homeDecor/generate" \
-H "APIKEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "https://example.com/room.jpg",
"referenceUrl": "https://example.com/reference.jpg",
"spaceStyleId": "Indoor_Living Room",
"homeDecorStyleId": "Holidays_Cozy Christmas",
"prompt": "warm seasonal decor with natural textures",
"modelType": "Base"
}'
Java (OkHttp)
import okhttp3.*;
import java.io.IOException;
public class HomeDecorApiExample {
private static final String BASE_URL = "https://api.ideal.house";
private static final String API_KEY = "your_api_key_here";
public static void main(String[] args) throws IOException {
OkHttpClient client = new OkHttpClient();
String requestBody = """
{
"imageUrl": "https://example.com/room.jpg",
"referenceUrl": "https://example.com/reference.jpg",
"spaceStyleId": "Indoor_Living Room",
"homeDecorStyleId": "Holidays_Cozy Christmas",
"prompt": "warm seasonal decor with natural textures",
"modelType": "Base"
}
""";
Request request = new Request.Builder()
.url(BASE_URL + "/api/v1/homeDecor/generate")
.addHeader("APIKEY", API_KEY)
.addHeader("Content-Type", "application/json")
.post(RequestBody.create(requestBody, MediaType.parse("application/json")))
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println("Response: " + response.body().string());
}
}
}
Python (requests)
import requests
BASE_URL = "https://api.ideal.house"
API_KEY = "your_api_key_here"
headers = {
"APIKEY": API_KEY,
"Content-Type": "application/json"
}
payload = {
"imageUrl": "https://example.com/room.jpg",
"referenceUrl": "https://example.com/reference.jpg",
"spaceStyleId": "Indoor_Living Room",
"homeDecorStyleId": "Holidays_Cozy Christmas",
"prompt": "warm seasonal decor with natural textures",
"modelType": "Base"
}
response = requests.post(
f"{BASE_URL}/api/v1/homeDecor/generate",
headers=headers,
json=payload
)
data = response.json()
task_id = data.get("data")
print(f"Task ID: {task_id}")
Node.js (axios)
const axios = require('axios');
const BASE_URL = 'https://api.ideal.house';
const API_KEY = 'your_api_key_here';
async function createHomeDecorTask() {
try {
const response = await axios.post(
`${BASE_URL}/api/v1/homeDecor/generate`,
{
imageUrl: 'https://example.com/room.jpg',
referenceUrl: 'https://example.com/reference.jpg',
spaceStyleId: 'Indoor_Living Room',
homeDecorStyleId: 'Holidays_Cozy Christmas',
prompt: 'warm seasonal decor with natural textures',
modelType: 'Base'
},
{
headers: {
APIKEY: API_KEY,
'Content-Type': 'application/json'
}
}
);
const taskId = response.data.data;
console.log('Task ID:', taskId);
return taskId;
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}
}
createHomeDecorTask();
📤 Yanıt#
{
"code": 0,
"message": "success",
"data": 1234567890123456789
}
2. Görev Sonucunu Alma#
Uç Nokta
GET /api/v1/homeDecor/result
İstek Başlıkları
| Başlık | Zorunlu | Açıklama |
|---|---|---|
APIKEY | ✅ Evet | API kimlik doğrulama anahtarınız |
Sorgu Parametreleri
| Parametre | Tür | Zorunlu | Açıklama |
|---|---|---|---|
taskId | long | ✅ Evet | Görev oluşturma uç noktası tarafından döndürülen görev kimlik numarası |
📥 İstek Örnekleri#
cURL
curl -X GET "https://api.ideal.house/api/v1/homeDecor/result?taskId=1234567890123456789" \
-H "APIKEY: your_api_key_here"
Java (OkHttp)
import okhttp3.*;
import java.io.IOException;
public class HomeDecorResultExample {
private static final String BASE_URL = "https://api.ideal.house";
private static final String API_KEY = "your_api_key_here";
public static void main(String[] args) throws IOException {
OkHttpClient client = new OkHttpClient();
long taskId = 1234567890123456789L;
Request request = new Request.Builder()
.url(BASE_URL + "/api/v1/homeDecor/result?taskId=" + taskId)
.addHeader("APIKEY", API_KEY)
.get()
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println("Response: " + response.body().string());
}
}
}
Python (requests)
import requests
import time
BASE_URL = "https://api.ideal.house"
API_KEY = "your_api_key_here"
headers = {"APIKEY": API_KEY}
task_id = 1234567890123456789
while True:
response = requests.get(
f"{BASE_URL}/api/v1/homeDecor/result",
headers=headers,
params={"taskId": task_id}
)
data = response.json()
result = data.get("data", {})
status = result.get("status")
print(f"Status: {status}, Progress: {result.get('percentage')}%, Queue: {result.get('waitNumber')}")
if status in ("Success", "Failed"):
break
time.sleep(3)
if status == "Success":
print("Result URL:", result["output"]["resultUrl"])
else:
print("Task ended with status:", status)
Node.js (axios)
const axios = require('axios');
const BASE_URL = 'https://api.ideal.house';
const API_KEY = 'your_api_key_here';
async function pollHomeDecorResult(taskId) {
const headers = { APIKEY: API_KEY };
while (true) {
const response = await axios.get(
`${BASE_URL}/api/v1/homeDecor/result`,
{
headers,
params: { taskId }
}
);
const result = response.data.data;
const { status, percentage, waitNumber } = result;
console.log(`Status: ${status} | Progress: ${percentage}% | Queue: ${waitNumber}`);
if (['Success', 'Failed'].includes(status)) {
if (status === 'Success') {
console.log('Result URL:', result.output.resultUrl);
console.log('Size:', result.output.width, 'x', result.output.height);
} else {
console.log('Task ended with status:', status);
}
break;
}
await new Promise(resolve => setTimeout(resolve, 3000));
}
}
pollHomeDecorResult(1234567890123456789n);
📤 Yanıt Örneği#
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Success",
"waitNumber": 0,
"percentage": 100,
"input": {
"imageUrl": "https://example.com/room.jpg",
"refImageUrl": "https://example.com/reference.jpg",
"spaceStyleId": "Indoor_Living Room",
"homeDecorStyleId": "Holidays_Cozy Christmas",
"prompt": "warm seasonal decor with natural textures",
"modelType": "Base"
},
"output": {
"resultUrl": "https://cdn.ideal.house/output/home_decor_result.jpg",
"width": 1024,
"height": 1024
}
}
}
Yanıt (Görev İşleniyor / Sırada)
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Processing",
"waitNumber": 1,
"percentage": 45,
"input": {
"imageUrl": "https://example.com/room.jpg",
"modelType": "Base"
},
"output": null
}
}
Yanıt (Görev Başarısız)
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Failed",
"waitNumber": 0,
"percentage": 0,
"input": {
"imageUrl": "https://example.com/room.jpg",
"modelType": "Base"
},
"output": null
}
}
📊 Görev Durumu#
| Durum | Açıklama |
|---|---|
Unprocessed | Görev oluşturuldu ve sırada bekliyor |
Processing | Görev şu anda çalışıyor |
Success | Görev başarıyla tamamlandı |
Failed | Görev başarısız oldu ve çıktı üretilmedi |
Her 3-5 saniyede bir sorgulama yapın. API Görev Sınırı bölümüne bakın.
❌ Hata Yanıtları#
| Kod | Ad | Açıklama |
|---|---|---|
1011 | PARAM_ERROR | İstek parametresi hatası |
5002 | API_KEY_INVALID | Geçersiz veya eksik API anahtarı |
9010 | SCAN_TEXT_ERROR | Komut içerik incelemesinden geçemedi |
9038 | PROHIBITED_CONTENT | Oluşturulan görsel yasaklı içerik barındırıyor |
9051 | COINS_NOT_ENOUGH | Yetersiz kredi |
Tam ortak hata tanımları için Hata Kodu Referansı bölümüne bakın.