This project is a simple Node.js application that fetches profile information from GeeksforGeeks using the official GeeksforGeeks API. It allows you to retrieve various details from a user's profile, such as the number of articles, rank, and other relevant statistics.
The project utilizes Axios for making HTTP requests and JavaScript's async/await for handling asynchronous operations.
- Fetch user profile data from GeeksforGeeks.
- Handle errors gracefully with appropriate messages.
- Retrieve useful profile statistics such as rank, article count, etc.
- Asynchronous data retrieval using
async/awaitfor smooth and efficient operations.
-
GeeksforGeeks User Profile API: The API endpoint fetches user profile details like article count, rank, etc.
API URL format:
https://authapi.geeksforgeeks.org/api-get/user-profile-info/?handle={username}&article_count=false&redirect=true
To get started with the project, follow these steps:
-
Clone the repository:
git clone https://github.com/Siranjeevi619/gfg-profile-fetcher.git cd gfg-profile-fetcher -
Install dependencies: This project uses Axios to make HTTP requests. Install the necessary dependencies using
npm:npm install
-
Run the application: Start the application by running:
node index.js
-
Fetch Profile Data: Modify the
userNameparameter in theprofileDatafunction to the desired GeeksforGeeks profile username. Example:"siranjeevi0619". -
Log Profile Information: The profile information will be logged to the console when the
profileDatafunction resolves the data.
{
"handle": "siranjeevi0619",
"rank": "3-Star",
"article_count": "15",
"solved_problem_count": "300",
"score": "1200"
}If you'd like to contribute to this project:
- Fork the repository.
- Create a feature branch (
git checkout -b feature-name). - Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-name). - Open a Pull Request.
This project is open-source and available under the MIT License.
For more information, contact Siranjeevi.