API to analyze sentiment of Steam game reviews using Large Language Models.
- We use the Steam API to obtain game reviews
- We process reviews with Llama 3.1-70B via HuggingFace
- We return a concise sentiment analysis summary
GET /Returns system status to verify the server is running.
Response:
{
"status": "system ok",
"message": "Steam Reviews API is running"
}GET /sentiments?game_id={game_id}&limit={limit}Analyzes sentiment for Steam game reviews.
Query Parameters:
game_id(optional): Steam game ID. If not provided, uses default game (2592160)limit(optional): Maximum number of reviews to analyze. Default is 200
Examples:
# Default game with default limit
GET /sentiments
# Specific game (CS:GO) with default limit
GET /sentiments?game_id=730
# Specific game with custom limit
GET /sentiments?game_id=730&limit=100Response:
{
"game_id": 730,
"sentiment": "The reviews for this game are generally positive...",
"reviews_count": 100,
"success": true
}- Python 3.11+
- Docker Compose
- HuggingFace API key
pip install -r requirements.txtexport HUGGINGFACE_API_KEY="your_huggingface_api_key_here"uvicorn main:app --reload --host 0.0.0.0 --port 8000# Run the application with Docker Compose with no logs, remove the -d for logs
docker-compose up -d --build
# Stop the application (keeps containers for quick restart)
docker-compose stop
# For complete removal (stops and removes containers)
docker-compose downNote: Ensure your docker-compose.yaml includes the service definition and environment variables (e.g., via env_file: .env or environment).
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
# Health check
curl http://localhost:8000/
# Analyze CS:GO reviews
curl "http://localhost:8000/sentiments?game_id=730&limit=50"