This project is a Django-based REST API for retrieving author publications from Google Scholar and Semantic Scholar. The API allows users to search for authors and their publications, filter publications by year, and get combined results from both sources.
- Retrieve all publications for an author from Google Scholar.
- Retrieve publications for an author filtered by year from Google Scholar.
- Retrieve all publications for an author from Semantic Scholar.
- Retrieve publications for an author filtered by year from Semantic Scholar.
- Retrieve combined publications for an author from both Google Scholar and Semantic Scholar.
- Retrieve combined publications for an author filtered by year from both sources.
- Python 3.8+
- Django 3.2+
- djangorestframework 3.12+
- scholarly 1.4.0+
- requests 2.25+
-
Clone the repository:
git clone https://github.com/AntenehTilaye/scholar-finder.git cd scholar-finder
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up the Django project:
- this api does not store the data but if you want can by creating a model
python manage.py migrate python manage.py createsuperuser # Follow the prompts to create a superuser
-
Run the development server:
python manage.py runserver
-
Access the API:
Open your browser and go to
http://127.0.0.1:8000/
.
- 'api' is ppms in this code but you can rename it if you want
- URL:
/api/google-scholar/publications/{name}/
- Method: GET
- Description: Retrieves all publications for the specified author from Google Scholar.
- URL Params:
name
(string): The name of the author.
- URL:
/api/google-scholar/publications/{name}/{year}/
- Method: GET
- Description: Retrieves publications for the specified author from Google Scholar, filtered by the specified year.
- URL Params:
name
(string): The name of the author.year
(integer): The publication year to filter by.
- URL:
/api/semantic-scholar/publications/{name}/
- Method: GET
- Description: Retrieves all publications for the specified author from Semantic Scholar.
- URL Params:
name
(string): The name of the author.
- URL:
/api/semantic-scholar/publications/{name}/{year}/
- Method: GET
- Description: Retrieves publications for the specified author from Semantic Scholar, filtered by the specified year.
- URL Params:
name
(string): The name of the author.year
(integer): The publication year to filter by.
- URL:
/api/both-sources/publications/{name}/
- Method: GET
- Description: Retrieves combined publications for the specified author from both Google Scholar and Semantic Scholar.
- URL Params:
name
(string): The name of the author.
- URL:
/api/both-sources/publications/{name}/{year}/
- Method: GET
- Description: Retrieves combined publications for the specified author from both Google Scholar and Semantic Scholar, filtered by the specified year.
- URL Params:
name
(string): The name of the author.year
(integer): The publication year to filter by.
To retrieve all publications for an author named "John Doe" from Google Scholar:
curl -X GET http://127.0.0.1:8000/api/google-scholar/publications/john%20doe/
- Fork the repository.
- Create your feature branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -m 'Add your feature'
). - Push to the branch (
git push origin feature/your-feature
). - Create a new Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.