4m1r 4m1r - 1 year ago 155
HTTP Question

Is there a way to discover all endpoints of a ReST API?

I'm wondering if its possible to programmatically discover all the endpoints of a particular API.

So for example if I GET this URL with a browser or curl:

I might get something like this as a JSON response:

"version" : 1.1,
"GET" : {
"search/" : ["users", "trending"],
"users/" : ["id", "handle"]

Of course Twitter could choose to publish or not publish this format. So as a side question, are there any libraries for Java or Javascript that will automatically map and publish the API routes you created in your controllers?

Answer Source

There is no way of programmatically discovering REST services as they do not have a standard registry service.

Apart from doing something insane brute-force search there is no way of finding the right URLs ( not to mention the right parameters). So the only option is documenting your API. For that the best choice I have seen so far is:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download