Ideal House
İçeriğe atla

Mobilya Değiştirme API Belgelendirmesi#

Temel URL: https://api.ideal.house
Sürüm: v1
Güncellendi: 2026-05-21


📖 Genel Bakış#

Mobilya Değiştirme API, bir iç mekan görüntüsündeki mobilyaları yeniden stillendirir veya değiştirir. Bir kaynak görüntü ve isteğe bağlı stil yönlendirmesi gönderin, ardından görev sonucunu asenkron olarak sorgulayın.

  1. Görev oluşturma — imageUrl ve isteğe bağlı yönlendirmeyi gönderin, ardından bir taskId alın.
  2. Sonuçları sorgulama — Görev durumunu ve çıktı görüntüsünü sorgulamak için taskId kullanın.

🔐 Kimlik Doğrulama#

Tüm API istekleri, istek başlığında bir API anahtarı içermelidir.

BaşlıkDeğer
APIKEYyour_api_key_here

💰 Kredi Kesintisi#

İşlemKesilen Kredi
Mobilya Değiştirme görevi1 kredi

🎨 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:

Düz metin
GET /api/v1/style/change_furniture/getStyles
Stil Grubuİstek AlanıAçıklama
roomTypeindoorTypeIdOda tipi seçeneği
styleindoorStyleIdİç mekan stili seçeneği
elementsindoorElemIdOda elemanı seçeneği. Virgülle birleştirilmiş birden fazla seçenek kimliğini destekler, örneğin id1,id2

Her seçenek şunları içerir:

AlanAçıklama
nameÇok dilli seçenek adı
idİstek alanına geçirilecek değer
urlSeçenek için önizleme görüntüsü

📌 API Uç Noktalar#

1. Mobilya Değiştirme Görevi Oluştur#

Uç Nokta

Düz metin
POST /api/v1/changeFurniture/generate

İstek Başlıkları

BaşlıkZorunluAçıklama
APIKEY✅ EvetAPI kimlik doğrulama anahtarınız
Content-Type✅ Evetapplication/json

İstek Gövdesi

AlanTürZorunluAçıklama
imageUrlstring✅ EvetKaynak iç mekan görüntüsünün URL
promptstring❌ İsteğe Bağlıİstenen sonuç için metin yönlendirmesi
indoorTypeIdstring❌ İsteğe BağlıroomType stil seçeneklerinden oda tipi kimliği
indoorStyleIdstring❌ İsteğe Bağlıstyle stil seçeneklerinden iç mekan stili kimliği
indoorElemIdstring❌ İsteğe Bağlıelements stil seçeneklerinden oda elemanı kimliği. Virgülle birleştirilmiş birden fazla kimliği destekler, örneğin id1,id2

Yalnızca imageUrl zorunludur. Diğer tüm alanlar isteğe bağlıdır.

🖼️ Görüntü gereksinimleri: JPG/JPEG, PNG veya WebP kullanın. Her görüntü 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örüntüler, işlemden önce 6,000 × 6,000 px sınırlarına sığacak şekilde orantılı olarak otomatik olarak küçültülür. Görüntü URL, API sunucusu tarafından doğrudan erişilebilir olmalıdır.

📥 İstek Örnekleri#

cURL
bash
curl -X POST "https://api.ideal.house/api/v1/changeFurniture/generate" \
  -H "APIKEY: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "imageUrl": "https://example.com/living-room.jpg",
    "prompt": "replace the sofa with a modern warm neutral sofa",
    "indoorTypeId": "Interior Design_Interior Scene_Living Room",
    "indoorStyleId": "Interior_Interior Style_Popular_Modern Country",
    "indoorElemId": "Interior Design_Scene Elements_Living Room_Shelving,Interior Design_Scene Elements_Living Room_Coffee Table"
  }'
Java (OkHttp)
java
import okhttp3.*;

import java.io.IOException;

