"Yet Another LeetCode API" - Because why reinvent the wheel? (But we did anyway 🛠️)
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
# 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
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 |
-
Clone the repo
git clone https://github.com/yourusername/leetcode-api.git cd leetcode-api
-
Install dependencies
pip install -r requirements.txt
-
Run the server
python api.py
Visit http://localhost:8000/docs for local Swagger docs!
-
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