Calling Mashape APIs in Node.js through REST

Hi guys, here’s a short example on how you can call APIs in Mashape through Node.js / REST.  It’s pretty straightforward.  You just need to remember that you need to make a secure call using https://, and have a generated Mashape Authorization header and plug it in the header parameter.

(You can download this source code from Github)

And then run the node.js script like so..

You would get a nice JSON reply that you can start parsing.

If you’re new to Node.js, you can check out their site at http://nodejs.org/ .  You can get either the source code or binaries for Node.js there.

We’d like to invite node.js developers out there to share with us any applications that you are planning/or have created using the APIs in Mashape.  There are tons of APIs to try!  Email me at chris@mashape.com if you have questions.

Happy coding!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s