TechVault API is a powerful and secure API designed to fetch technical documentation from various sources, specifically MDN Web Docs, and generate concise summaries. This API simplifies access to large documentation files, providing users with key insights quickly and efficiently.
- Fetch MDN Documentation: Retrieve documentation from MDN Web Docs for a given web technology topic.
- Summarization: Extract and display concise content for easy understanding.
- Secure Access: Implemented API security measures to prevent unauthorized access.
- Postman Testing: Fully tested and validated using Postman.
- Backend: Python
- Framework: FastAPI
- Web Scraping: BeautifulSoup
- Security Measures: Input validation, request headers, and error handling
Ensure you have the following installed on your system:
- Python 3.x
- Postman (for testing)
- Clone the repository:
git clone https://github.com/yourusername/techvault-api.git cd techvault-api
- Install dependencies:
pip install fastapi uvicorn beautifulsoup4 requests
- Start the server:
uvicorn main:app --reload
GET /
- Description: Returns a welcome message.
- Request Example:
curl -X GET "http://127.0.0.1:8000/"
- Response:
{ "message": "Welcome to TechVault API" }
GET /mdn/{topic}
- Description: Fetches documentation from MDN Web Docs for a specified topic.
- Request Example:
curl -X GET "http://127.0.0.1:8000/mdn/HTML"
- Response:
{ "title": "HTML", "url": "https://developer.mozilla.org/en-US/docs/Web/HTML", "content": "Brief content extracted from MDN documentation..." }
To ensure security, the following measures have been implemented:
- User-Agent Header: Prevents being blocked by MDN Web Docs.
- Error Handling: Returns appropriate messages if documentation is unavailable.
- Input Validation: Ensures only valid web technologies are queried.
- Open Postman and enter the API URL (
http://127.0.0.1:8000/mdn/{topic}
). - Send a GET request to fetch documentation.
- Validate the response to ensure accurate data retrieval.
- Support for additional documentation sources.
- AI-powered summarization for better insights.
- Web UI to interact with the API visually.