Skip to content

noworneverev/leetcode-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode API / LeetCode Sorted

Deployed on Vercel FastAPI License

"Yet Another LeetCode API" - Because why reinvent the wheel? (But we did anyway 🛠️)

🚀 Core Services

⚡ Quick Start

# Get today's daily challenge
curl https://leetcode-api-pied.vercel.app/daily

# Find a problem by ID/slug
curl https://leetcode-api-pied.vercel.app/problem/1
curl https://leetcode-api-pied.vercel.app/problem/two-sum

# Get user profile (try your LeetCode username!)
curl https://leetcode-api-pied.vercel.app/user/lee215

🔍 API Endpoints

Endpoint Method Description Example
/problems GET All LeetCode problems /problems
/problem/{id_or_slug} GET Get problem by ID/slug /problem/1
/problem/two-sum
/search/{query} GET Search for problems /search?query=two%20sum
/random GET Random LeetCode problem /random
/user/{username} GET User profile & stats /user/lee215
/user/{username}/contests GET User's recent contests /user/lee215/contests
/user/{username}/submissions GET User's recent submissions /user/lee215/submissions
/daily GET Today's coding challenge /daily

🛠️ Local Setup

  1. Clone the repo

    git clone https://github.com/yourusername/leetcode-api.git
    cd leetcode-api
  2. Set up virtual environment (recommended)

    python -m venv venv
    source venv/bin/activate  # Linux/MacOS
    venv\Scripts\activate     # Windows
  3. Install dependencies

    pip install -r requirements.txt
  4. Run the server

    python run.py

    Visit http://localhost:8000/docs for local Swagger docs!

🔄 Daily Updated Full Problems JSON

Get the latest LeetCode problems. Either run:

python -m src.utils.download

or download leetcode_questions.json(updated daily) directly from the data folder.

🤔 Why This API?

  • Always Fresh Data 🥬 Auto-updating cache system (no stale LeetCode questions!)

  • Vercel-Ready ⚡ One-click deployment with serverless architecture

  • No API Keys 🔓 Free to use with sensible rate limits

  • Real LeetCode Data 🔥 Direct integration with LeetCode's GraphQL API


Disclaimer: This project isn't affiliated with LeetCode. Use at your own risk.

Made with ❤️ by Yan-Ying Liao

About

LeetCode API - LeetCode questions sorted by likes - Daily updated LeetCode database

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy