The secret API behind Gopherize.me

Ashley McNamara’s gorgeous artwork

There is a secret API lurking behind those cute little bastards, and the words on this page will tell you about it. Go.

Artwork

GET https://gopherize.me/api/artwork/

Making a GET request to https://gopherize.me/api/artwork/ (go on, give it a click) will deliver the entire artwork JSON payload for Gopherize.me.

Artwork categories on Gopherize.me

The payload contains two fields; total_combinations and categories.

Inside categories there’s an item for each of the main categories of artwork, like Body, Eyes, Shirts, etc.

Each category has a name, and an array of images that make up the options for that category.

An image also has a name, a URL and a thumbnail URL.

You can see the structure by inspecting the artwork.go file:

Rendering

Once the user has made their selection of images, you can create a rendering using the Save API, and a list of the IDs of the images that make up the Gopher.

GET https://gopherize.me/save?images={images}
  • images is the pipe-separated list of image IDs that will be combined (in the order specified) to create the final Gopher

Rendering can take a few moments, once it’s finished the endpoint will redirect to a new URL that includes the unique ID of the Gopher:

https://gopherize.me/gopher/8d784442c57fa1647259a37c277c6738b2d79d6a

If you append /json to the end of this URL, you get the data for the Gopher:

  • id — the Gopher’s unique identifier
  • images — array of the images that make up the image (in order)
  • original_url — the master image
  • url — A compressed usable image
  • thumbnail_url — A much smaller thumbnail URL
  • ctime — When it was created

Recent gophers

To see what the community have been up to, you can take a look at the most recent Gophers:

GET https://gopherize.me/gophers/recent/json

You’ll get back an object that contains a load of little Gophers in the same structure as above.

And finally, a challenge…

Ashley and I will be speaking about Gopherize.me at the UK Go Conference in August (OH NO IT’S AUGUST NOW) and we’d love to include some examples of cool/funny things people have knocked together with this API.

There might even be a little prize for our favourite.

So please tweet us @matryer or @ashleymcnamara with what you come up with.