Join For Free

List of 40+ tutorials on how to create an API Posted 7 months ago

image

Here’s a useful list of resources on how to create an API, categorized by programming language. (We also have a post on 30+ ways to make a REST call in different languages)

As an API Marketplace, Mashape helps developers discover, consume, distribute, and monetize private and public APIs.  We hope that the tutorials below would help you in your API journey. 

(If you’re looking for examples of APIs, check here for a list of face recognition APIs)

Node.js 

  1. http://flippinawesome.org/2013/09/23/easy-api-scaffolding-with-simple-api-and-node-js/
  2. http://blog.modulus.io/nodejs-and-express-create-rest-api (May 2013)
  3. http://synthmedia.co.uk/blog/basic-nodejs-api-with-restify-and-save (May 2013)
  4. http://webapplog.com/tutorial-node-js-and-mongodb-json-rest-api-server-with-mongoskin-and-express-js/ (Jul 2013)
  5. http://thewayofcode.wordpress.com/2013/04/21/how-to-build-and-test-rest-api-with-nodejs-express-mocha/ (Apr 2013)
  6. http://webapplog.com/intro-to-express-js-simple-rest-api-app-with-monk-and-mongodb/ (Apr 2013)
  7. http://stackoverflow.com/questions/14990544/how-to-best-create-a-restful-api-in-node-js (Feb 2013)
  8. http://erichonorez.wordpress.com/2013/02/10/how-create-a-rest-api-with-node-js-and-express/ (Feb 2013)
  9. http://benaugarten.com/blog/2013/01/31/restful-a-better-rest-api-using-node-dot-js-with-express/ (Jan 2013)
  10. http://coenraets.org/blog/2012/10/creating-a-rest-api-using-node-js-express-and-mongodb/ (Nov 2012)
  11. http://pixelhandler.com/blog/2012/02/09/develop-a-restful-api-using-node-js-with-express-and-mongoose/ (Feb 2012)

PHP

  1. http://coreymaynard.com/blog/creating-a-restful-api-with-php/ (May 2013)
  2. http://net.tutsplus.com/tutorials/php/creating-an-api-centric-web-application/ (2011)
  3. http://www.youtube.com/watch?v=vJVQi7ZFSaQ (2010)
  4. http://blog.andreaolivato.net/programming/create-your-first-api-set-in-php.html (2009)
  5. http://www.gen-x-design.com/archives/create-a-rest-api-with-php/ (Feb 2009)
  6. http://www.particletree.com/features/how-to-add-an-api-to-your-web-service/ (2009)
  7. http://www.recessframework.org/page/towards-restful-php-5-basic-tips (2008)
  8. http://www.codewalkers.com/c/a/Miscellaneous/Create-Your-Own-Custom-API/ (2005)

Python

  1. http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask (May 2013)
  2. http://gotofritz.net/blog/weekly-challenge/restful-python-api-bottle/ (2012)
  3. http://blog.webspecies.co.uk/2011-06-15/restful-web-services-with-python-the-easy-way.html (2011)
  4. http://myadventuresincoding.wordpress.com/2011/01/02/creating-a-rest-api-in-python-using-bottle-and-mongodb/ (2011)
  5. http://www.robertshady.com/content/creating-very-basic-api-using-python-django-and-piston (2010)

Rails

  1. http://collectiveidea.com/blog/archives/2013/06/13/building-awesome-rails-apis-part-1/ (Jun 2013)
  2. http://www.emilsoman.com/blog/2013/05/18/building-a-tested/ (May 2013)
  3. http://railsware.com/blog/2013/04/08/api-with-ruby-on-rails-useful-tricks/ (Apr 2013)
  4. http://mt.gomiso.com/2011/06/27/building-a-platform-api-on-rails/ (2011)
  5. http://www.whatcodecraves.com/articles/2008/11/25/how-to-make-an-api-for-a-rails-app (2008)
  6. http://www.xml.com/pub/a/2006/04/19/rest-on-rails.html?page=3 (2006)

ASP.NET Web API (C#/.NET)

  1. http://www.windowsazure.com/en-us/develop/net/tutorials/rest-service-using-web-api/ (Jun 2013)
  2. http://blog.ploeh.dk/2013/08/23/how-to-create-a-pure-f-aspnet-web-api-project/ (Aug 2013)
  3. http://dotnet.dzone.com/articles/web-api-aspnet-web-forms (May 2013)
  4. http://www.contentedcoder.com/2013/03/creating-your-first-web-api.html (Apr 2013)
  5. http://www.codeproject.com/Articles/549152/Introduction-to-ASP-NET-Web-API (Mar 2013)
  6. http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api (2012)
  7. http://www.asp.net/web-api/overview/creating-web-apis/creating-a-web-api-that-supports-crud-operations (2012)
  8. http://www.asp.net/web-api/overview/creating-web-apis/using-web-api-with-entity-framework/using-web-api-with-entity-framework,-part-1 (2012)
  9. https://github.com/Factual/factual-csharp-driver/wiki/ASP.NET-Web-API-with-Factual-Driver-Example (2012)

Java

  1. http://www.ibm.com/developerworks/training/kp/j-kp-rest/
  2. http://static.springsource.org/spring/docs/3.0.0.M3/spring-framework-reference/html/ch18s02.html
  3. http://docs.oracle.com/javaee/6/tutorial/doc/giepu.html
  4. http://www.myeclipseide.com/documentation/quickstarts/webservices_rest/
  5. http://rest.elkstein.org/2008/02/using-rest-in-java.html

Are there useful tutorials on creating APIs that should be here?  Please send us a tweet @mashape

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.

Happy coding!