Nicola Mustone

Happiness Lead @ Automattic



Unsplash API and Node.js

It’s months, maybe years, that I say I want to learn more about Node.js.

This weekend, I had some time to spend on my knowledge finally, so I started looking a bit at the Node.js wrapper built for the WooCommerce REST API.

It’s a Node.js package to interact with WooCommerce REST API.
Claudio did a great job in writing it.

I started studying its code, and almost understood everything (I still miss how to get the oauth library to work though).

At this point, I wanted to give it a try, and build something myself. I looked around for some services I use that still do not have wrappers in Node.js, and I found one that I use a lot, also for this blog: Unsplash.

What is Unsplash?

Unsplash is a website where you can find tons of free to use images. They all are in High-Resolution, so you can use them almost everywhere and for any project.
I use them as dummy data in my projects, or as featured images for this blog’s posts.

What I did not know about Unsplash, is that the developers built an API.

It’s cool, I love API! If you check their documentation you can see that there’s not a Node.js wrapper yet, but only one in PHP and one in Ruby.

What did I do?

Hand to my text editor, I started by forking our WooCommerce REST API wrapper and then I edited it to make it work with Unsplash.

The result is this one: SiR-DanieL/unsplash-nodejs

I know it’s still not perfect, this is only my first Node.js project.
Also it only works with the public API of Unsplash, which means that you can do almost everything, except for accessing and editing/adding private data such as the user profile, and private photos.

When I’ll figure out how to authenticate using their API, I’ll add that too!

If you feel you can help, please submit a PR to the project, I’ll be more than happy to merge it!

I hope this is not my first and last project in Node.js. It’s an awesome technology that deserves to be known by any developer.


Subscribe to This Blog

Receive new articles from this blog directly in your inbox! No spam guaranteed!

Join 669 other subscribers

Leave a Reply

You Might Also Like These Articles


Contribute to Improving This Blog

Did you enjoy this article? Was it helpful? Contribute to help me write more articles! The funds collected from this blog are reinvested directly into improving my skills or the blog so that I can provide more and better content!

One-Time
Monthly
Yearly

Make a one-time donation

Make a monthly donation

Make a yearly donation

Choose an amount

€1.00
€5.00
€10.00
€5.00
€15.00
€100.00
€5.00
€15.00
€100.00

Or enter a custom amount


Your contribution is appreciated.

Your contribution is appreciated.

Your contribution is appreciated.

DonateDonate monthlyDonate yearly

Don't Miss a Thing!

Receive new articles from this blog directly in your inbox!

No spam guaranteed!

Join 669 other subscribers

Continue Reading

Discover more from Nicola Mustone

Subscribe now to keep reading and get access to the full archive.

Continue reading