Google Poly API Javascript and NodeJS

Google has been working on an interesting project called Poly. With Poly, you have access to hundreds of 3D objects that can be used to build VR games or with AR content. The interesting about Poly is that all of the graphics are available on demand. Think of it like Google Fonts just for 3D objects. So let’s take a look at how you can get started with Google Poly API Javascript and NodeJS bundle.

API Console

To use Google Poly, you will first need to enable the API in the Google API project console.


Google Poly API requires that you serve your content through a web server. So let’s spin up a simple NodeJS server:

const express = require('express')
const app = express()


app.listen(3000, () => console.log('Serving!'))

Notice that we are serving files in a folder called static. Where are you going to get those files? You can download the Google Poly API demo project here. Rename the basic-sample.html to index.html and move the whole demo project to  your public folder.

Change Some Stuff

It’s important that you change your API key inside of the index.html file (line 108). Also, if you want to grab another object from Poly, you can find the object id in the URL and send it to your loadAsset function (line 170). Once you run your webserver, you should get a simple 3D scene. It takes a few moments for the 3D object to download from Poly, so be patient.