codewars / codewars.com

Issue tracker for Codewars
https://www.codewars.com
BSD 2-Clause "Simplified" License
2.09k stars 220 forks source link

New endpoint to list kata #2302

Open GeorgeWL opened 4 years ago

GeorgeWL commented 4 years ago

Use Case

I'd love to create a web app that goes "Give me Random Katas", with a little set of options.

But when I looked through the API docs, the GET endpoints for challenges seemed rather limited.

I would like to be able to do a GET request with the format of /challenges

Proposed Solution

Create a /challenges endpoint, which returns an array of Challenges, sorted by newest by default.

With some optional Param queries, with default values

Sample: GET /challenges

[
  {challenge0},
  {challenge1},
  {challenge2}
]

some ideas for optional url params:

Param Type Default Value Description
count number 10 set how many results the array should return
rank number undefined only return results of a specific ranking, else return any
minSolutions number|undefined undefined only return results which have a minimum of minSolution, else any
collection string|undefined undefined only return solutions within a specified collection, else any
sortBy 'newest'|'ranking' 'oldest' 'stars' undefined 'newest' set which order the array should return in

┆Issue is synchronized with this Clickup by Unito

Avataw commented 4 years ago

Hey George!

I really like that idea, do you already have a public repo so that I could possibly contribute? I am not sure if codewars is gonna change their API anytime soon, maybe I could build an external API that crawls the site and gives you links for challenges or something?

Let's collaborate man!

GeorgeWL commented 4 years ago

I really like that idea, do you already have a public repo so that I could possibly contribute?

Not considered making my own API for it, though not a bad idea at all

I am not sure if codewars is gonna change their API anytime soon, maybe I could build an external API that crawls the site and gives you links for challenges or something?

Latest update was in March last year, so seems they do update it, just rather slow paced.

And they do have an endpoint which returns new challenges, but only as a feed listener webhook

Let's collaborate man!

probably simplest option is to read events from the webhook then store them in firestore, and have our api return the list from there.

GoodGuyGregory commented 4 years ago

@GeorgeWL If possible reach out to me as I would like to build a REST service for this.

kazk commented 3 years ago

Sorry for the lack of response. I had completely missed all the issues opened here. This repository is for API docs.

Bug reports or feature-requests for anything related to Codewars have been tracked on https://github.com/codewars/codewars.com. I'll transfer this.