Steamy API is a comprehensive API designed to manage users, handle items, and seamlessly integrate with the Steam platform. It allows you to create and update users, manage their favorite items, and retrieve detailed information about Steam users and items.
- User Management: Create, update, and manage users and their favorite items.
- Steam Integration: Retrieve information about Steam users, including their statistics, achievements, games, and more.
- Item Handling: Access detailed information about item prices, sales history, liquidity, and other characteristics.
- Security: Authenticate requests using API keys to ensure secure access.
- Python 3.8+
- FastAPI: A modern, fast (high-performance) web framework for building APIs with Python.
- Uvicorn: A lightning-fast ASGI server for Python.
- Other dependencies: Listed in the
requirements.txtfile.
-
Clone the Repository:
git clone https://github.com/S1nuxoff/Steamy-API cd steamy-api -
Create and Activate a Virtual Environment:
python -m venv venv source venv/bin/activate # For Windows: venv\Scripts�ctivate
-
Install Dependencies:
pip install -r requirements.txt
-
Configure Environment Variables:
Create a
.envfile and add the necessary variables, for example:API_KEY=your_api_key DATABASE_URL=your_database_url
-
Run the Server:
uvicorn main:app --reload
The server will be available at
http://localhost:8000.
FastAPI automatically generates interactive documentation for your API, accessible at the following routes:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
The API uses API keys to authenticate requests. You must include your API key in the X-API-KEY header of each request.
curl -H "X-API-KEY: your_api_key" "http://localhost:8000/api/v1/user/?tg_id=123456"-
GET
/api/v1/user/
Retrieve a user by Telegram ID.Query Parameters:
tg_id(integer, required): Telegram ID of the user.
-
GET
/api/v1/user/favorites
Retrieve a user's favorite items.Query Parameters:
tg_id(integer, required): Telegram ID of the user.game(string, optional): Name of the game.
-
POST
/api/v1/user/create
Create a new user.Request Body:
{ "tg_id": 123456, "username": "example_user", "language": "en" } -
PATCH
/api/v1/user/update
Update user information.Query Parameters:
tg_id(integer, required): Telegram ID of the user.
Request Body:
{ "username": "new_username", "steam_id": 789012, "premium": true, "language": "ru", "currency": "USD", "game": "CS:GO" } -
POST
/api/v1/user/add_favorite
Add an item to favorites.Query Parameters:
tg_id(integer, required): Telegram ID of the user.
Request Body:
{ "item": "AK-47", "game": "CS:GO" } -
DELETE
/api/v1/user/remove_favorite
Remove an item from favorites.Query Parameters:
tg_id(integer, required): Telegram ID of the user.
Request Body:
{ "item": "AK-47", "game": "CS:GO" }
-
GET
/api/v1/items/
Retrieve item information by name.Query Parameters:
market_hash_name(string, required): Name of the item on the market.
-
GET
/api/v1/steam/user/search
Search for a Steam user by ID.Query Parameters:
steam_id(integer, required): Steam ID of the user.
-
GET
/api/v1/steam/user/stats
Retrieve Steam user statistics.Query Parameters:
steam_id(integer, required): Steam ID of the user.appid(integer, required): Application (game) ID.
-
GET
/api/v1/steam/user/wishlist
Retrieve a Steam user's wishlist.Query Parameters:
steam_id(integer, required): Steam ID of the user.
-
GET
/api/v1/steam/user/bans
Retrieve Steam user ban information.Query Parameters:
steam_id(integer, required): Steam ID of the user.
-
GET
/api/v1/steam/user/badges
Retrieve Steam user badges.Query Parameters:
steam_id(integer, required): Steam ID of the user.
-
GET
/api/v1/steam/user/recently_played_games
Retrieve recently played games of a Steam user.Query Parameters:
steam_id(integer, required): Steam ID of the user.
-
GET
/api/v1/steam/user/friends
Retrieve a Steam user's friends list.Query Parameters:
steam_id(integer, required): Steam ID of the user.
-
GET
/api/v1/steam/user/details
Retrieve detailed information about a Steam user.Query Parameters:
steam_id(integer, required): Steam ID of the user.
-
GET
/api/v1/steam/user/level
Retrieve a Steam user's level.Query Parameters:
steam_id(integer, required): Steam ID of the user.
-
GET
/api/v1/steam/user/achievements
Retrieve a Steam user's achievements.Query Parameters:
steam_id(integer, required): Steam ID of the user.
-
GET
/api/v1/steam/user/owned_games
Retrieve a Steam user's owned games list.Query Parameters:
steam_id(integer, required): Steam ID of the user.
-
GET
/api/v1/steam/item/price
Retrieve the price of an item in the specified currency.Query Parameters:
game(string, required): Name of the game.item(string, required): Name of the item.currency(string, required): Currency.
-
GET
/api/v1/steam/item/sales
Retrieve the sales history of an item.Query Parameters:
currency(string, required): Currency.game(string, required): Name of the game.item(string, required): Name of the item.period(string, optional): Period (day,week,month,lifetime). Default isweek.
-
GET
/api/v1/steam/item/liquidity
Retrieve the liquidity of an item.Query Parameters:
nameid(integer, required): Item ID.
-
GET
/api/v1/steam/item/markets_prices
Retrieve market prices for an item.Query Parameters:
game(string, required): Name of the game.item(string, required): Name of the item.currency(string, required): Currency.
-
GET
/api/v1/steam/item/float
Retrieve the float value of an item.Query Parameters:
rungame_url(string, required): Game URL.
-
GET
/api/v1/steam/item/nameid
Retrieve the Nameid of an item.Query Parameters:
game(string, required): Name of the game.item(string, required): Name of the item.
- GET
/
Root endpoint that returns a welcome message.
{
"id": integer,
"steam_id": integer | null,
"premium": boolean,
"language": string,
"currency": string,
"game": string
}{
"tg_id": integer,
"username": string,
"language": string
}{
"username": string | null,
"steam_id": integer | null,
"premium": boolean | null,
"language": string | null,
"currency": string | null,
"game": string | null
}{
"item": string,
"game": string
}{
"item": string,
"game": string
}{
"id": integer,
"user_id": integer,
"item": string,
"game": string,
"added_at": "2023-10-10T10:00:00Z"
}{
"nameid": integer,
"hash_name": string,
"game": integer,
"id": integer
}{
"detail": [
{
"loc": ["query", "tg_id"],
"msg": "field required",
"type": "value_error.missing"
}
]
}{
"loc": ["body", "username"],
"msg": "field required",
"type": "value_error.missing"
}Request:
curl -X POST "http://localhost:8000/api/v1/user/create" -H "Content-Type: application/json" -H "X-API-KEY: your_api_key" -d '{
"tg_id": 123456,
"username": "example_user",
"language": "en"
}'Response:
{
"id": 1,
"steam_id": null,
"premium": false,
"language": "en",
"currency": "USD",
"game": "CS:GO"
}Request:
curl -X GET "http://localhost:8000/api/v1/user/?tg_id=123456" -H "X-API-KEY: your_api_key"Response:
{
"id": 1,
"steam_id": 789012,
"premium": true,
"language": "ru",
"currency": "USD",
"game": "CS:GO"
}This project is licensed under the MIT License.
If you have any questions or suggestions, feel free to contact us at v.schip4@gmail.com.