Description
Add your furniture into the existing room. Spacely AI furniture placement AI will place the furniture into the room, making it smooth, seamless, and realistic.
Use cases
Visual the furniture for client.
Rapid visualization furnitures for sales purposes.
Credit
1 successful furniture placement API call = 1 credit.
API
POST
https://api.spacely.ai/api/v1/generate/furniture-placement
This endpoint is used to furniture placement generate
Request Body
200: OK Response ref Id for pulling data 400: Bad Request Not Found: Requested resource not found on the server. 401: Unauthorized The API key provided was invalid or missing. 500: Internal Server Error Unexpected condition on the server preventing request fulfillment.
Example
cURL JavaScript NodeJs Go Python
Copy curl --location 'https://api.spacely.ai/api/v1/generate/furniture-placement' \
--header 'X-API-KEY: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"imageUrl": "https://storage.googleapis.com/spacely-dev/product-placement-images/2e53a5ce9664dee4a2177bee61716893.jpg",
"productImageUrl": "https://storage.googleapis.com/spacely-dev/product-placement-images/1.png",
"placement": {
"x": 310,
"y": 0,
"w": 90.0,
"h": 120.0
},
"area": {
"x": 305,
"y": 0,
"w": 100.0,
"h": 130.0
}
}'
Copy const myHeaders = new Headers ();
myHeaders .append ( "X-API-KEY" , YOUR_API_KEY );
myHeaders .append ( "Content-Type" , "application/json" );
const raw = JSON .stringify ({
"imageUrl": "https://storage.googleapis.com/spacely-dev/product-placement-images/2e53a5ce9664dee4a2177bee61716893.jpg",
"productImageUrl" : "https://storage.googleapis.com/spacely-dev/product-placement-images/1.png" ,
"placement" : {
"x" : 310 ,
"y" : 0 ,
"w" : 90 ,
"h" : 120
} ,
"area" : {
"x" : 305 ,
"y" : 0 ,
"w" : 100 ,
"h" : 130
}
});
const requestOptions = {
method : "POST" ,
headers : myHeaders ,
body : raw ,
redirect : "follow"
};
fetch ( "https://api.spacely.ai/api/v1/generate/furniture-placement" , requestOptions)
.then ((response) => response .text ())
.then ((result) => console .log (result))
.catch ((error) => console .error (error));
Copy const axios = require ( 'axios' );
let data = JSON .stringify ({
"imageUrl": "https://storage.googleapis.com/spacely-dev/product-placement-images/2e53a5ce9664dee4a2177bee61716893.jpg",
"productImageUrl" : "https://storage.googleapis.com/spacely-dev/product-placement-images/1.png" ,
"placement" : {
"x" : 310 ,
"y" : 0 ,
"w" : 90 ,
"h" : 120
} ,
"area" : {
"x" : 305 ,
"y" : 0 ,
"w" : 100 ,
"h" : 130
}
});
let config = {
method : 'post' ,
maxBodyLength : Infinity ,
url : 'https://api.spacely.ai/api/v1/generate/furniture-placement' ,
headers : {
'X-API-KEY' : YOUR_API_KEY ,
'Content-Type' : 'application/json'
} ,
data : data
};
axios .request (config)
.then ((response) => {
console .log ( JSON .stringify ( response .data));
})
.catch ((error) => {
console .log (error);
});
Copy package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main () {
url := "https://api.spacely.ai/api/v1/generate/furniture-placement"
method := "POST"
payload := strings.NewReader( `{
"imageUrl": "https://storage.googleapis.com/spacely-dev/product-placement-images/2e53a5ce9664dee4a2177bee61716893.jpg",
"productImageUrl": "https://storage.googleapis.com/spacely-dev/product-placement-images/1.png",
"placement": {
"x": 310,
"y": 0,
"w": 90.0,
"h": 120.0
},
"area": {
"x": 305,
"y": 0,
"w": 100.0,
"h": 130.0
}
}` )
client := & http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add( "X-API-KEY" , YOUR_API_KEY)
req.Header.Add( "Content-Type" , "application/json" )
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println( string (body))
}
Copy import requests
import json
url = "https://api.spacely.ai/api/v1/generate/furniture-placement"
payload = json . dumps ({
"imageUrl": "https://storage.googleapis.com/spacely-dev/product-placement-images/2e53a5ce9664dee4a2177bee61716893.jpg",
"productImageUrl" : "https://storage.googleapis.com/spacely-dev/product-placement-images/1.png" ,
"placement" : {
"x" : 310 ,
"y" : 0 ,
"w" : 90 ,
"h" : 120
},
"area" : {
"x" : 305 ,
"y" : 0 ,
"w" : 100 ,
"h" : 130
}
})
headers = {
'X-API-KEY' : YOUR_API_KEY ,
'Content-Type' : 'application/json'
}
response = requests . request ( "POST" , url, headers = headers, data = payload)
print (response.text)
Tips and tricks
After receiving the response, use this api to retrieve the data.
Support
Any question? Contact us at support@spacely.ai
Last updated 6 months ago