Join For Free

The Mashape API Posted 1 year ago

The long wait is over!  The Mashape API is here!

The Mashape API lets you query and retrieve API and user information from Mashape. With close to 2000 APIs in catalog, this opens up tons of possibilities for developers to create exciting applications.  Here’s the Mashape API test console in action:

We have also released a Chrome extension to demonstrate what you can do with the Mashape API. You can get it here.

We hope to see what you can do with the API.  Let us know and send us a note at if you have ideas, comments, or have created apps!

Spotify Web API on Mashape Posted 1 year ago

We are happy to announce that Spotify has added their Spotify Web API in Mashape!


Spotify is the most popular music streaming service that provides content from a range of major and independent record labels.

If you’re a developer looking to get a treasure trove of music-related metadata (artists, albums, tracks), you can give the the Mashape test console a spin and “preview” the responses from the “lookup” and “search” endpoints of the Spotify Web API.

Here’s a quick screencast demonstrating the API in Mashape:

We hope that this will make it easier and faster for you to consume the Spotify Web API, through Mashape!

Face Recognition using Javascript and Mashape Posted 1 year ago

This is a tutorial on how you can use the Face Recognition API in a web application using Javascript.  The Face Recognition API makes it ridiculously easy to add face recognition capabilities to your app, whether it’s web, mobile, etc.  We will use photobooth.js to take pictures from our webcam. (Make sure you have one in your machine or plug one.)

There are 2 main things to remember when using the Face Recognition API.  You need to:

A.  ”Train” the Face Recognition API, which means uploading a bunch of pictures that will constitute the “database” from which pictures will be recognized.

B.  ”Recognize” a picture by uploading it to the Face Recognition API.

These will be the two main parts of this tutorial.  Let’s get started!

Train the Face Recognition API

1.  Get a Mashape account and key.  If you don’t have an account yet, you sign up here.  You need a Mashape account because we will use Mashape’s Test Console to upload pictures to Face Recognition to build our database.  Once you have signed up, you will be taken to your Mashape dashboard where you will have access to your Mashape keys,  as in the picture below:


2.  Go to the Face Recognition API page.  This page shows the API endpoints on the left, and their corresponding documentation and test console to the right.  

What we’re interested right now is in creating an album where we can upload pictures to “train” the service.  You can create an album through the endpoint called “Create Album”.  You can click here to directly navigate to it in the page.

Think of a unique album name and hit “Test Endpoint”.  This will call the endpoint and return a response similar to below:


The response above indicates that we have successfully created an album in Face Recognition, and that we should remember/keep the values album and albumkey because we will be using it throughout the tutorial to refer to this album.  (Note: It’s probably obvious by now, but everything is hosted on the cloud - no need to maintain an on-premise setup).

3. Let’s now start “training” this album using the Train Album endpoint.  As you can see, one of the parameters in the Train Album endpoint requires us to upload pictures:


To take pictures in our webcam, we will use photobooth.js.  Click here to access the demo page where we will take our pictures.  We will also save the pictures in our drive so we can use them to upload/train the album later.

Note that photobooth.js will ask for our permission to use the webcam.  Just click “Allow”.


To take pictures, just click the camera icon to the right of the photo canvas.


It will take a picture every time you click. Take one picture and save it to your drive by right-clicking “Save Image As”.  Take three pictures of yourself and save it to your drive.  Then take one other picture of your buddy, as we will need this to differentiate the “entryid” in our album as required by the Train Album endpoint.

Once you’re done taking pictures, upload them to Train Album endpoint by filling out the required parameters, changing the “entryid” field for each person we want to upload (e.g. Entryid “Chris1” for Chris’ pictures and another entryid “Hazel1” for Hazel’s pictures.


You can upload one picture for each call so you have to do this for each upload.

(Note: You can also provide URLs pointing to your images.  For this tutorial we’ll use fresh hot pictures instead.  The API works well if you have a variety of pictures from different people, so as to provide more contrast when recognizing pictures later.

Also, remember that everything you do in the Test Console can be programmatically accessed using Mashape’s different client libraries.)

Here’s a response example when you upload a picture:


Once you’ve done this for all your pictures, it’s time to “Rebuild” them.

4. The "Rebuild Album" endpoint only requires your album and albumkey.  It will also make sure you have uploaded enough pictures and entries to make a recognition.  Hit “Test Endpoint” to rebuild the album.  A successful response would look like this:


Let’s now move on to the 2nd main section of this tutorial which is to recognize a picture based on the album we have created in Face Recognition.

Recognize a Face using the Face Recognition API

In this section we will refer to a web app we have put up in and explain how it works.  You can access it here.


(Screenshot of the Face Recognition sample code in

The main parts of this section will delve on 1) taking a webcam picture using photobooth.js, and 2) uploading the picture to the Recognize endpoint.  Let’s lay out the source code here so we can easily refer to each line code in explaining the two steps above.  

Line 1: Use jQuery to initialize stuff when web page is “ready”

Line 3:  We are using the photobooth.js library to access the webcam with HTML5.  This single line instantiates the photobooth object on the “#photo” element and sets up the event handler when the camera icon is clicked.  It will execute the code inside the anonymous function when the camera icon is clicked.

Line 4 and 12:  photobooth returns a “data url” that represents the image we took with the camera.  We need to convert this into a binary blob, a format fit for uploading.

Line 5 - 6:  We just want to make sure that we got an image, and size is not zero.

Line 7 - 28:  We will now upload the picture to the Recognize endpoint.

