दस्तावेज़ीकरण API लैंडस्केपिंग#
मूल URL:
https://api.ideal.house
संस्करण: v1
अपडेट किया गया: 2026-05-21
📖 अवलोकन#
लैंडस्केपिंग API स्रोत इमेज से बाहरी लैंडस्केप क्षेत्रों को बेहतर बनाती है या पुनर्नवीनीकरण करती है। इसमें वैकल्पिक टेक्स्ट गाइडेंस, गार्डन स्टाइल विकल्प, लैंडस्केप एलिमेंट, और मॉडल मोड का समर्थन है।
वर्कफ्लो असिंक्रोनस है:
- टास्क बनाएं —
imageUrlऔर वैकल्पिक पैरामीटर सबमिट करें, फिर एकtaskIdप्राप्त करें। - परिणामों के लिए पोल करें — टास्क स्थिति और जनरेटेड इमेज प्राप्त करने के लिए
taskIdका उपयोग करें।
🔐 प्रमाणीकरण#
| हेडर | मान |
|---|---|
APIKEY | your_api_key_here |
💰 क्रेडिट विलोपन#
[!WARNING] टास्क सफलतापूर्वक बनाए जाने पर क्रेडिट काटे जाते हैं। यदि टास्क अंततः विफल होता है, तो काटे गए क्रेडिट अपने आप वापस कर दिए जाएँगे।
अपर्याप्त क्रेडिट त्रुटि कोड9051लौटाएंगे। देखें क्रेडिट विलोपन संदर्भ।
मॉडल (modelType) | विलोपित क्रेडिट |
|---|---|
Flash | 1 क्रेडिट |
Base | 3 क्रेडिट |
Pro | 10 क्रेडिट |
यदि modelType प्रदान नहीं किया गया है, तो Base डिफ़ॉल्ट रूप से उपयोग किया जाता है।
🎨 स्टाइल विकल्प#
यह API वैकल्पिक स्टाइल पैरामीटरों का समर्थन करता है जो API स्टाइल कॉन्फ़िग एंडपॉइंट द्वारा लौटते हैं।
उपयोग करें:
GET /api/v1/style/landscaping/getStyles
| स्टाइल समूह | रिक्वेस्ट फ़ील्ड | विवरण |
|---|---|---|
gardenStyle | sceneId | गार्डन या लैंडस्केप स्टाइल विकल्प |
elements | sceneElementId | लैंडस्केप तत्व विकल्प। विराम से जुड़े कई विकल्प आईडी का समर्थन करता है, उदाहरण के लिए id1,id2 |
प्रत्येक विकल्प में name, id, और url शामिल है। संबंधित रिक्वेस्ट फ़ील्ड में विकल्प id पास करें।
📌 API एंडपॉइंट#
1. लैंडस्केपिंग टास्क बनाएं#
एंडपॉइंट
POST /api/v1/landscaping/generate
रिक्वेस्ट हेडर
| हेडर | आवश्यक | विवरण |
|---|---|---|
APIKEY | ✅ हाँ | आपका API प्रमाणीकरण कुंजी |
Content-Type | ✅ हाँ | application/json |
रिक्वेस्ट बॉडी
| फ़ील्ड | प्रकार | आवश्यक | विवरण |
|---|---|---|---|
imageUrl | string | ✅ हाँ | स्रोत लैंडस्केप इमेज का URL |
prompt | string | ❌ वैकल्पिक | वांछित परिणाम के लिए टेक्स्ट गाइडेंस |
sceneId | string | ❌ वैकल्पिक | gardenStyle शैली विकल्पों से बगीचे की शैली आईडी |
sceneElementId | string | ❌ वैकल्पिक | elements शैली विकल्पों से लैंडस्केप तत्व आईडी। विराम से जुड़े कई आईडी का समर्थन करता है, उदाहरण के लिए id1,id2 |
modelType | string | ❌ वैकल्पिक | सूची: Flash, Base, Pro। डिफ़ॉल्ट रूप से Base |
केवल
imageUrlआवश्यक है। सभी अन्य फ़ील्डें वैकल्पिक हैं।
🖼️ इमेज आवश्यकताएँ: सभी स्रोत और संदर्भ इमेजों को JPG/JPEG, PNG, या WebP का उपयोग करना होगा। प्रत्येक इमेज का आकार 20 MB से अधिक नहीं होना चाहिए, आयाम 128 × 128 px से लेकर 6,000 × 6,000 px (समावेशी) तक होना चाहिए। अधिकतम पिक्सल आयाम से अधिक इमेजों को प्रोसेसिंग से पहले स्वतः अनुपात में छोटा कर दिया जाता है ताकि वे 6,000 × 6,000 px के भीतर फिट हों। इमेज URLs का सीधा एक्सेस API सर्वर द्वारा होना चाहिए।
📥 रिक्वेस्ट उदाहरण#
cURL
curl -X POST "https://api.ideal.house/api/v1/landscaping/generate" \
-H "APIKEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "https://example.com/backyard.jpg",
"prompt": "lush modern garden with clean stone paths",
"sceneId": "Landscape Design_Landscape Style_Mid-Century Modern Pool",
"sceneElementId": "Landscape Design_Scene Elements_Natural Elements_Flower,Landscape Design_Scene Elements_Natural Elements_Ground Cover",
"modelType": "Base"
}'
Java (OkHttp)
import okhttp3.*;
import java.io.IOException;
public class LandscapingApiExample {
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/backyard.jpg",
"prompt": "lush modern garden with clean stone paths",
"sceneId": "Landscape Design_Landscape Style_Mid-Century Modern Pool",
"sceneElementId": "Landscape Design_Scene Elements_Natural Elements_Flower,Landscape Design_Scene Elements_Natural Elements_Ground Cover",
"modelType": "Base"
}
""";
Request request = new Request.Builder()
.url(BASE_URL + "/api/v1/landscaping/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/backyard.jpg",
"prompt": "lush modern garden with clean stone paths",
"sceneId": "Landscape Design_Landscape Style_Mid-Century Modern Pool",
"sceneElementId": "Landscape Design_Scene Elements_Natural Elements_Flower,Landscape Design_Scene Elements_Natural Elements_Ground Cover",
"modelType": "Base"
}
response = requests.post(
f"{BASE_URL}/api/v1/landscaping/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 createLandscapingTask() {
try {
const response = await axios.post(
`${BASE_URL}/api/v1/landscaping/generate`,
{
imageUrl: 'https://example.com/backyard.jpg',
prompt: 'lush modern garden with clean stone paths',
sceneId: 'Landscape Design_Landscape Style_Mid-Century Modern Pool',
sceneElementId: 'Landscape Design_Scene Elements_Natural Elements_Flower,Landscape Design_Scene Elements_Natural Elements_Ground Cover',
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);
}
}
createLandscapingTask();
📤 रिस्पॉन्स#
{
"code": 0,
"message": "success",
"data": 1234567890123456789
}
2. टास्क परिणाम प्राप्त करें#
एंडपॉइंट
GET /api/v1/landscaping/result
रिक्वेस्ट हेडर
| हेडर | आवश्यक | विवरण |
|---|---|---|
APIKEY | ✅ हाँ | आपका API प्रमाणीकरण कुंजी |
क्वरी पैरामीटर
| पैरामीटर | प्रकार | आवश्यक | विवरण |
|---|---|---|---|
taskId | long | ✅ आवश्यक | क्रिएट एंडपॉइंट द्वारा लौटाया गया टास्क आईडी |
📥 रिक्वेस्ट उदाहरण#
cURL
curl -X GET "https://api.ideal.house/api/v1/landscaping/result?taskId=1234567890123456789" \
-H "APIKEY: your_api_key_here"
Java (OkHttp)
import okhttp3.*;
import java.io.IOException;
public class LandscapingResultExample {
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/landscaping/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/landscaping/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 pollLandscapingResult(taskId) {
const headers = { APIKEY: API_KEY };
while (true) {
const response = await axios.get(
`${BASE_URL}/api/v1/landscaping/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));
}
}
pollLandscapingResult(1234567890123456789n);
📤 रिस्पॉन्स उदाहरण#
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Success",
"waitNumber": 0,
"percentage": 100,
"input": {
"imageUrl": "https://example.com/backyard.jpg",
"prompt": "lush modern garden with clean stone paths",
"sceneId": "Landscape Design_Landscape Style_Mid-Century Modern Pool",
"sceneElementId": "Landscape Design_Scene Elements_Natural Elements_Flower,Landscape Design_Scene Elements_Natural Elements_Ground Cover",
"modelType": "Base"
},
"output": {
"resultUrl": "https://cdn.ideal.house/output/landscaping_result.jpg",
"width": 1024,
"height": 1024
}
}
}
रिस्पॉन्स (टास्क प्रोसेसिंग / कतार में)
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Processing",
"waitNumber": 1,
"percentage": 45,
"input": {
"imageUrl": "https://example.com/backyard.jpg",
"modelType": "Base"
},
"output": null
}
}
रिस्पॉन्स (टास्क विफल)
{
"code": 0,
"message": "success",
"data": {
"id": 1234567890123456789,
"status": "Failed",
"waitNumber": 0,
"percentage": 0,
"input": {
"imageUrl": "https://example.com/backyard.jpg",
"modelType": "Base"
},
"output": null
}
}
📊 टास्क स्थिति#
| स्थिति | विवरण |
|---|---|
Unprocessed | टास्क बनाया गया है और कतार में प्रतीक्षा कर रहा है |
Processing | टास्क वर्तमान में चल रहा है |
Success | टास्क सफलतापूर्वक पूर्ण हुआ |
Failed | टास्क विफल हुआ और कोई आउटपुट नहीं बना |
हर 3-5 सेकंड पर पोल करें। देखें API टास्क सीमा।
❌ त्रुटि रिस्पॉन्स#
| कोड | नाम | विवरण |
|---|---|---|
1011 | PARAM_ERROR | रिक्वेस्ट पैरामीटर त्रुटि |
5002 | API_KEY_INVALID | अमान्य या अनुपस्थित API कुंजी |
9010 | SCAN_TEXT_ERROR | प्रॉम्प्ट ने कंटेंट समीक्षा में विफलता दर्ज की |
9038 | PROHIBITED_CONTENT | जनरेटेड इमेज में प्रतिबंधित कंटेंट शामिल है |
9051 | COINS_NOT_ENOUGH | अपर्याप्त क्रेडिट |
संपूर्ण सामान्य त्रुटि परिभाषाओं के लिए, देखें त्रुटि कोड संदर्भ।