public class ChangeFurnitureApiExample {

    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/living-room.jpg",
                    "prompt": "replace the sofa with a modern warm neutral sofa",
                    "indoorTypeId": "Interior Design_Interior Scene_Living Room",
                    "indoorStyleId": "Interior_Interior Style_Popular_Modern Country",
                    "indoorElemId": "Interior Design_Scene Elements_Living Room_Shelving,Interior Design_Scene Elements_Living Room_Coffee Table"
                }
                """;

        Request request = new Request.Builder()
                .url(BASE_URL + "/api/v1/changeFurniture/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)
python
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/living-room.jpg",
    "prompt": "replace the sofa with a modern warm neutral sofa",
    "indoorTypeId": "Interior Design_Interior Scene_Living Room",
    "indoorStyleId": "Interior_Interior Style_Popular_Modern Country",
    "indoorElemId": "Interior Design_Scene Elements_Living Room_Shelving,Interior Design_Scene Elements_Living Room_Coffee Table"
}

response = requests.post(
    f"{BASE_URL}/api/v1/changeFurniture/generate",
    headers=headers,
    json=payload
)

data = response.json()
task_id = data.get("data")
print(f"Task ID: {task_id}")
Node.js (axios)
javascript
const axios = require('axios');

const BASE_URL = 'https://api.ideal.house';
const API_KEY = 'your_api_key_here';

async function createChangeFurnitureTask() {
  try {
    const response = await axios.post(
      `${BASE_URL}/api/v1/changeFurniture/generate`,
      {
        imageUrl: 'https://example.com/living-room.jpg',
        prompt: 'replace the sofa with a modern warm neutral sofa',
        indoorTypeId: 'Interior Design_Interior Scene_Living Room',
        indoorStyleId: 'Interior_Interior Style_Popular_Modern Country',
        indoorElemId: 'Interior Design_Scene Elements_Living Room_Shelving,Interior Design_Scene Elements_Living Room_Coffee Table'
      },
      {
        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);
  }
}

createChangeFurnitureTask();

📤 Yanıt#

json
{
  "code": 0,
  "message": "success",
  "data": 1234567890123456789
}
AlanTürAçıklama
codeinteger0 başarıyı gösterir
messagestringYanıt mesajı
datalongSonuçları sorgulamak için görev kimliği

2. Görev Sonucunu Al#

Uç Nokta

Düz metin
GET /api/v1/changeFurniture/result

İstek Başlıkları

BaşlıkZorunluAçıklama
APIKEY✅ EvetAPI kimlik doğrulama anahtarınız

Sorgu Parametreleri

ParametreTürZorunluAçıklama
taskIdlong✅ EvetOluşturma uç noktası tarafından döndürülen görev kimliği

📥 İstek Örnekleri#

cURL
bash
curl -X GET "https://api.ideal.house/api/v1/changeFurniture/result?taskId=1234567890123456789" \
  -H "APIKEY: your_api_key_here"
Java (OkHttp)
java
import okhttp3.*;

import java.io.IOException;

public class ChangeFurnitureResultExample {

    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/changeFurniture/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)
python
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/changeFurniture/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)
javascript
const axios = require('axios');

const BASE_URL = 'https://api.ideal.house';
const API_KEY = 'your_api_key_here';

async function pollChangeFurnitureResult(taskId) {
  const headers = { APIKEY: API_KEY };

  while (true) {
    const response = await axios.get(
      `${BASE_URL}/api/v1/changeFurniture/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));
  }
}

pollChangeFurnitureResult(1234567890123456789n);

📤 Yanıt Örneği#

json
{
  "code": 0,
  "message": "success",
  "data": {
    "id": 1234567890123456789,
    "status": "Success",
    "waitNumber": 0,
    "percentage": 100,
    "input": {
      "imageUrl": "https://example.com/living-room.jpg",
      "prompt": "replace the sofa with a modern warm neutral sofa",
      "indoorTypeId": "Interior Design_Interior Scene_Living Room",
      "indoorStyleId": "Interior_Interior Style_Popular_Modern Country",
      "indoorElemId": "Interior Design_Scene Elements_Living Room_Shelving,Interior Design_Scene Elements_Living Room_Coffee Table"
    },
    "output": {
      "resultUrl": "https://cdn.ideal.house/output/change_furniture_result.jpg",
      "width": 1024,
      "height": 1024
    }
  }
}

Yanıt (Görev İşleniyor / Kuyrukta)

json
{
  "code": 0,
  "message": "success",
  "data": {
    "id": 1234567890123456789,
    "status": "Processing",
    "waitNumber": 1,
    "percentage": 45,
    "input": {
      "imageUrl": "https://example.com/living-room.jpg",
      "prompt": "replace the sofa with a modern warm neutral sofa"
    },
    "output": null
  }
}

Yanıt (Görev Başarısız)

json
{
  "code": 0,
  "message": "success",
  "data": {
    "id": 1234567890123456789,
    "status": "Failed",
    "waitNumber": 0,
    "percentage": 0,
    "input": {
      "imageUrl": "https://example.com/living-room.jpg"
    },
    "output": null
  }
}

📊 Görev Durumu#

DurumAçıklama
UnprocessedGörev oluşturuldu ve kuyrukta bekliyor
ProcessingGörev şu anda çalışıyor
SuccessGörev başarıyla tamamlandı
FailedGörev başarısız oldu ve çıktı üretilmedi

Her 3-5 saniye arayla sorgulayın. API Görev Sınırı bölümüne bakın.


❌ Hata Yanıtları#

KodAdAçıklama
1011PARAM_ERRORİstek parametresi hatası
5002API_KEY_INVALIDGeçersiz veya eksik API anahtarı
9010SCAN_TEXT_ERRORİfadenin içerik incelemesinden geçememesi
9038PROHIBITED_CONTENTÜretilen görüntü yasaklı içerik barındırıyor
9051COINS_NOT_ENOUGHYetersiz kredi

Tüm yaygın hata tanımları için Hata Kodu Referansı bölümüne bakın.