Search code examples
api-design

How should I build a good (web) API


I'm going to build an API for a web app and I'm interested in what people can suggest as good practices.

I'm already planning to make it versioned (version 1 can only control certain aspects of the system, version 2 could control more, but this may need a change in the way authentication is performed that would be incompatible with version 1), and the authentication will be distinct from the standard username/password people use to log in (if someone does use a malicious tool it won't open them up to full impersonation, just whatever the api allows).

Does anyone have further ideas, or examples of sites with particularly good APIs you have used?


Solution

  • Read the RESTful Web Services book, which give you a good overview of how to use REST in practice, and get to up to speed quickly enough to get started now, with some confidence. This is more useful than just looking at an existing API, because it also discusses design choices and trade-offs.