Skip to content

SandipLow/GeeksForGeeksAPI

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unofficial GFG API

An unofficial API for GeeksForGeeks for developers to make cool stuff using GFG profile data.

Forked from arnoob16/GeeksForGeeksAPI


Functionalities

  • Has all the relevant data from the GFG profile page.
  • Has the count of all the problems solved based on difficulties.
  • Has the links & names of all the problems solved by the user segregated based on difficulties.
  • Methods supported - GET

Endpoints

To access the API, there is 2 endpoints,

  1. https://geeks-for-geeks-stats.vercel.app/userdata/yourGeeksForGeeksUsername - This endpoint will give you all the data of the user.

Sample URL - https://geeks-for-geeks-stats.vercel.app/userdata/sandiplowsnuf

  1. https://geeks-for-geeks-stats.vercel.app/stats/yourGeeksForGeeksUsername - This endpoint will give you an svg image of the user's profile stats.

Sample URL - https://geeks-for-geeks-stats.vercel.app/stats/sandiplowsnuf

How was it built:

The API was built using Web Scraping the profile page and a server deployed on web.


Instructions to run on your local system


Sample API Responses

Sample stats Image

https://geeks-for-geeks-stats.vercel.app/stats/aganswiar

sample image


Userdata: Success Response

https://geeks-for-geeks-stats.vercel.app/userdata/aganswiar

{
    "info": {
        "userName": "aganswiar",
        "profilePicture": "https://media.geeksforgeeks.org/img-practice/user_web-1598433228.svg",
        "instituteRank": "527",
        "currentStreak": "03",
        "maxStreak": "1170",
        "institution": "National Institute of Technology, Durgapur (NIT Durgapur) ",
        "languagesUsed": "C++, Java, Python",
        "campusAmbassador": "algo_artisan_sandip",
        "codingScore": "357",
        "totalProblemsSolved": "144",
        "monthlyCodingScore": "28"
    },
    "solvedStats": {
        "school": {
            "count": 0,
            "questions": []
        },
        "basic": {
            "count": 19,
            "questions": [
                {
                    "question": "Set the rightmost unset bit",
                    "questionUrl": "https://practice.geeksforgeeks.org/problems/set-the-rightmost-unset-bit4436/0"
                },
                {
                    "question": "Odd or Even",
                    "questionUrl": "https://practice.geeksforgeeks.org/problems/odd-or-even3618/0"
                },
                ...
            ]
        },
        "easy": {
            "count": 71,
            "questions": [
                {
                    "question": "Array Leaders",
                    "questionUrl": "https://practice.geeksforgeeks.org/problems/leaders-in-an-array-1587115620/0"
                },
                {
                    "question": "Disjoint set (Union-Find)",
                    "questionUrl": "https://practice.geeksforgeeks.org/problems/disjoint-set-union-find/0"
                },
                ...
            ]
        },
        "hard": {
            "count": 1,
            "questions": [
                {
                    "question": "Alien Dictionary",
                    "questionUrl": "https://practice.geeksforgeeks.org/problems/alien-dictionary/0"
                }
            ]
        }
    }
}

Failure Response

{
    "error": "Profile Not Found"
}

Notes

  • If you are using this, do mention about this repository in your readme, I'll also mention your project here in this repository.
  • A star to the repository would be massive boost to a NOOB like me.

Releases

No releases published

Packages

No packages published

Languages

  • HTML 74.5%
  • Python 25.5%