Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Reference is outdated #2834

Open
Voileexperiments opened this issue Oct 14, 2022 · 3 comments
Open

API Reference is outdated #2834

Voileexperiments opened this issue Oct 14, 2022 · 3 comments

Comments

@Voileexperiments
Copy link

Voileexperiments commented Oct 14, 2022

There is an API Reference linked on CW web pages.

I didn't even know /api/v1/code-challenges/{challenge}/assessed-ranks existed. What are the other undocumented additions?

@kazk
Copy link
Member

kazk commented Oct 14, 2022

It's partially due to my laziness and lack of time, but undocumented means internal/experimental/unfinished/unimportant.

Some of them were added as a temporary quick fix/workaround (e.g., IIRC assessed-ranks was added, so I don't need to answer); for our Discord bot and Hob's userscript; or I just felt like it and had some time. There are many mods only endpoints as well.
You can use it, but it may or may not work.

What are the other undocumented additions?

I don't have a list, but if someone wants to help document a subset that's useful for average users, I'll review PRs (codewars-api-docs) and answer questions.

@hobovsky
Copy link

Some endpoints I know:

  • /api/v1/leaders/ranks/${lang}?page=${page} - language leaderboards, used by Discord bot and my script. Not documented because the boards are inaccurate due to the "contributor flag" issue.
  • /api/v1/languages - lists available languages, used by Discord bot and my script.
  • /api/v1/code-challenges/${kataId}/assessed-ranks - rank votes breakdown with some additional mods-only options. Added on my request as an idea of collaboration between kazk providing backend functionality and users creating some presentation of it. Besides, kazk was bugged by reviewers very often when a beta kata was to be approved.
  • /api/v1/clans/:name/members to stop bootcamps from scraping the website with a shitton of N+1's (see Need a proper API for Codewars clans (feature request) #2710 )

There's a bunch of webhooks, but they are not public and users cannot subscribe to them at the moment. They are mostly used for administrative and moderation functions.

There are some URLs which work on the website but are not exposed via GUI (see codewars/docs#435).

@ghost
Copy link

ghost commented Dec 13, 2022

Is there an undocumented api endpoint that returns a json object that has all 8000+ problem slugs/ ids? similar to how leetcode does it with https://leetcode.com/api/problems/all/

I'm asking because im hoping there is a better way than looping through 250+ requests using https://www.codewars.com/kata/?page={i} with a webdriver just to get the slugs needed to use the api for getting the challenge body!

Also just a side note, even a internal/experimental/unfinished/unimportant api is hugely appreciated and the fact that there is an api and documentation in place at all is miles ahead of leetcode and really is appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants