Calling Mashape APIs in Node.js through REST Posted 1 year ago
UPDATE (Oct 28, 2013): The post below is already outdated. To consume Mashape APIs through node.js, we recommend that you use Unirest for node.js
UPDATE (Feb 27, 2013): Please note that we have improved the way authentication keys are handled in Mashape. The header value below will be replaced by either the new Testing or Production Keys. Read this post to learn more.
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! You can head over to our Facebook page if you have questions.