Let others do the work

Johan Brissmyr is a developer at Malmö-based concept agency Popdevelop. The article is taken from our forthcoming publication about how we can build media and content on data and creations that already exist. Read more about what API’s are here.

One basic rule we live by is to focus on the creative process, rather than spending time reinventing the wheel. That’s why we always try to avoid storing information on our services when other players are available who specialize in storing and searching just this type of information.

This thinking is also good for our users, who aren’t limited because their photos, texts and login data can only be accessed through our services. Their photos end up on Flickr, their music is stored on Soundcloud and they login via Facebook.

Here’s how APIs work

When we use other players’ services, we usually do so through their web-based APIs. These APIs are designed so that information can be retrieved from them using a browser without any additional tool, which makes it easy to quickly test what data is accessible. Each request to the API is made by visiting a particular link as described in the documentation.

This link differs from a regular link because it leads to completely unformatted data with neither color nor shape, which is a requirement for data to be used in software. When you go on to develop your own service based on the data, the requests are then made automatically to the API, which eliminates the need to go through a web browser.

For a more advanced application that reflects large portions of an API, you need to learn how the service’s data is structured in greater detail, how often you can retrieve it and how often it is updated. Unfortunately APIs often lack some functionality required to make an application that is as complete as the service’s own application. Either you accept these limitations, or you work around them by trying to find the information elsewhere.

An example

The information downloaded from the API usually has to be saved to avoid unnecessary multiple queries and to remain within the permitted usage limits. When we designed kollektivt.se we realized we could not query Skånetrafiken’s API each time a visitor enters the site since it would run slowly and result in too many queries. Instead, we save static information such as positions for routes and stops in our database and query Skånetrafiken about new delays once a minute. In other words, visitors entering our site do not generate any traffic directly to Skånetrafiken’s API.

Don’t reinvent the wheel

A plethora of services are out there to store, search, filter and take responsibility for your material. Unless you have a really good reason, you should reconsider your solution if you’re trying to decide whether to build the next great photo, file or music service. Most respected services have an open API that allows users to read and publish content. Collaborate with these services and focus on the creative aspect of your concept!

A comment
  • http://www.helalf.se/ Helen Alfvegren

    Mycket bra poäng!