Working with 3rd Party APIs (Twitter/Facebook)

Recently i’ve been working a lot with 3rd party APIs (specifically Twitter/Facebook). Working with a 3rd Party API, there are many dangers/advantages. In this article i will attempt to highlight what i’ve learnt working with 3rd party APIs.

So what is an API? An API (Application Programming Interface) is a way for other programs to interact with a service (IE Twitter) in a standard way.

I’ve only ever used web APIs so this is where i’ll focus. However ‘API’ is a generic term that applies to any program/service running anywhere.

So using Twitter as an example. Twitter has they’re main service, the website interface which we’ve all used. As application developers we cannot (rather should-not) interface with that service via the web interface. This act i’ve known as ‘site-hacking’.

‘Site-Hacking’ means the application is directly acting as a user, emulating they’re actions through the web interface. This is bad for several reasons:

  • The user give over Full Control to the Application
  • There is no security for the user (bad Twitter apps always require you to enter your username/password)
  • Using the web interface increases the chance of the application breaking, due to website changes
  • You’ll get next to no help in the development communities for using this method
  • its just plain evil

The proper way to interface is via an API created by the owners of that service. This means that, for example, Twitter can control the flow of data to they’re service (so we dont get the infamous ‘fail whale’) and creates a security layer for users via the popular OAuth standard.

Here are some advantages/disadvantages of using an API:

Advantages:

  • Higher security for your users (mostly via OAuth, no passwords stored)
  • Reduced setup/development time
  • Smaller R&D (if the API documentation is good anyway!)
  • Increases trust between the service provider and you, the developer, not to take advantage of they’re system

Disadvantages:

  • API Changes WILL happen, which you’ll have to handle for in your application – although this is still better than the ‘site-hack’ method
  • There may be limitations in the API’s functionality
  • Often there are several APIs the service provider has create. This can cause quite a bit of confusion (Facebook has serveral APIs)

So looking at those points it looks a bit hazardous. That’s because for the most part it is. You have to be prepared to fix things very quickly. you have to be on the ball all the time. Large websites evolve very quickly and you’re app needs to evolve along with it or die.

Overall using a 3rd party API to create an app is good for getting fast exposure. And if you make something very useful, you could get a large user-base yourself and create your own API! (an API for an API how silly :P ).

Thats all for now, if you have any questions about working with APIs or want any advice on where to start with Twitter or Facebook drop a comment :)

Peace

-Bill

Also heres a picture of a strawberry, Awesome!
Strawberry
I, Bill Nunney, grant you whoever you are, full rights to use this image of a strawberry however you want.

Tags: , , , , , , ,