This FastAPI application aggregates gaming news from multiple sources and allows users to retrieve news based on specific topics.
- Fetches gaming news from GameRant and PC Gamer websites.
- Allows filtering news by topics.
- Implements caching mechanism to improve performance.
- Asynchronous fetching of news articles.
- Python 3.7+
- FastAPI
- uvicorn
- BeautifulSoup
- httpx
- cachetools
-
Clone the repository:
-
Install dependencies:
-
Run the application:
-
Access the API using a web browser or tools like cURL or Postman:
- To get all news articles:
- To filter news articles by topic:
Replace your_topic
with the desired topic for filtering news articles.
You can access the hosted version of this application here.
GET /
: Retrieve all news articles or filter by topic.- Query Parameter:
topic
: Optional. Filter news articles by topic.
- Query Parameter:
The application implements caching using the TTLCache
from cachetools
to store previously fetched news articles for faster retrieval.
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License.