A powerful, unofficial RESTful API service for accessing GeeksForGeeks user data. Get detailed information about coding profiles, solved problems, contest history, and submission calendars through a simple API interface.
- 📊 User Profile Data: Get comprehensive information about any GeeksForGeeks user
- ✅ Solved Problems: Access user's solved problems categorized by difficulty level
- 🏆 Contest History: View detailed contest participation and ratings
- 📅 Submission Calendar: Track coding activity and submission patterns
- 🛡️ Rate Limiting: Built-in protection against API abuse
- ⚡ Fast & Reliable: Optimized for performance and reliability
The API is now live and can be accessed at:
https://mygfg-api.vercel.app
| Endpoint | Method | Description | Parameters | Example |
|---|---|---|---|---|
/<username> |
GET | Get user profile and solved problems | username (path) |
https://mygfg-api.vercel.app/username123 |
/<username>/calendar |
GET | Get user's submission calendar | username (path)year (query, optional) |
https://mygfg-api.vercel.app/username123/calendar?year=2024 |
/<username>/contest |
GET | Get user's contest history | username (path)year (query, optional) |
https://mygfg-api.vercel.app/username123/contest?year=2024 |
| Status Code | Description |
|---|---|
| 200 | Success |
| 400 | Invalid username format or year |
| 404 | User profile not found |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
GET https://mygfg-api.vercel.app/<username>
Returns user's profile information and solved problems.
Example:
https://mygfg-api.vercel.app/username123
Example Response:
{
"info": {
"userName": "example_user",
"fullName": "Example User",
"profilePicture": "https://...",
"institute": "Example Institute",
"instituteRank": "1",
"longestStreak": "30",
"codingScore": 1500,
"monthlyScore": 500,
"currentRating": 1800,
"userGlobalRank": 100,
"level": 5,
"totalProblemsSolved": 200
},
"solvedStats": {
"easy": {
"count": 100,
"questions": [...]
},
"medium": {
"count": 80,
"questions": [...]
},
"hard": {
"count": 20,
"questions": [...]
}
}
}GET https://mygfg-api.vercel.app/<username>/calendar?year=2024
Returns user's submission activity for the specified year.
Example:
https://mygfg-api.vercel.app/username123/calendar?year=2024
Query Parameters:
year(optional): Year to fetch submissions for (defaults to current year)
Example Response:
{
"Total Submissions": 150,
"Submission Dates": {
"2024-01-01": 5,
"2024-01-02": 3,
...
}
}GET https://mygfg-api.vercel.app/<username>/contest?year=2024
Returns user's contest participation and ratings.
Example:
https://mygfg-api.vercel.app/username123/contest?year=2024
Query Parameters:
year(optional): Year to fetch contest data for (defaults to current year)
Example Response:
{
"Contest Data": {
"Level": 5,
"Rank": 1800,
"Global Rank": 100,
"Total Contests": 20
},
"Contest Details": [...]
}The API implements rate limiting to ensure fair usage:
- 10 requests per minute per IP
- 50 requests per hour per IP
- 200 requests per day per IP
- Clone the repository:
git clone https://github.com/yourusername/geeksforgeeks-api.git
cd geeksforgeeks-api- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Start the Flask server:
python app.pyThe server will start at http://localhost:5000
geeksforgeeks-api/
├── app.py # Main application file
├── requirements.txt # Project dependencies
├── README.md # Project documentation
└── modules/
├── scrap.py # User profile scraper
├── calendar.py # Submission calendar handler
└── contest.py # Contest data handler
- Flask
- Flask-RESTful
- Flask-Limiter
- Requests
- BeautifulSoup4
The API returns appropriate HTTP status codes and error messages:
200 OK: Successful request400 Bad Request: Invalid input parameters404 Not Found: User profile not found429 Too Many Requests: Rate limit exceeded500 Internal Server Error: Server-side error
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Your Name - @JayeshVegda
- GeeksForGeeks for providing the platform
- Flask and its extensions for the web framework
- All contributors who have helped improve this project
GeeksForGeeks API, GFG API, Coding Profile API, Programming Contest API, GeeksForGeeks Scraper, GFG User Data, Coding Statistics API, Programming Profile API, GeeksForGeeks Unofficial API, GFG Contest History, Coding Activity Tracker, Programming Progress API
