Using Wistia Data API with Node.js

Wistia is a video hosting company which provides video storage as well as analytics solutions to businesses.

I have been working with Wistia API for one of my clients for some time now and have used Wistia Data API extensively to work with their hosted videos. This post is about using Node.js to communicate with Wistia API servers using basic password authentication.

So, to achieve our goal, we need one dependency:

We need the npm request module to make calls to the API.

Then, to make the actual call:

Here ENDPOINT is the API endpoint like ‘account‘ or ‘medias’ and METHOD is the request method like GET or POST or DELETE depending on the endpoint type.

It will return json body with error or data. If the response sends any headers other than 200 or 201, it’s a failure.

We can work the same way with the Upload API, only in that case we will need to send POST data that is form-encoded.

I have created a small node wrapper for the API here that works with Data API.



Application developer, movie buff, occasional reader and a huge Manchester United fan.