Last June, API Blueprint became recognized as a language on GitHub. This brought the syntax highlighting and repository statistics for API Blueprint. More importantly, it has also enabled the search for API design patterns.
Let’s take a quick look at how we can search and perhaps learn from the API designs done by others.
To search for API Blueprint on GitHub simply go to,
language:"API Blueprint" as the query. Hitting the search will
list all of the GitHub repositories that contain at least one API Blueprint
Seeing every blueprint on GitHub could be fun, but what is more fun is to search for a particular keyword in blueprints. Here are all the blueprints that contain the infamous “Hello World”:
Note: When you are searching for a query like
Hello World, make sure to switch to
the “Code” results in the left hand pane.
Ok, it is the time to look how others are solving some popular API design patterns.
Is your resource a collection of elements or other resources, such as a search result? Maybe it is a good idea to split the response into pages.
Searching blueprints for the
page word seems like to be a good start to see
how others dealt with this task.
API pagination on GitHub:
page language:"API Blueprint"
Doing authentication properly is no easy task. Let’s see how
OAuth2 is used in
OAuth2 in APIs on GitHub:
oauth2 language:"API Blueprint"
Need to throttle the number of requests clients do to your API? So do many fellow developers:
API rate limiting on GitHub:
rate limit language:"API Blueprint"
If you are building a true REST API or just curious what has been built so far,
you can search for blueprints using one of the many hypermedia types.
HAL+JSON APIs on GitHub:
"hal+json" language:"API Blueprint"
These were just a few examples of queries you use while looking for API design patterns.
Let us know if you find (or create) something interesting. Let’s learn from each other how to build better APIs for tomorrow!