Line 29 - 33:  This sets up a FormData that would hold the query parameters needed by the Recognize endpoint.  This is similar to the parameters that you see in the Test Console for the Recognize endpoint.

Line 35 - 43:  We set up a jQuery “ajax” call for Recognize endpoint with the required parameters:

- URL (the Face Recognition API endpoint in Mashape), type (HTTP POST), data (the form data parameters), headers (Mashape auth headers).

Line 44 - 48:  When we get a response back from the endpoint, display it with an alert.

The rest of the code required for this application (HTML, CSS) can be viewed in jsfiddle here.


The application is straightforward;  you need to plug in your Mashape key, and two other parameters from Face Recognition - album and album key.  Whenever you take a picture, it gets uploaded using the Face Recognition Recognize endpoint, and we display the result back.

A response would look similar to this:

As you can see, the response includes coordinates for the eyes, nose, mouth, gender, smile, and recognition based on the pictures that were “trained”.  Obviously, the more pictures you have (of you and other people), the better the recognition.

We hope that this tutorial helps you understand the Face Recognition API better.  We’d like to see your own Face Recognition projects.  Send us an email at!

Another Google API bites the dust. Posted 1 year ago

In a shocking announcement Google has announced the end of Google Reader after 8 years.

So, on July 1, 2013, we will retire Google Reader. Users and developers interested in RSS alternatives can export their data, including their subscriptions, with Google Takeout over the course of the next four months.

You can certainly appreciate the reasoning, it apparently wasn’t a popular product and drained valuable resources that could be used on products that actually turn a profit. Still many people are grieving the loss of a beloved service, while others believe with Google out of the way innovation will be much more likely occur.

The problem many developers face is that they depend on the unofficial Google Reader API to power their own apps and software. This isn’t the first time Google has killed a widely used API, as many developers experienced when they shut down their unofficial weather API unexpectedly last August.

To all the developers relying on Google Reader to power your own apps and software, all hope is not lost. Already many different people are working on providing a replacement for Google Reader, including an open source clone of their API. In then end it seems that the silver lining in all of this will be a more diverse ecosystem freeing developers from being tied down to a single power like google.  The future looks bright indeed.

About The Author

Montana Flynn has been making the web a better place his entire adult life. Recently hired as the Growth Hacker here at Mashape where he will be conducting human experiments in order to better serve and attract API developers and consumers. 

Mashape Sample Code for executing an AJAX request using jQuery Posted 1 year ago

This code snippet below is CORS-enabled so you don’t have to worry about cross-domain requests.

How a Side-Project API Became Profitable Posted 1 year ago

Jacob Perkins, author of Python Text Processing with NLTK 2.0 Cookbook, and creator of Python NLTK Demos and APIs, recounts in this post how he got started in building APIs, and before his discovery of Mashape:

I wasn’t sure if anyone would actually use the API, but I knew the best way to find out was to just put it out there. So I did, initially making it completely open, with a rate limit of 1000 calls per day per IP address. I figured at the very least, I might get some PHP or Ruby users that wanted the power of NLTK without having to interface with Python. Within a month, people were regularly exceeding that limit, and I quietly increased it to 5000 calls/day, while I started searching for the simplest way to monetize the API

It is a good read with with a bit of Mashape history thrown in as well :)  If you’re a developer looking for monetization options for your API, Jacob’s story might just be the example  you’re looking for.  So check it out.

You can check out the Text-Processing API here.

We are moving to Tumblr Posted 1 year ago

We’ve done about 200+ posts in Posterous so far.  Now that it’s closing down, we have decided to move to Tumblr.

We’re still in the process of moving so please bear with us.  But do send us some comments and suggestions on what you’d like to see (or would rather not see) in our posts :)  You can reach us through Facebook, Twitter, or

February Updates! Posted 1 year ago

Introducing API Issues, API Terms, Embed Button, and more!

We participated in a lot of developer events and pushed out important updates:

P.S. If you are around South Park, feel free to stop by for a beer, talk about APIs, tips on APIs, food, etc. Here’s what we look like in our Hacker House:


API Terms & Conditions Page in Mashape Posted 1 year ago

You can now set up a Terms & Conditions page for your API in Mashape

(Example above from IDlight)

To write the Terms & Conditions page for your API, just go to your API Admin page and click on the “Terms and Conditions” tab:

Remember to set the Visibility to “Public” then hit Save.  It would then appear in your API profile page under “Terms and Conditions”

More startups will essentially be “Data Startups” Posted 1 year ago

Below is an excerpt from the Data2.0 newsletter article called 4 Trends in 2013 Data Innovation featuring DeveloperWeek winner Callinize

3. More startups will essentially be “Data Startups”Callinize, the winner of our DeveloperWeek 2013 hackathon last February 1-3, is actually a mashup of 4-6 different data sources like Mashape, Salesforce, and RapLeaf. The end user might not know it, but the power of Callinize to grab intelligence on whoever is calling you (before you answer the phone) is based on the fact that Callinize is really a mashup of API’s. It’s a data startup.

Across the landscape of all web and mobile startups, the new competitive edge is the ability to leverage more 3rd party API’s. A few companies that either provide API’s or consume multiple API’s have recently received funding in the past 12 months including Identified (+$21m), Stormpath ($9.7m), and Adaptly (+$10.5m) to name a few.More startups will be “data startups” (companies whose chief asset value is based on what they can do with API’s) because the API ecosystem is the new competitive edge. If you utilize 3rd party API’s (or provide 3rd party API’s) better than your competitors, you will win. And investors are recognizing that.