API Documentation

The GeeksforGeeks Profile API allows you to extract profile information and coding statistics from GeeksforGeeks user dashboards.

Base URL

https://geekforgeekapi.onrender.com

All API endpoints are relative to this base URL.

Authentication

This API does not require authentication.

Rate limiting is applied to prevent abuse. Maximum 10 requests per minute per IP address.

API Endpoints

GET /profile

Get complete profile information from a GeeksforGeeks user dashboard.

Request Parameters

  • username (required) - The GeeksforGeeks username

Example Request

GET /api/profile?username=geek123

Example Response

{
                      "username": "geek123",
                      "fullname": "John Doe",
                      "qualification": "Computer Science Graduate",
                      "joined_date": "2024-01-15 12:34:56",
                      "coding_score": "350",
                      "problems_solved": "75",
                      "contest_rating": "1532",
                      "overall_rank": "2345",
                      "total_submissions": "120",
                      "monthly_problems_solved": "12",
                      "last_submission": {
                        "problem": "Reverse a linked list",
                        "slug": "reverse-linked-list",
                        "language": "python"
                      },
                      "solved_by_difficulty": {
                        "basic": "20",
                        "easy": "30",
                        "medium": "20",
                        "hard": "5"
                      },
                      "institution": "Stanford University",
                      "languages_used": ["C++", "Python", "Java"],
                      "current_streak": "15",
                      "longest_streak": "30",
                      "monthly_score": "240"
                    }
                    

GET /basic-info

Get basic profile information like username, fullname, and qualification.

Request Parameters

  • username (required) - The GeeksforGeeks username

Example Request

GET /api/basic-info?username=geek123

Example Response

{
                      "username": "geek123",
                      "fullname": "John Doe",
                      "qualification": "Computer Science Graduate",
                      "joined_date": "2024-01-15 12:34:56"
                    }
                    

GET /coding-stats

Get coding statistics like score, problems solved, contest rating.

Request Parameters

  • username (required) - The GeeksforGeeks username

Example Request

GET /api/coding-stats?username=geek123

Example Response

{
                      "coding_score": "350",
                      "problems_solved": "75",
                      "contest_rating": "1532",
                      "overall_rank": "2345"
                    }

GET /submission-data

Get submission data like total submissions, monthly problems solved, last submission.

Request Parameters

  • username (required) - The GeeksforGeeks username

Example Request

GET /api/submission-data?username=geek123

Example Response

{
                      "total_submissions": "120",
                      "monthly_problems_solved": "12",
                      "problems_by_difficulty": {
                        "basic": [
                          {
                            "name": "Peak element",
                            "url": "https://www.geeksforgeeks.org/problems/peak-element/0"
                          },
                          {
                            "name": "Array Search",
                            "url": "https://www.geeksforgeeks.org/problems/search-an-element-in-an-array-1587115621/0"
                          }
                        ],
                        "easy": [
                          {
                            "name": "First n Fibonacci",
                            "url": "https://www.geeksforgeeks.org/problems/print-first-n-fibonacci-numbers1002/0"
                          },
                          {
                            "name": "Sum of Natural Numbers",
                            "url": "https://www.geeksforgeeks.org/problems/sum-of-series2811/0"
                          }
                        ],
                        "medium": [
                          {
                            "name": "Largest Element in Array",
                            "url": "https://www.geeksforgeeks.org/problems/largest-element-in-array4009/0"
                          }
                        ],
                        "hard": []
                      }
                    }

GET /difficulty-stats

Get solved stats by difficulty (easy, medium, hard, basic).

Request Parameters

  • username (required) - The GeeksforGeeks username

Example Request

GET /api/difficulty-stats?username=geek123

Example Response

{
                      "solved_by_difficulty": {
                        "basic": "20",
                        "easy": "30",
                        "medium": "20",
                        "hard": "5"
                      }
                    }

GET /institution-languages

Get institution and languages used.

Request Parameters

  • username (required) - The GeeksforGeeks username

Example Request

GET /api/institution-languages?username=geek123

Example Response

{
                      "institution": "Stanford University",
                      "languages_used": ["C++", "Python", "Java"]
                    }

GET /streak

Get user's streak and monthly score.

Request Parameters

  • username (required) - The GeeksforGeeks username

Example Request

GET /api/streak?username=geek123

Example Response

{
                      "current_streak": "15",
                      "longest_streak": "30",
                      "monthly_score": "240"
                    }

Error Responses

The API uses standard HTTP status codes to indicate the success or failure of a request.

Common Error Codes

  • 400 Bad Request - Invalid username parameter
  • 404 Not Found - Profile not found
  • 429 Too Many Requests - Rate limit exceeded
  • 500 Internal Server Error - Server error while processing the request

Error Response Format

{
  "error": "Error message explaining what went wrong"
}