This is a simple API that provides information about a game. It's built using FastAPI and provides endpoints to access various game-related information.
- Install the required dependencies:
pip install -r requirements.txt- Run the API server:
python main.pyThe API will be available at http://localhost:8000
This API is configured for deployment on Render.com. Here's how to deploy it:
- Create a GitHub repository and push your code to it
- Sign up for a free account at Render.com
- Click "New +" and select "Web Service"
- Connect your GitHub repository
- Configure the service:
- Name: Choose a name for your service
- Environment: Python
- Build Command:
pip install -r requirements.txt - Start Command:
uvicorn main:app --host 0.0.0.0 --port $PORT - Plan: Free
Your API will be automatically deployed and available at https://your-service-name.onrender.com
- URL:
/ - Method: GET
- Description: Welcome message and basic information about the API
- URL:
/game-info - Method: GET
- Description: Returns all available information about the game
- Response: Complete game information including name, version, description, genres, release date, developer, and publisher
- URL:
/game-info/{field} - Method: GET
- Description: Returns specific information about the game
- Parameters:
field: The specific information you want to retrieve (e.g., name, version, description, genres, release_date, developer, publisher)
- Response: The requested specific information
# Get all game information
curl http://localhost:8000/game-info
# Get specific information (e.g., game name)
curl http://localhost:8000/game-info/nameOnce the server is running, you can access the interactive API documentation at:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc