What should be located at the homepage of a REST API?

Viewed 1124

I'm currently in the process of writing a REST API and this question always seems to popup.

I've always just added a description, quick links to docs, server time etc, but see now (after looking around a bit) that a simple redirect to the API docs would be even better.

My question is what would be the accepted norm to have as the root - '/' - "homepage" of your API?

I've been looking at a few implementations:

  • Facebook: Just gives a error of "Unsupported get request.";
  • Twitter: Shows an actual 404 page;
  • StackOverflow: Redirect to quick "usage" page.

After looking at those it's clear everyone is doing it differently.

In the bigger picture this is of little significance but would be interesting to see what the "RESTfull" way of doing it (if there is one) might be.

2 Answers

I've give this much thought and right now I either return a 404 page, a health status page, a dummy page or redirect to another page, mostly likely on within the organization.

An API homepage isn't something everyone should be looking at and believe me, it can be found. There are more people like me that love to inspect the browser and see how a website is performing.

Related