Skip to content

noworneverev/leetcode-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode API

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

Deployed on Vercel FastAPI License

A no-nonsense LeetCode API service for developers who want LeetCode data without the scraping headaches. Perfect for:

  • Building coding portfolios 🖼️
  • Tracking practice stats 📊
  • Creating LeetCode-powered apps 💻
  • Just messing around with API endpoints 🤹

Live Demo: https://leetcode-api-pied.vercel.app
Interactive Docs: https://leetcode-api-pied.vercel.app/docs

🚀 Quick Start

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

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

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

🔍 API Endpoints

Endpoint Method Description Example
/questions GET All LeetCode questions /questions
/question/{id_or_slug} GET Get question by ID/slug /question/two-sum
/user/{username} GET User profile & stats /user/lee215
/daily GET Today's coding challenge /daily
/problems/{topic} GET Questions by topic (arrays, DP, etc) /problems/array
/user/{username}/submissions GET User's recent submissions /user/lee215/submissions

🛠️ Local Setup

  1. Clone the repo

    git clone https://github.com/yourusername/leetcode-api.git
    cd leetcode-api
  2. Install dependencies

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

    python api.py

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

🤔 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