A FastAPI API to pull research papers through keywords, summarize papers, and get citations
📚 ScholarSearch API
An open-source research paper discovery and summarization API using the arXiv API, built with FastAPI and powered by OpenAI or Hugging Face for natural language summarization.
- 🔍 Search academic papers by keyword using arXiv
- 📄 Retrieve metadata: title, abstract, authors, publication date, PDF link
- 🧠 Summarize abstracts or full papers using GPT-4o or BART (pluggable)
- 📎 Format citations in BibTeX (APA/MLA support coming soon!)
- 📉 Built-in rate limiting to prevent abuse
- 🔒 (Optional) API key authentication and per-user quotas (easy to add)
git clone https://github.com/your-username/scholarsearch-api.git
cd scholarsearch-api
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtCreate a .env file based on the example:
cp .env.example .envEdit .env and add your OpenAI API key:
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
uvicorn main:app --reloadVisit http://localhost:8000/docs for interactive API docs (via Swagger UI).
Search arXiv by keyword.
Example:
GET /api/search?query=transformers&limit=5
Summarize text using GPT.
Example:
GET /api/summarize?text=Deep%20learning%20is...&length=short
Query Params:
text– The content to summarizelength– short, medium, or long
Generate a simple citation string.
Example:
GET /api/citation?title=AI%20and%20Robotics&authors=Alice,Bob&published=2023-05-01
scholarsearch-api/
├── main.py # FastAPI app and routes
├── rarxiv.py # arXiv search wrapper
├── summarizer.py # Summarization logic (GPT or BART)
├── citation.py # Citation formatting
├── requirements.txt # Dependencies
├── .env.example # API key config template
├── README.md # Project documentation
- Add support for HuggingFace Transformers (BART/PEGASUS)
- Format citations in APA and MLA
- Add
/registerendpoint to generate API keys - Add usage quotas and tracking
- Deploy to Render, Vercel, or Hugging Face Spaces
This project is licensed under the MIT License.
Pull requests are welcome! If you’d like to contribute:
- Fork the repo
- Make your changes
- Submit a PR
Let’s build a better way to search and understand research 📚