We’re rolling out a new detailed status report for API Providers. It gives you a second-by-second report on your API health, as pinged from the Mashape proxy.
The goal is to give API providers a high-fidelity report on how their API is doing at minute intervals.
You may remember sometime back, we also rolled out the Status Snapshot Display for APIs. This a yet another continuation of our commitment to provide the best API report.
Currently, it can only be accessed through the email notification you get when your API is down. We would love to hear your feedback on where we can place this report in Mashape. Send us a note at support@mashape,com
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 email@example.com if you have ideas, comments, or have created apps!
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!
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 jsfiddle.net and explain how it works. You can access it here.
(Screenshot of the Face Recognition sample code in jsfiddle.net)
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.
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 firstname.lastname@example.org!
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 grievingtheloss of a beloved service, while othersbelieve 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 manydifferentpeople 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.
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.
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 email@example.com
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.
Codecademy is a platform that provides a way for developers to teach; and would-be developers to learn how to code. It provides course-creation tools, as well as “badges” (awards) for developers when they finish certain exercises.
In our effort to improve the way keys are handled in Mashape, we have changed the naming and more importantly the way keys are used in Mashape. This is an important change so we recommend that you read on.
This change is immediate and is reflected NOW in your Mashape account (e.g. Dashboard, Mashape keys, test console, client libraries, etc)
After receiving feedback regarding the trouble and complexity of generating an authorization hash from your Mashape private and public keys, we decided to change and improve the way these keys are interpreted and generated. One of the problems that arose from generating a hash is when someone intercepts it. It will compromise your Mashape account in its entirety, leaving all your API access open to anyone who may have intercepted the hash.
To address this problem, we have removed the requirement to generate any hash. Instead there will be two main keys for you to manage:
Universal key Testing - used for testing and will have access to every API
Restricted keys Production- used in production, and can be restricted to consume only a specified group of APIs. (In theory, you can create one restricted key for each API).
Both Testing and the Production keys can be re-generated anytime.
Below are the areas in Mashape where you will see the changes:
Client library (Ruby example below):
Client library download
Where did my Public and Private Mashape keys go?
To ensure a smooth transition, your original Public and Private keys will still work in your applications. We would however recommend that you start using the new Universal and Restricted keys moving forward.
We would love to hear your feedback. Please email us at firstname.lastname@example.org for any comments and suggestions.
After an intense 24-hour coding stint that started 16th Feb for the MusicHackDay SF 2013 at the Tokbox office, we have picked our Mashape category winner, “Nightingale”, for mashing up a bunch of APIs from Mashape, including Text Processing, Musixmatch, and Word Cloud Generator, to name a few. Congratulations to Nightingale developer, Vivek Agrawal, for winning the $500 prize from Mashape! (He was also awarded the best Musixmatch category :)).
Nightingale creates a song playlist based on your tweets. (e.g. I got a bunch of “Flo Rida” songs after Nightingale analyzed my Twitter account). If you want to try it out, you can head over to http://nightingale.aws.af.cm/
Here’s Vivek talking about Nightingale, and Loreto Parisi (from Musixmatch) inviting developers to check out the Musixmatch API.
One other team that used the Mashape / MusixMatch is “Sing Along With Me”. It gives you a “premier online karaoke experience” delivered through the web. This is also one of our favorite hacks because we love karaoke ourselves (haha). It also matches the background visuals with the mood of the song. Nice!
Here’s Yih Sun, Angie, Le Wei, and Ryan walking us through Sing Along With Me.
Congratulations to all the 66 teams in MusicHackDay! We are looking forward to the next MHD!
In the meantime, below are the UStream demo start times of all the hacks in MusicHackDay so you can watch and jump to your favorite hacks. Enjoy!
I tried to finish my homework that night. Physics was my cup of tea. It would have been a 5-minute endeavor to compute the gravitational attraction force between the Sun and Earth, but something otherworldly happened that afternoon.
I was sitting by the cafe minding my own business, sipping cappuccino in tiny amounts (to prolong my stay), then this girl came in. The weather was just perfect, with the afternoon sun putting her on a spotlight like she was meant to step on it and just shine. Her face looked familiar, I didn’t quite place it but I recognize it from somewhere. I won’t go into details. Let’s just say that at that moment, I felt like I had already won the lottery. It was weird but I knew I had to do something.
She went up to the counter and stopped abruptly to check the menu. At that point my mind was already giving me a glimpse of what was supposed to happen. I would come up to her and say “They have good cappuccino here, you should try it.”
She’d paused with an astonished expression, and after digesting it in for a bit, will play along, and reply with, “Is that so? Do you work here?”. With that she would smile, and I would be thinking if it was sarcasm or a challenge. I’m not very good with analyzing words. They get in the way.
Snap! She’s into Star Wars. You don’t get these chance occurrences often, no way. Maybe some people do, but not for me. I’ve been holed up in my own world for too long, sipping cappuccino minding my own business. I would have been happy computing gravitational forces between celestial bodies.
"They should have kept George," she said.
"Pardon?" must’ve been what came out of my mouth. It was a noob moment, I know.
"George Lucas? This Star Wars is being directed by J.J. Abrams I heard. Uhm, sorry you’re probably not into these things."
(Photo courtesy of ThomasBonte Music Hack Day Flickr set)
Music Hack Day is an international 24-hour event where programmers, designers, and artists come together to conceptualize, build and demo the future of music. Software, hardware, mobile, web, instruments, art - anything goes as long as it’s music related.
Check out these hacks from last year’s Music Hack Day. Do you think you’ve got what it takes? Then register here! We’ll announce our Mashape API partners soon!
We would like to congratulate the PlayAlong team for winning the Mashape category at the recent TVHACKFEST Hackathon @ Moscone Center West hosted by Apps World! Here’s Jason Townes French talking about their game PlayAlong and how he used the Trivia API in Mashape.
According to Jason, he has more games in store for us and he’s looking to add more Mashape APIs in them :) Congratulations again PlayAlong!
We would also like to recognize the following teams that incorporated/conceptualized Mashape APIs in their hacks:
Metamaps.cc/StoryGraph is a discovery platform with awesome graph visualization. In this video, Ishan Shapiro explains what Metamaps is, and how Mashape could be integrated in.
ConnectedKiosk uses a QR Code API in Mashape to connect mobile phones with ads shown on the kiosk e.g. a kiosk showing a restaurant allows a passerby to book a reservation by snapping the QR code which then opens to OpenTable.
Movie Night is an app that helps people find movies to watch using a fun game system. (The team ended up using Mashape’s auto-generated libraries and not the Mashape proxy - we’re just glad we can help ;))
We just released a new section in the API profile page called “Issues” that would allow developers to report an issue or open a discussion with the API owner regarding his/her API.
Developers can open an API issue by navigating to “Issues” on the left-hand side panel of the API profile page, and clicking on “New Issue” button on the upper-right hand corner.
You can then proceed to type in the Title and Description/Comment for your issue and click “Submit” when done. At this point, the API owner will see that the “Issues” navigation panel section will be highlighted in gray, with a number representing the number of issues that are currently open.
The discussion can then proceed with several options:
Developers can "Like" the issue (A useful indicator to API owners that it is a common issue that needs to be addressed)
Developers can add Comments to provide other useful information for the API owner
The developer or the API owner can choose to Close the issue if it has already been addressed. Closed issues can be tracked inside the Closed tab for historical purposes.
Developers can Un-follow the Issues if you want to opt out of the notifications from the comments.
We hope that this new feature will encourage a healthy and robust discussion between API owners and consumers/developers. This will result to better APIs, and therefore a stronger API Marketplace.
As sales people beholden to our clients, we’ve all been caught off-guard at one point when we receive an unannounced call from a certain client or customer. The last thing you want to say is “Who is this?” with a tone reserved for telemarketers. It’s a classic scenario that we all hope to avoid.
Callinize solves all that by telling you who’s calling and providing you contextual information pulled from CRM systems.
*UPDATE: Check our Hackerleague Sponsor site here for ideas on APIs*
Hot on the heels of the DeveloperWeek Hackathon, we are again getting ourselves involved in another hackathon - the AppsWorld 2013 Hackfest.tv Hackathon, happening this Thursday Feb 7 - 8th in The Moscone Center. We are giving away a $500 prize for the best use of APIs in Mashape.
The aim of TV Hackfest is to provide a range of TV technologies, SDKs, and APIs as well as briefs and competitions - to developers, designers, agencies, creatives, and entrepreneurs to build, design, and show how future video entertainment could be delivered within an interactive multi-screen environment.
One of the top requests we get from API providers in Mashape is to add a section where they can go beyond just plain text when providing more in-depth information about their API (e.g. introduction, usage guidelines, sample codes, etc). This requires a level of formatting that simply cannot be achieved with just plain text.
Also, having information in one place as opposed to having several browser tabs open to read through the API usage information, can be quite a time-saver.
You can check the example API above here. Notice on the left navigation panel that a “Getting Started” section has been added.
To add a “Getting Started” section for your own API, click on the “Admin” button in your API profile page and navigate to the “Getting Started” tab, like below:
Don’t forget to set your Markdown to Public once you’re done.
We hope that you will find this feature very useful when communicating the intended use for your API to developers. We highly encourage everyone to try it out and provide us feedback on your experience with it. Send us a message in Facebook, Twitter, or email@example.com
We just launched a small yet very important feature - an email notification to the API provider when the API is down.
This feature is in line with our commitment to provide API providers with the necessary tools to keep them on top of things, and be able to react quickly to their developers when the API is down (e.g. send out a message to acknowledge the downtime, issue out a fix, etc).
If you wish to turn off the notification for your API, you can do so by navigating to your API Admin -> Settings:
The first annual DeveloperWeek 2013 Conference combines a 4-day educational conference, technology-specific app development contests, developer tech exhibitors, startup lightning pitches, and keynote talks from the top engineers across app development, data science, and mobile deployment.
What Mashape-related activities should I look forward to in DeveloperWeek?
We’d love for you to join us in the DeveloperWeek Hackathon which is a 43-hour app-building contest from Friday February 1st until Sunday February 3rd, and also happens to be the official kick-off of DeveloperWeek. There will be a Mashape prize category and we will be down there to help you out with your code :)
Ok I’m excited! How do I get the Complimentary Passes?
We have a limited set, but getting a Complimentary Pass is easy - 1) tweet about why @Mashape should give you a @DeveloperWeek complimentary pass, and 2) let us know by sending a Mashape message to user “ismaelc”. The best tweets will win the complimentary passes, until we run out! (Note: To send a Mashape message, you need to sign up for a Mashape account).
Awesome. What else are you not telling me?
We’re hosting a DeveloperWeek Happy Hour on Feb 5, 2013. We’re organizing this social event for the DeveloperWeek community so you can relax, meet new friends, have fun, good beer, and hand made sangria and food! Register now!
See you in DeveloperWeek and we’re looking forward to those tweets! (We’re also in Facebook!)
Last November, we ran a Windows 8 / Windows Phone 8 Developer Challenge in parts of Southeast Asia. We got really cool submissions of apps that use APIs in Mashape. Thanks to everyone who registered and submitted their entries! We have now picked our winner, and another special (suprise!) winner :)
"I am a student from Asia Pacific University which recently graduated from degree in computing. I was honored to be able to win the Mashape Windows 8 Developer Contest and I would like to thank Mashape for organizing such an awesome event.
It was my first time developing a mobile app that consumes APIs and Mashape provided a handful of resources and tutorials which make learning much easier for me.
In my time of development, I encountered a few problems with the API. However, the support line from Blip A Deal was great. Within 2 days, they fixed the bugs in their API for me. Here I would like to take a chance to thank Mr. Sidnei Budiman, technical support from Blip A Deal, for his hard work and efforts for making it real.”
We would also like to recognize Abdullah Abbas (also from Malaysia!) and award him with a (surprise) US$250 Mashape Community Award for his unwavering support and proactive contribution to the Mashape developer community (since he joined the W8 challenge). He has continuously added numerous APIs to Mashape and built apps on top of them :) Here’s his message to everyone…
"I would like to thank Mashape for giving me this recognition (Seriously, I’m very surprised :D). It’s a wonderful opportunity for me to join such a community where I can do what I love, and at the same time make my development much more easier and have fun (Read:make money). I’ve “mashed-up” more than 15 APIs, (9 published, a lot of it still hidden from you guys), published 5 apps in 2 different platforms (Windows 8 and Windows Phone 8) in less than a month! Not only that, from the APIs you can easily generate sample applications on Java, PHP, Phyton, Ruby, as well as Obj-C! Only Mashape provides those features. They also love feedback!
I’m a proud Mashaper! (I hope you are too! If not, you should join now!) I hope you guys will also contribute more to Mashape!”
We would like to thank all the participants and congratulate Alexander and Abdullah! We’re looking forward to another developer challenge hopefully soon! Stay tuned in our Facebook and Twitter :)
This “quick glance” information provides both app developers and API providers with useful information such as whether the API is currently online or offline, average uptime, latency, and the same data spread out for a week on a graph. The Status display is a huge timesaver (and will complement your good old debug and log outputs) in scenarios such as:
1. Planning - e.g. “What average timeout value should I set in my application to consume this API?”
2. Historical Analysis - e.g. “My Party Night API seems to take longer to respond during Fridays. Hmm.”
To access the Status of a Mashape API, go to its Profile page and click the “Status” link on the left navigation pane.
This is a quick video tutorial on how to add your API to Mashape. By adding your API to Mashape, you make it easy for developers to discover and test your API. You are also one step away from adding a billing mechanism to your API.
A key component of the agreement is a revenue sharing plan for the distribution and monetization of Mimvi’s APIs. […] It provides developers acccess to world-class technology… this includes matching mobile apps to content consumed by their users for a richer mobile-first experience, or supplying mobile app search results to websites, mobile products and services.
We are very excited with this partnership, and we hope you guys are too! We’ll keep you posted when the API documentation is finalized. In the meantime, feel free to let us know what you think in Facebook, Twitter, and firstname.lastname@example.org
Recently we had the privelege of being part of Nokia Indonesia’s Lumia Apps Olymiad as prize sponsor for the Mashape/Chatterbox category. The developers who participated had twenty APIs (including the likes of Evernote, and Nokia’s own APIs) to choose from to incorporate in their mobile apps. Here’s a screenshot of the participating APIs.
We would like to congratulate the Kepotify app (video link) for winning the Mashape/Chatterbox category, as well as runner-up Pondok Sukabirus 2. Awesome job by these developers for bringing the Chatterbox API to life in their app entries! (We’ll post some event pics as soon as we get them).
Thanks to Nokia Indonesia for organizing the Lumia Apps Olympiad. Also, props to Narenda Wicaksono from Nokia for organizing such a successful event! And finally, special thanks to Stuart Battersby of Chatterbox, who sponsored an Ultra Chatterbox plan for the winner :)
Moving forward, we’ll partner with more companies, promote and collaborate with API providers, and reach out to more developers to do our small part in raising the awareness of the API ecosystem. We hope you’d join us in this journey, and in Facebook and Twitter too :P
The goal is to get you to navigate around Mashape in less clicks. We heard your feedback, and made it faster for you to access your Inbox and Documentation in the header. We also added a “visual cue” to access your Dashboard with the globe icon on the left, and moved the Add an API button to the right. It’s also worth revisiting the user-related pages you can access when you click on your username.
The footer was also updated. (Click here to view in fullscreen)
Imgur, the popular photo-sharing site that sees 1.5 million uploads per day and 1.2 billion daily image views, has announced in TechCrunch the overhaul of their API to allow developers better access to the Imgur infrastructure.
The Imgur API is also now ready for commercial use, thanks to Mashape! You can check out the API here.
We are undoubtedly very excited with this update not only because of our partnership with Imgur, but also because this is a nod to Mashape’s goal of providing companies with the fastest, easiest, and the best platform to monetize their APIs while providing a world-class API Marketplace for everyone.
We’d love to hear your feedback through Facebook or email us at support @mashape.com :)
[Featured API Series] Chatterbox, Sentiment Analysis for Social Media
We had the opportunity to ask Chatterbox co-founder, Dr. Stuart Battersby (right), on how his startup’s Sentiment Analysis service is different from the rest. He also explains how Mashape enables him to focus on rolling out new features, while monetizing the API.
What is Chatterbox…
Chatterbox is a Wayra London company, and a spin-out from Queen Mary University. Using proprietary algorithms, Chatterbox identifies and understands brand (b)advocates in social media. Whilst Chatterbox can be accessed via a web browser, integration is very important to our customers and we feel that a flexible service gives Chatterbox a new USP. The earliest component developed at Chatterbox was multi-lingual sentiment analysis designed specifically for social media. Unlike traditional sentiment analysis services, Chatterbox can deal with the slang & informal language, including emoticons and hashtags, that is ubiquitous in social media.
With a critical development roadmap focused on building the best algorithms and IP possible we did not want to have to build user management, billing and rate limiting necessary for a production API. Mashape was appealing as it handles all of this whilst remaining standards compliant. This enables the team to focus on developing and delivering our core service. Integrating with Mashape was trivial, our API already delivered JSON, we simply configured our API with some text descriptions and we were done! Integration took hours to days, rather than the months that a bespoke system would.
All this has enabled us to successfully monetize our API - classifying over 10 million texts in the last 30 days alone - and, as we’ve been able to focus on new development, we will soon be updating our API with Chinese sentiment analysis for social media, and anger detection for social media.
How to Use Mashape's Auto-Generated Java client library for your Android apps
UPDATE (Oct 28, 2013): The steps below are already outdated because Mashape now generates the Unirest code snippets (instead of the library indicated in the steps below). In the case below, you would import the Unirest Java library.
One of the ways that Mashape facilitates easy consumption of APIs is by offering auto-generated client libraries for several programming languages, for each of the APIs. You can see these as a row of buttons lined up in the middle-right section of each API page in Mashape.
This saves both the API provider and consumer / developer a huge amount of coding time and manpower, which lets them attend to more important things like running their core business, or brainstorming on code logic for new product features.
This post will guide you on how to use Mashape’s auto-generated Java client library to consume Mashape APIs in your Android apps. A sample code is also provided at the end of this post so you can review and test.
There are generally two things to remember when consuming Mashape APIs in your Java Android application:
The Mashape client library might require you to import class libraries that are not in your Android project, depending on the Android platform and API level you’re targetting. These will usually manifest itself as a runtime exception. The IDE debugger and Github are your best friends in these cases.
Depending on the Android platform you’re targetting, you may or may not be required to wrap the client call in an asynchronous class. The latter is usually the the case for newer Android platforms. The sample code provided here uses an asynchronous call.
Ok let’s get started!
In this example, we will use Webknox’ Question-Answering API to create an Android app that lets the user get answers to user-typed questions. (NOTE: You have to be subscribed to a plan to consume the Question-Answering API). The tutorial below however will assume that you have already created your default Android project in the Eclipse IDE, and will only focus on the Mashape integration part.
1. Download the Java/Android auto-generated client library for the Question-Answering API.
When you extract the contents, you will get the following files:
Generally, you will only need to import the mashape-java-client-*.jar and the QuestionAnswering.java into your project. These two files respectively contain the Mashape and QuestionAnswering classes and functions to make the API call and get a response.
2. Import the Mashape client library files into your project.
The image above is my project view in Eclipse, showing where I imported the two files from number 1 to. QuestionAnswering.java goes to the “src” folder, and the Mashape java client jar file goes to the “libs” folder. This is of course a matter of preference, as long as the files are accessible from your build path.
You need to “include” the QuestionAnswering.java, and change the package name at the top to whatever your project is using.
Adding a jar file to the “libs” folder (in my case in Eclipse), automatically adds it to the “Android dependencies” (see image above). In others you might have to manually add to the build path by right-clicking the main project and navigating to Build Path->Configure Build Path. This opens up the dialog window (in the image below) where you can start adding jar files and what not, into the build path.
3. Download and import the other jar files below:
Apache HttpClient - download, extract, and find the httpmime jar inside. Import it to your project in the “libs” folder.
Gson - extract and import to your project in the “libs” folder.
These are required by the Mashape client library. If you already have these imported, then you don’t have to do this step.
This is how it looks like after importing.
At this point, we’re all set and we can start calling the library functions to make a call to the Mashape API endpoints.
But let’s explore first what the UI looks like, so we can understand the sequence of events before we actually call the API.
From the UI above you can see that we’re letting the user type in a question in the edittext field. The Send button will then pass the question and call our Mashape API Question-Answering, and return a response which will be shown in the Results textview.
4. Call the Mashape client library
The code that gets called for the Send button looks like below:
The “sendMessage” gets called when the Send button is clicked. We then wrap the calling function in an AsyncTask (“CallMashapeAsync”) to avoid the use of threads and handlers. This keeps the UI happy while the library retrieves the API response.
Note that you also have to plug in your Mashape public and private keys.
Here’s the sample app in action.
To wrap up - Mashape lets you access the APIs faster with the auto-generated client libraries. This example showed you how we can use the auto-generated Java client library to call Mashape APIs in Android.
CloudHarmony provides objective performance metrics to compare cloud providers; where results are condensed into simple “grades” and numeric values. Their goal is to become the source for independent, un-biased, and objective performance metrics for cloud services.
Our community is growing fast! At Mashape, we’re always looking for the next great API. Let us know about your favorites.
This is a tutorial on how to add your API(s) to Mashape. Do note that things change quite often so if you’re reading this from the future, some things might have changed. But we’ll update this as often as we can so everyone’s on the same page (literally!).
Before we start, you would need a Mashape account. (You can skip this part if you’ve done this already). Go to http://www.mashape.com/ and click on the button in the upper-right hand section of the page that says “Join Us”. You’ll also have the option to sign up using your GitHub account.
After signing up, you’ll get a verification email. Just open that email and click on the verification link. You will then be taken back to your Dashboard. Your Dashboard is your “private control panel” where you view and control all aspects of the APIs you create and consume.
For now, we’re just interested in adding an API.
1. Add an API
Go ahead and click Add an API in your Dashboard. You will then be presented with a simple form asking you for two things - an API name and a base final URL.
(For this, let’s just imagine that we “own” the Eventbrite API).
As such, we’ll put in “Eventbrite” and the base URL as “https://www.eventbrite.com/json/”. Then go ahead and click “Add API”.
2. Describe the API
You will then be taken to the API page, to fill it in with information to fully “describe” your API. You can start anywhere from picking a logo for your API, a category, a text description, and so on. For now, we’ve chosen to lay out my API endpoints. To do that, we click “Create Documentation.”
Note: A “Documentation” in this context is much more than a readme file for your API endpoints. But equally simple, as you will see next.
The Documentation page is where you fully describe your API endpoints. Let’s break this whole page down one by one. The left navigation pane are actually tabs that drive large pane on the right. From here you can add Authentication settings (if your API requires it), add your Endpoints, and add Models. Models are simply response “Models” that describe the output of a particular endpoint.
As you can see on the dropdown above, several Authentication settings are supported. This will grow over time so be sure to check back once in a while, or email us at email@example.com if you have suggestions/recommendations.
The Endpoints section is where you define the connection points of your API service, typically represented by an HTTP url string. The information you put here are the most basic information that a developer will usually need to call your API endpoint. These include:
HTTP Method (GET, POST, PUT, DELETE)
HTTP Route - you can specify parameters here
Parameter format - Form or JSON
Parameters list - You can control whether a parameter is optional or required, etc.
Response - You can build the Response Model here
You can keep adding Endpoints and Models as required by your API.
Here’s an example of the Endpoints section filled in with the Eventbrite event_search definition.
Once the information has been filled (we can skip the Model part for now), we can go ahead and test if Mashape can connect to your API. That’s what the “Generate Response” button is for.
3. Test the API
The “Generate Response” button allows you to check if you can establish a connection with your API endpoints, as a developer would, if he/she were consuming your API in bare bones fashion. This will check whether you provided the correct authentication, HTTP route, parameters, among other things. This minimal work of testing the endpoint goes a long way in making sure developers are consuming your API endpoints the right way.
Note though, that instead of calling the button “Test Endpoint” (which will come later by the way), it is named “Generate Endpoint” because that’s what we’re doing at this point - generating a Response example that will be captured for the Model section.
Here’s what it looks like after I have successfully generated a response - a Model and “example” response was generated:
At this point, we can start filling in the Fields section with the response “fields” text descriptions. You probably have this field description text somewhere already, so you just need to put them here. Although the endpoint will still be accessible to developers without this field information and description, it is advisable to put them here so that it will complement the response information with field descriptions, and make it easier for developers to understand what they’re getting back from your endpoint. You can also associate these responses with different Models. Just add new Models from the left panel.
That’s it for one endpoint. If you have several endpoints, you just have to repeat Step 3 for all of them. But it’s usually better to “save” one endpoint first before you move ahead with another. So let’s do that now.
4. Save the Documentation
The “Save Documentation” button at the lower-right hand corner of the Documentation panel will save the work that you have done so far. It will also catch if you have some errors in the Response (e.g. malformed responses, etc). You can click on that now.
After you have successfully saved your API documentation, note that you have not yet provided a general (lengthier) text description for your API, website, logo, and no category was set. These details are important so that developers will find your API, and see that you actually mean business!
To fill in this information, go up and click the “Settings” tab. Here’s an example:
Once done, click the “Save Settings” button at the bottom.
5. Make your API public in the Marketplace!
Note that your Endpoint is still in “private” mode, which means that if you intended for this API to be consumed publicly, you have to turn it on for “public” use. For this API, we intend to make it public, so let’s go ahead and do that. Go look for the toggle in the upper-right hand corner that looks like this:
Click on it to make your API public. It should turn green like this:
Once it’s public, developers can start searching for it in Mashape and consume it! Congrats!
Along the way, you might have noticed a few other features of Mashape such as billing and permission add-ons, custom DNS subdomain, Github login, embeddable docs, etc. We’ll explore these features in a separate blog post in more detail in the near future. But feel free to test them out and play with them. And most importantly, tell us about your experience!
Here at Mashape, we want to create the best API Cloud Marketplace for all types of developers. And we can only do that with your feedback and support. You can email us at firstname.lastname@example.org or party with other Mashapers in our Facebook page.
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 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.