Wayfair Tech Blog

Welcome to Wayfair's Realtime 3d Model API

The purpose of the 3D API is to provide external developers access to the Wayfair production grade models stored as realtime 3D assets. End users are able to call API to get models and product information.

The API allows for three levels of access:

  1. Anonymous users (access to a few models to get your feet wet)
  2. Registered users (access to over 100 models for further experimentation)
  3. Enterprise users (access to a much larger list of 30k+ models)

Anonymous users

The easiest way to try out our realtime 3D model api is to use the limited version of the endpoint ( https://api.wayfair.com/v1/3dapi/models_demo) which can be accessed directly from your web browser without the need to register.

1c68d175-anonendpoint.png

The returned data will be a JSON array with objects like the following:

realtime-json1.PNG

This will return a very small list of product and model information with the following fields.

The product object

AttributeDescription
sku
string
the unique product identifier
product_name
string
the name of the product
product_description
string
the description of the product used on the product page
product_page_url
string
the url to the product page
class_name
string
product class name which can be used to group products together
sale_price
float
the sale price of the product at the time of the request
thumbnail_image_url
string
url of the thumbnail image for quick reference
model
model object
the model related to the product

The model Object

AttributeDescription
dimensions_inches
object
dimensions of the x, y, z of the model, in inches
glb
string
url to download the glb asset
obj
string
url to download the obj asset

Downloaded glb assets can be viewed in a viewer like https://sandbox.babylonjs.com/

36ce7ad3-sandboxbabylonjs.jpg

Downloaded zip files will contain the obj assets along with their textures.

Registered users

By registering you can have access to an expanded list of around 200 or so models.

You can register by making a post request to https://api.wayfair.com/v1/3dapi/sign_up?email=name@domain.com (replaced with your real email).

Since this is a post request you will not be able to run it directly in a web browser, and will require something like Postman ( https://www.getpostman.com/downloads/) to perform.

77517695-register.jpg

This in turn will send you an email with a randomly generated password that you will not be able to change.

Endpoint for registered users

The endpoint for registered users is https://api.wayfair.com/v1/3dapi/models.

To retrieve data you need to first select basic auth in Postman and then enter the email address you used to register and the password from the email.

The endpoint will then return data in the same format as the one from the anonymous endpoint seen above.

In addition the end point for registered users will also support the following parameters.

Params

ParamDescription
skus[]
optional

get specific model data by sku, for example:

?skus[]=abc123 for data on a single sku?skus[]=abc123&skus[]=def456 for data on multiple skus

page
optional

get a specific page, for example:

?page=2 for 2nd page of results

note: results are limited to 50 models per page

Enterprise users

For access to our expanded list of 3D realtime models please contact next3dapi@wayfair.com for further information.

Additional Examples

Node

realtime-node.PNG

cURL

curl --location --request GET "api.wayfair.com/v1/3dapi/models" \

--header "User-Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36"

jQuery

var settings = {

"url": "https://api.wayfair.com/v1/3dapi/models",

"method": "GET",

"timeout": 0,

"headers": {

"User-Agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36"

},

};

$.ajax(settings).done(function (response) {

console.log(response);

});

Ruby

require "uri"

require "net/http"

url = URI("https://api.wayfair.com/v1/3dapi/models")

https = Net::HTTP.new(url.host, url.port)

https.use_ssl = true

request = Net::HTTP::Get.new(url)

request["User-Agent"] = "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36"

response = https.request(request)

puts response.read_body

Python

import requests

url = 'https://api.wayfair.com/v1/3dapi/models'

payload = {}

headers = {

'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36'

}

response = requests.request('GET', url, headers = headers, data = payload, allow_redirects=False, timeout=undefined, allow_redirects=false)

print(response.text)

PHP

import requests url = 'https://api.wayfair.com/v1/3dapi/models' payload = {} headers = { 'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36' } response = requests.request('GET', url, headers = headers, data = payload, allow_redirects=False, timeout=undefined, allow_redirects=false) print(response.text)

Go

package main

import (

"fmt"

"net/http"

"io/ioutil"

)

func main() {

url := "https://api.wayfair.com/v1/3dapi/models"

method := "GET"

client := &http.Client {

CheckRedirect: func(req *http.Request, via []*http.Request) error {

return http.ErrUseLastResponse

},

}

req, err := http.NewRequest(method, url, nil)

if err != nil {

fmt.Println(err)

}

req.Header.Add("User-Agent", "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36")

res, err := client.Do(req)

defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)

fmt.Println(string(body))

}

Example Response

realtime-example-response.PNG

Public Demos

Hello WebVR demo
iOS Hello AR demo
Android Hello AR demo
Python code for processing OBJ zip files in batch

(You will need to update these to reference the new API location -see below)

Changes from previous versions of the API

Please note that the endpoint of the API has moved from https://www.wayfair.com/3dapi/models to https://api.wayfair.com/v1/3dapi/models.

Furthermore these endpoints have been deprecated:

  1. http://www.wayfair.com/v/api/three_d_model/product_information
  2. https://www.wayfair.com/v/api/three_d_model/models

This will means that you will no longer be able to retrieve product information independent of the models or retrieve models in any format except glb and obj formatted models. Please also note that Wayfair has stopped the generation of new obj formatted models, and will focus on the generation of glb formatted models in the future.
In addition the class_id filter capabilities are not part of the new endpoint as that used to belong to the product information endpoint so this means to filter for particular types of products you would now need to download the entire dataset, and then filter the JSON locally.

Tags
Share