# Leetcode API implementation. 

![build](https://app.travis-ci.com/prius/python-leetcode.svg?branch=main)

This implements methods that are available publicly for leetcode.
There is already an implementation of them in form of CLI [1], but
it has a list of disadvantages.


1. It is written in JS

2. Even for JS in order to reuse it you have to invoke it via CLI

3. It is not supported very well, so authentication doesn't work anymore


So I have decided to create my own implementation and here is it.


Using the swagger file you'll be able to generate the code for any language
you like and start using leetcode API directly from your code.


Just keep in mind that swagger doesn't really support cookie auth,
which is needed in order to use LC API. If you use python you can
just use the generated code from this repo. Otherwise you'll have to
implement something like `fix_cookies.patch` for your target language.


You can find examples of usage in `example.py`


Autogenerated by swagger documentation can be found [here](/README.generated.md).


[1] https://github.com/skygragon/leetcode-cli
