A FastAPI-based REST API for scraping game data from Steam.
- Get detailed game information using Steam App ID
- Search for games using keywords
- Retrieve game prices, descriptions, tags, ratings, and release dates
- Clone this repository
- Install dependencies:
pip install -r requirements.txt- Start the development server:
python -m uvicorn main:app --reload- Install dependencies:
pip install -r requirements.txt- Create a .env file in the project root directory and add:
PORT=8000
HOST=0.0.0.0
- Run with Waitress (Production Server):
python run_server.py- Download and install ngrok from: https://ngrok.com/download
- Extract the ngrok.exe to a convenient location
- Open command prompt and navigate to ngrok location
- Start ngrok tunnel:
ngrok http 8000- Use the provided ngrok URL to access your API
- Get a domain name
- Set up port forwarding on your router to forward port 80/443 to your desktop's port 8000
- Configure your domain's DNS to point to your public IP
- (Recommended) Set up SSL using Let's Encrypt or Cloudflare
- Make sure Windows Firewall allows incoming connections on port 8000
- In production, update CORS settings in main.py to only allow your specific domains:
app.add_middleware(
CORSMiddleware,
allow_origins=["https://yourwebsite.com"],
allow_credentials=True,
allow_methods=["GET"],
allow_headers=["*"],
)- Consider adding rate limiting
- Monitor server logs for abuse
- Keep dependencies updated
- Configure Windows Firewall appropriately
- Welcome message
- Returns:
{"message": "Welcome to Steam Scraper API"}
- Get detailed information about a specific game
- Parameters:
app_id: Steam App ID of the game
- Returns: Game details including title, price, description, tags, rating, and release date
- Search for games on Steam
- Parameters:
query: Search termlimit: Maximum number of results (default: 10)
- Returns: List of matching games with basic information
// Example of calling the API from your website
async function getGameDetails(appId) {
const response = await fetch(`https://your-api-domain.com/game/${appId}`);
const data = await response.json();
return data;
}-
If you get permission errors:
- Run the command prompt as administrator
- Check Windows Defender settings
-
If the server isn't accessible:
- Check Windows Firewall settings
- Verify the port isn't being used by another application
- Use
netstat -anoto check port usage
-
If ngrok fails:
- Make sure no other ngrok instances are running
- Check if port 8000 is available
- Run Command Prompt as administrator
- Please be mindful of Steam's rate limiting and terms of service when using this API
- Consider implementing caching for frequently requested data
- Monitor your system resources when running in production