I know that apiary (https://ogs.docs.apiary.io/#) is outdated and incomplete, though someway useful.
And I know that test queries can be done on the Django REST framework (https://online-go.com/api/). I used it many times.
The Django REST framework claims to be browseable and sometimes I find links in the result for some call. For example, “next” page in “tournament players”.
Sometimes there’s a “Related” field with some related URL (not links, just text). Just look at your personal data: https://online-go.com/api/v1/me
You can find many other branches listed at the end of the page.
Browsing and searching on the forum I found many times said that APIs are “browseable” but I don’t really understand what that means, since for me it should be something like a tree that you can explore, but it isn’t.
Maybe is something that could be, but isn’t implemented yet. The Django documentations actually talks about browseable APIs but it seems to me that it’s up to the devs to implement such links: https://www.django-rest-framework.org/tutorial/5-relationships-and-hyperlinked-apis/
But still I doubt that I’m missing something and there’s some simple click that can show me what I’m looking for, but haven’t found yet. Is it so?
Sometimes, some nice volunteers share some knowledge in the forum, like this:
The thread is now closed, but I’m guessing if it couldn’t be a good idea to create a wiki post similar to that one, where people could add their bit and build some sort of guide and index of features.
I’ve also been figuring out the API using the browser dev tools. Nothing is more accurate and up to date than seeing the actual requests the website uses.
I opened Chrome and it’s dev tools.
I then opened OGS site, went to a tournament page and tried ctrl+shift+e but nothing happened.
I’m very new to the devs tools so I suppose it’s my fault. Could you provide more detailed instructions please?
With chrome open, press F12 to open the dev tools. Click on the network tab and make sure the record button on the far left is started in order to see the requests. Go to a page such as https://online-go.com/tournament/62495 and you should see a bunch of requests. You can filter the requests in the search bar underneath the record button to something you’re interested in, such as “tournament”. You can click on the name of one of the requests to bring up the details of the request. The header tab on the details will show you what was sent by the requester and the preview or response tab will show you what was received back from the API. If you click around a bit in the website maybe you’ll stumble upon a new API endpoint that you didn’t know existed. I hope that helps!
I went to a tournament page and copied all API request that I found.
I was hoping to find something about groups of players inside of tournament, but there isn’t.
I guess the look of tournament page, with arrays of players and result of their games is built with code.