### Install CSFloat API Client Source: https://github.com/rushifakami/csfloat_api/blob/main/README.md Installs the csfloat_api Python package using pip. This is the primary method for adding the library to your project. ```bash pip install csfloat_api ``` -------------------------------- ### Get Offers API Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieve your offer timeline, showing both sent and received offers. ```APIDOC ## GET /offers ### Description Retrieve your offer timeline showing sent and received offers. ### Method GET ### Endpoint /offers ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of offers to retrieve. ### Request Example ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: offers = await client.get_offers(limit=40) print(f"Recent Offers:") for offer in offers.get("data", []): print(f" Offer ID: {offer['id']}") print(f" Price: ${offer['price'] / 100:.2f}") print(f" State: {offer.get('state', 'N/A')}") print() asyncio.run(main()) ``` ### Response #### Success Response (200) - **data** (array) - A list of offer objects. - **id** (string) - The unique identifier for the offer. - **price** (integer) - The price of the offer in cents. - **state** (string) - The current state of the offer (e.g., 'accepted', 'declined', 'pending'). #### Response Example ```json { "data": [ { "id": "offer_123", "price": 5000, "state": "accepted" } ] } ``` ``` -------------------------------- ### Quick Start: Fetch Listings and Create Buy Order (Python) Source: https://github.com/rushifakami/csfloat_api/blob/main/README.md Demonstrates basic usage of the CSFloat client. It shows how to initialize the client, fetch listings within a price range, and create a buy order. Requires an API key and uses asyncio for asynchronous operations. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="YOUR_API_KEY") as client: # Fetch up to 50 listings priced between $1.00 and $10.00 (i.e., 100–1000 cents) listings = await client.get_all_listings(min_price=100, max_price=1000) for listing in listings["listings"]: print(f"ID: {listing.id}, Price: {listing.price} cents, Float: {listing.item.float_value}") # Create a buy order for an item buy_order = await client.create_buy_order( market_hash_name="AK-47 | Redline (Field-Tested)", max_price=5000, # 5000 cents = $50.00 quantity=1 ) print(buy_order) asyncio.run(main()) ``` -------------------------------- ### Get My Buy Orders Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves a paginated list of your active buy orders on CSFloat. ```APIDOC ## GET /api/v1/user/buy-orders ### Description Retrieve your own active buy orders with pagination support. ### Method GET ### Endpoint /api/v1/user/buy-orders ### Query Parameters - **page** (integer) - Optional - The page number for pagination. - **limit** (integer) - Optional - The number of items to return per page. ### Response #### Success Response (200) - **data** (array) - An array of buy order objects. - **id** (string) - The unique identifier for the buy order. - **market_hash_name** (string) - The name of the item. - **max_price** (integer) - The maximum price set for the buy order (in cents). - **quantity** (integer) - The quantity of the item for the buy order. #### Response Example { "data": [ { "id": "order_id_123", "market_hash_name": "AK-47 | Asiimov (Battle-Scarred)", "max_price": 150000, "quantity": 1 } ] } ``` -------------------------------- ### Get Inventory Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves your Steam inventory items that are available to be listed on CSFloat. ```APIDOC ## GET /api/v1/user/inventory ### Description Retrieve your Steam inventory items that can be listed on CSFloat. ### Method GET ### Endpoint /api/v1/user/inventory ### Response #### Success Response (200) - **data** (array) - An array of inventory item objects. - **asset_id** (string) - The unique asset ID of the item. - **market_hash_name** (string) - The name of the item. - **float_value** (number) - The float value of the item (if available). - **tradable** (boolean) - Indicates if the item is tradable. #### Response Example { "data": [ { "asset_id": "asset_id_456", "market_hash_name": "M4A4 | Howl (Factory New)", "float_value": 0.0078, "tradable": true } ] } ``` -------------------------------- ### Get Watchlist Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves items that you have added to your CSFloat watchlist. ```APIDOC ## GET /api/v1/user/watchlist ### Description Retrieve items you've added to your watchlist. ### Method GET ### Endpoint /api/v1/user/watchlist ### Query Parameters - **limit** (integer) - Optional - The number of items to return per page. ### Response #### Success Response (200) - **data** (array) - An array of watchlist item objects. - **id** (string) - The unique identifier for the listing on the watchlist. - **item** (object) - Information about the item. - **market_hash_name** (string) - The name of the item. - **price** (integer) - The price of the item on the watchlist (in cents). #### Response Example { "data": [ { "id": "listing_id_112", "item": { "market_hash_name": "AWP | Dragon Lore (Battle-Scarred)" }, "price": 500000 } ] } ``` -------------------------------- ### Get Similar Listings API Source: https://context7.com/rushifakami/csfloat_api/llms.txt Find listings similar to a specific item. Useful for price comparison and market analysis. ```APIDOC ## GET /listings/{listing_id}/similar ### Description Find listings similar to a specific item. Useful for price comparison and market analysis. ### Method GET ### Endpoint `/listings/{listing_id}/similar` ### Parameters #### Path Parameters - **listing_id** (integer) - Required - The ID of the listing to find similar items for. ### Request Example ```python # Example using the Python client import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: similar_listings = await client.get_similar(listing_id=123456789) for listing in similar_listings: print(listing) asyncio.run(main()) ``` ### Response #### Success Response (200) - **listings** (array) - An array of similar listing objects. - Each object contains details similar to the 'Get Specific Listing' response. #### Response Example ```json [ { "id": 987654321, "type": "sell", "price": 145000, "item": { "market_hash_name": "AWP | Dragon Lore (Factory New)", "float_value": 0.00150 } }, { "id": 112233445, "type": "sell", "price": 155000, "item": { "market_hash_name": "AWP | Dragon Lore (Factory New)", "float_value": 0.00110 } } ] ``` ``` -------------------------------- ### Get Pending Trades Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves trades that are currently pending completion. ```APIDOC ## GET /api/v1/user/trades/pending ### Description Retrieve trades that are pending completion. ### Method GET ### Endpoint /api/v1/user/trades/pending ### Query Parameters - **limit** (integer) - Optional - The number of items to return per page. - **page** (integer) - Optional - The page number for pagination. ### Response #### Success Response (200) - **trades** (array) - An array of pending trade objects. - **id** (string) - The unique identifier for the trade. - **state** (string) - The current state of the trade. - **created_at** (string) - The timestamp when the trade was created. #### Response Example { "trades": [ { "id": "trade_id_789", "state": "pending", "created_at": "2023-10-27T11:00:00Z" } ] } ``` -------------------------------- ### Get Offers Timeline with Python Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves a timeline of sent and received offers from the CSFloat API. Requires an API key and uses asyncio for asynchronous operations. Outputs offer IDs, prices, and states. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: offers = await client.get_offers(limit=40) print(f"Recent Offers:") for offer in offers.get("data", []): print(f" Offer ID: {offer['id']}") print(f" Price: ${offer['price'] / 100:.2f}") print(f" State: {offer.get('state', 'N/A')}") print() asyncio.run(main()) ``` -------------------------------- ### GET /listings Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieve marketplace listings with extensive filtering options. Supports filtering by price range (in cents), float value, rarity, category, paint seed/index, and more. Returns paginated results with cursor-based navigation. ```APIDOC ## GET /listings ### Description Retrieve marketplace listings with extensive filtering options. Supports filtering by price range (in cents), float value, rarity, category, paint seed/index, and more. Returns paginated results with cursor-based navigation. ### Method GET ### Endpoint /listings ### Parameters #### Path Parameters None #### Query Parameters - **min_price** (integer) - Optional - Minimum price in cents. - **max_price** (integer) - Optional - Maximum price in cents. - **min_float** (float) - Optional - Minimum float value. - **max_float** (float) - Optional - Maximum float value. - **sort_by** (string) - Optional - Sorting criteria. Options: `lowest_price`, `highest_price`, `most_recent`, `expires_soon`, `lowest_float`, `highest_float`, `best_deal`, `highest_discount`, `float_rank`, `num_bids`. - **category** (integer) - Optional - Category filter. 0=any, 1=normal, 2=stattrak, 3=souvenir. - **limit** (integer) - Optional - Maximum number of listings per request (default 50). - **type_** (string) - Optional - Type of listing. Options: `buy_now`, `auction`. - **cursor** (string) - Optional - Cursor for pagination. #### Request Body None ### Request Example ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: # Get listings with filters result = await client.get_all_listings( min_price=100, # $1.00 minimum max_price=50000, # $500.00 maximum min_float=0.0, # Factory New starts at 0.0 max_float=0.07, # Factory New ends at 0.07 sort_by="best_deal", # Options: lowest_price, highest_price, most_recent, # expires_soon, lowest_float, highest_float, # best_deal, highest_discount, float_rank, num_bids category=0, # 0=any, 1=normal, 2=stattrak, 3=souvenir limit=50, # Max 50 per request type_="buy_now" # "buy_now" or "auction" ) for listing in result["listings"]: print(f"ID: {listing.id}") print(f" Item: {listing.item.market_hash_name}") print(f" Price: ${listing.price / 100:.2f}") print(f" Float: {listing.item.float_value}") print(f" Seller: {listing.seller.username}") print() # Pagination with cursor if result["cursor"]: next_page = await client.get_all_listings( cursor=result["cursor"], limit=50 ) print(f"Next page has {len(next_page['listings'])} listings") asyncio.run(main()) ``` ### Response #### Success Response (200) - **listings** (array) - An array of listing objects. - **cursor** (string) - A cursor for fetching the next page of results, or null if there are no more pages. #### Response Example ```json { "listings": [ { "id": "1234567890", "price": 150000, "seller": { "id": "seller_id_1", "username": "CSFloatUser", "avatar": "url_to_avatar" }, "item": { "id": "item_id_1", "market_hash_name": "AK-47 | Redline (Field-Tested)", "float_value": 0.15, "paint_seed": 123, "paint_index": 456, "rarity": "Mil-Spec", "asset_id": "asset_id_1" }, "steam_market_url": "https://steamcommunity.com/market/listings/730/AK-47%20%7C%20Redline%20%28Field-Tested%29" } ], "cursor": "next_cursor_string" } ``` ``` -------------------------------- ### Get Account Standing API Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieve your account standing and any restrictions applied to your account. ```APIDOC ## GET /account/standing ### Description Retrieve your account standing and any restrictions. ### Method GET ### Endpoint /account/standing ### Parameters No parameters required. ### Request Example ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: standing = await client.get_account_standing() print(f"Account Standing:") print(f" Status: {standing.get('status', 'N/A')}") print(f" Restrictions: {standing.get('restrictions', [])}") asyncio.run(main()) ``` ### Response #### Success Response (200) - **status** (string) - The current status of your account (e.g., 'good', 'restricted'). - **restrictions** (array) - A list of restrictions applied to your account. #### Response Example ```json { "status": "good", "restrictions": [] } ``` ``` -------------------------------- ### Get Buy Orders for Listing API Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieve active buy orders for a specific listing. Shows what buyers are willing to pay. ```APIDOC ## GET /listings/{listing_id}/buy-orders ### Description Retrieve active buy orders for a specific listing. Shows what buyers are willing to pay. ### Method GET ### Endpoint `/listings/{listing_id}/buy-orders` ### Parameters #### Path Parameters - **listing_id** (integer) - Required - The ID of the listing to get buy orders for. #### Query Parameters - **limit** (integer) - Optional - The maximum number of buy orders to retrieve. Defaults to 10. ### Request Example ```python # Example using the Python client import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: buy_orders = await client.get_buy_orders(listing_id=123456789, limit=10) for order in buy_orders: print(order) asyncio.run(main()) ``` ### Response #### Success Response (200) - **buy_orders** (array) - An array of buy order objects. - **id** (integer) - The ID of the buy order. - **price** (integer) - The price of the buy order in cents. - **qty** (integer) - The quantity of items for this buy order. - **created_at** (string) - The timestamp when the buy order was created. #### Response Example ```json [ { "id": 1001, "price": 140000, "qty": 1, "created_at": "2023-10-27T09:00:00Z" }, { "id": 1002, "price": 135000, "qty": 2, "created_at": "2023-10-27T08:30:00Z" } ] ``` ``` -------------------------------- ### Get Trade History Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves your completed trade history, either as a buyer or a seller. ```APIDOC ## GET /api/v1/user/trades/history ### Description Retrieve completed trade history as buyer or seller. ### Method GET ### Endpoint /api/v1/user/trades/history ### Query Parameters - **role** (string) - Required - The role in the trade ('buyer' or 'seller'). - **limit** (integer) - Optional - The number of items to return per page. - **page** (integer) - Optional - The page number for pagination. ### Response #### Success Response (200) - **trades** (array) - An array of completed trade objects. - **id** (string) - The unique identifier for the trade. - **state** (string) - The final state of the trade. - **created_at** (string) - The timestamp when the trade was created. #### Response Example { "trades": [ { "id": "trade_id_101", "state": "completed", "created_at": "2023-10-26T12:00:00Z" } ] } ``` -------------------------------- ### Get Specific Listing API Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieve detailed information about a single listing by its ID. Returns a Listing object with full item details, seller information, and pricing. ```APIDOC ## GET /listings/{listing_id} ### Description Retrieve detailed information about a single listing by its ID. Returns a Listing object with full item details, seller information, and pricing. ### Method GET ### Endpoint `/listings/{listing_id}` ### Parameters #### Path Parameters - **listing_id** (integer) - Required - The unique identifier of the listing. ### Request Example ```python # Example using the Python client import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: listing = await client.get_specific_listing(listing_id=123456789) print(listing) asyncio.run(main()) ``` ### Response #### Success Response (200) - **listing** (object) - Contains detailed information about the listing. - **id** (integer) - The listing ID. - **type** (string) - The type of listing (e.g., 'sell', 'buy'). - **price** (integer) - The price of the listing in cents. - **state** (string) - The current state of the listing. - **created_at** (string) - The timestamp when the listing was created. - **description** (string) - The description of the listing. - **watchers** (integer) - The number of users watching the listing. - **item** (object) - Details about the item. - **market_hash_name** (string) - The full name of the item. - **float_value** (number) - The float value of the item. - **paint_seed** (integer) - The paint seed of the item. - **rarity_name** (string) - The rarity of the item. - **is_stattrak** (boolean) - Whether the item is StatTrak. - **is_souvenir** (boolean) - Whether the item is Souvenir. - **stickers** (array) - An array of sticker objects if present. - **name** (string) - The name of the sticker. - **slot** (integer) - The slot the sticker is in. - **wear** (number) - The wear value of the sticker. - **seller** (object) - Information about the seller. - **username** (string) - The seller's username. - **online** (boolean) - Whether the seller is currently online. - **statistics** (object) - Seller's trading statistics. - **total_trades** (integer) - Total number of trades completed by the seller. #### Response Example ```json { "id": 123456789, "type": "sell", "price": 150000, "state": "active", "created_at": "2023-10-27T10:00:00Z", "description": "Rare item for sale", "watchers": 50, "item": { "market_hash_name": "AWP | Dragon Lore (Factory New)", "float_value": 0.00123, "paint_seed": 123, "rarity_name": "Covert", "is_stattrak": false, "is_souvenir": false, "stickers": [ { "name": "Katowice 2014", "slot": 0, "wear": 0.1 } ] }, "seller": { "username": "CSGOTrader", "online": true, "statistics": { "total_trades": 1000 } } } ``` ``` -------------------------------- ### Get User Stall API Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieve a user's public stall showing all their listed items for sale. ```APIDOC ## GET /user/{user_id}/stall ### Description Retrieve a user's public stall showing all their listed items for sale. ### Method GET ### Endpoint `/user/{user_id}/stall` ### Parameters #### Path Parameters - **user_id** (integer or string) - Required - The Steam ID of the user whose stall to retrieve. #### Query Parameters - **limit** (integer) - Optional - The maximum number of listings to retrieve. Defaults to 40. ### Request Example ```python # Example using the Python client import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: # Get stall by Steam ID (as integer) stall = await client.get_stall(user_id=76561198012345678, limit=40) for listing in stall.listings: print(listing) asyncio.run(main()) ``` ### Response #### Success Response (200) - **stall** (object) - Contains the user's stall information. - **listings** (array) - An array of listing objects available in the user's stall. - Each object contains details similar to the 'Get Specific Listing' response. #### Response Example ```json { "listings": [ { "id": 100000001, "type": "sell", "price": 20000, "item": { "market_hash_name": "AK-47 | Redline (Field-Tested)", "float_value": 0.25000 } }, { "id": 100000002, "type": "sell", "price": 5000, "item": { "market_hash_name": "M4A4 | Asiimov (Battle-Scarred)", "float_value": 0.75000 } } ] } ``` ``` -------------------------------- ### Get User Profile (Me) API Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieve the authenticated user's profile information including balance, statistics, and preferences. ```APIDOC ## GET /user/me ### Description Retrieve the authenticated user's profile information including balance, statistics, and preferences. ### Method GET ### Endpoint `/user/me` ### Parameters None ### Request Example ```python # Example using the Python client import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: me = await client.get_me() print(me) asyncio.run(main()) ``` ### Response #### Success Response (200) - **me** (object) - Contains the authenticated user's profile information. - **user** (object) - User details. - **username** (string) - The user's username. - **steam_id** (string) - The user's Steam ID. - **balance** (integer) - The user's available balance in cents. - **pending_balance** (integer) - The user's pending balance in cents. - **fee** (number) - The user's fee rate (e.g., 0.05 for 5%). - **has_2fa** (boolean) - Whether two-factor authentication is enabled. - **online** (boolean) - Whether the user is currently online. - **statistics** (object) - User's trading statistics. - **total_sales** (integer) - Total number of sales. - **total_purchases** (integer) - Total number of purchases. - **total_trades** (integer) - Total number of trades. - **total_verified_trades** (integer) - Total number of verified trades. - **median_trade_time** (integer) - Median trade completion time in seconds. - **preferences** (object) - User's preferences. - **offers_enabled** (boolean) - Whether offers are enabled. - **max_offer_discount** (number) - The maximum discount percentage for offers. - **pending_offers** (integer) - The number of pending offers. - **actionable_trades** (integer) - The number of trades requiring action. #### Response Example ```json { "user": { "username": "MyUsername", "steam_id": "76561198012345678", "balance": 50000, "pending_balance": 10000, "fee": 0.05, "has_2fa": true, "online": true, "statistics": { "total_sales": 500, "total_purchases": 750, "total_trades": 1250, "total_verified_trades": 1200, "median_trade_time": 120 }, "preferences": { "offers_enabled": true, "max_offer_discount": 15.0 } }, "pending_offers": 5, "actionable_trades": 2 } ``` ``` -------------------------------- ### Get My Buy Orders - Python Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves a user's active buy orders with support for pagination. Requires an API key and returns a list of orders, including ID, item name, max price, and quantity. Handles potential missing data gracefully. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: my_orders = await client.get_my_buy_orders(page=0, limit=10) print(f"My Buy Orders:") for order in my_orders.get("data", []): print(f" ID: {order['id']}") print(f" Item: {order.get('market_hash_name', 'N/A')}") print(f" Max Price: ${order['max_price'] / 100:.2f}") print(f" Quantity: {order['quantity']}") print() asyncio.run(main()) ``` -------------------------------- ### Get Transactions Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves your account transaction history, including deposits, withdrawals, and trade settlements. ```APIDOC ## GET /api/v1/user/transactions ### Description Retrieve account transaction history including deposits, withdrawals, and trade settlements. ### Method GET ### Endpoint /api/v1/user/transactions ### Query Parameters - **page** (integer) - Optional - The page number for pagination. - **limit** (integer) - Optional - The number of items to return per page. ### Response #### Success Response (200) - **data** (array) - An array of transaction objects. - **type** (string) - The type of transaction (e.g., 'deposit', 'withdrawal', 'trade_settlement'). - **amount** (integer) - The amount of the transaction (in cents). - **created_at** (string) - The timestamp when the transaction occurred. #### Response Example { "data": [ { "type": "deposit", "amount": 100000, "created_at": "2023-10-27T13:00:00Z" } ] } ``` -------------------------------- ### Get Exchange Rates API Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieve the current currency exchange rates used by CSFloat. ```APIDOC ## GET /exchange-rates ### Description Retrieve current currency exchange rates used by CSFloat. ### Method GET ### Endpoint /exchange-rates ### Parameters No parameters required. ### Request Example ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: rates = await client.get_exchange_rates() print(f"Exchange Rates (base: USD):") for currency, rate in rates.items(): print(f" {currency}: {rate}") asyncio.run(main()) ``` ### Response #### Success Response (200) - **(object)** - An object where keys are currency codes (e.g., "USD", "EUR") and values are their corresponding exchange rates. #### Response Example ```json { "USD": 1.0, "EUR": 0.92, "GBP": 0.79 } ``` ``` -------------------------------- ### Get Sales History Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves historical sales data for a specific item, useful for price analysis. ```APIDOC ## GET /api/v1/market/sales ### Description Retrieve historical sales data for a specific item by market hash name. Useful for price analysis. ### Method GET ### Endpoint /api/v1/market/sales ### Query Parameters - **market_hash_name** (string) - Required - The market hash name of the item. - **paint_index** (integer) - Optional - Filter by paint index. - **page** (integer) - Optional - The page number for pagination. - **limit** (integer) - Optional - The number of items to return per page. ### Response #### Success Response (200) - **data** (array) - An array of sales objects. - **price** (integer) - The price the item was sold for (in cents). - **float_value** (number) - The float value of the item at the time of sale (if available). - **sold_at** (string) - The timestamp when the item was sold. #### Response Example { "data": [ { "price": 50000, "float_value": 0.1234, "sold_at": "2023-10-27T10:00:00Z" } ] } ``` -------------------------------- ### Get Similar Listings - Python Source: https://context7.com/rushifakami/csfloat_api/llms.txt Finds CSFloat listings that are similar to a given listing ID. This is useful for market analysis and price comparisons. It requires an API key and returns a list of similar listing objects. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: similar = await client.get_similar(listing_id=123456789) print(f"Found {len(similar)} similar listings:") for listing in similar: print(f" ID: {listing.id} - ${listing.price / 100:.2f} - Float: {listing.item.float_value}") asyncio.run(main()) ``` -------------------------------- ### Get Transactions - Python Source: https://context7.com/rushifakami/csfloat_api/llms.txt Fetches the account's transaction history, including deposits, withdrawals, and trade settlements. It supports pagination and limit parameters. Each transaction record shows its type, amount, and timestamp. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: transactions = await client.get_transactions(page=0, limit=10) print(f"Recent Transactions:") for tx in transactions.get("data", []): print(f" Type: {tx.get('type', 'N/A')}") print(f" Amount: ${tx.get('amount', 0) / 100:.2f}") print(f" Date: {tx.get('created_at', 'N/A')}") print() asyncio.run(main()) ``` -------------------------------- ### Get All CSFloat Listings with Filters (Python) Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves marketplace listings with extensive filtering options including price, float value, rarity, and category. Supports pagination using cursors and allows specifying the listing type ('buy_now' or 'auction'). ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: # Get listings with filters result = await client.get_all_listings( min_price=100, # $1.00 minimum max_price=50000, # $500.00 maximum min_float=0.0, # Factory New starts at 0.0 max_float=0.07, # Factory New ends at 0.07 sort_by="best_deal", # Options: lowest_price, highest_price, most_recent, # expires_soon, lowest_float, highest_float, # best_deal, highest_discount, float_rank, num_bids category=0, # 0=any, 1=normal, 2=stattrak, 3=souvenir limit=50, # Max 50 per request type_="buy_now" # "buy_now" or "auction" ) for listing in result["listings"]: print(f"ID: {listing.id}") print(f" Item: {listing.item.market_hash_name}") print(f" Price: ${listing.price / 100:.2f}") print(f" Float: {listing.item.float_value}") print(f" Seller: {listing.seller.username}") print() # Pagination with cursor if result["cursor"]: next_page = await client.get_all_listings( cursor=result["cursor"], limit=50 ) print(f"Next page has {len(next_page['listings'])} listings") asyncio.run(main()) ``` -------------------------------- ### Get Account Standing with Python Source: https://context7.com/rushifakami/csfloat_api/llms.txt Fetches the user's account standing and any associated restrictions from the CSFloat API. This asynchronous function requires an API key and outputs the account status and restrictions. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: standing = await client.get_account_standing() print(f"Account Standing:") print(f" Status: {standing.get('status', 'N/A')}") print(f" Restrictions: {standing.get('restrictions', [])}") asyncio.run(main()) ``` -------------------------------- ### Get Specific Listing Details - Python Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves detailed information for a single CSFloat listing using its ID. Requires an API key and returns a comprehensive Listing object including item, seller, and pricing details. Handles potential sticker information. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: listing = await client.get_specific_listing(listing_id=123456789) print(f"Listing ID: {listing.id}") print(f"Type: {listing.type}") print(f"Price: ${listing.price / 100:.2f}") print(f"State: {listing.state}") print(f"Created: {listing.created_at}") print(f"Description: {listing.description}") print(f"Watchers: {listing.watchers}") # Item details item = listing.item print(f"\nItem Details:") print(f" Name: {item.market_hash_name}") print(f" Float: {item.float_value}") print(f" Paint Seed: {item.paint_seed}") print(f" Rarity: {item.rarity_name}") print(f" StatTrak: {item.is_stattrak}") print(f" Souvenir: {item.is_souvenir}") # Stickers if present if item.stickers: print(f"\nStickers:") for sticker in item.stickers: print(f" - {sticker.name} (Slot {sticker.slot}, Wear: {sticker.wear})") # Seller info seller = listing.seller print(f"\nSeller: {seller.username}") print(f" Online: {seller.online}") print(f" Total Trades: {seller.statistics.total_trades}") asyncio.run(main()) ``` -------------------------------- ### Get Watchlist - Python Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves items that the user has added to their watchlist. The function supports a limit parameter and returns details for each item, including listing ID, item name, and price. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: watchlist = await client.get_watchlist(limit=40) print(f"Watchlist Items:") for item in watchlist.get("data", []): print(f" Listing ID: {item['id']}") print(f" Name: {item['item']['market_hash_name']}") print(f" Price: ${item['price'] / 100:.2f}") print() asyncio.run(main()) ``` -------------------------------- ### Get CSFloat Exchange Rates with Python Source: https://context7.com/rushifakami/csfloat_api/llms.txt Fetches current currency exchange rates used by CSFloat. This function requires an API key and utilizes asyncio. It prints exchange rates relative to USD. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: rates = await client.get_exchange_rates() print(f"Exchange Rates (base: USD):") for currency, rate in rates.items(): print(f" {currency}: {rate}") asyncio.run(main()) ``` -------------------------------- ### Get Authenticated User Profile - Python Source: https://context7.com/rushifakami/csfloat_api/llms.txt Fetches the profile information of the authenticated user, including their balance, trading statistics, and preferences. This requires an API key and provides insights into the user's account status and activity. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: me = await client.get_me() user = me.user print(f"Username: {user.username}") print(f"Steam ID: {user.steam_id}") print(f"Balance: ${user.balance / 100:.2f}") print(f"Pending Balance: ${user.pending_balance / 100:.2f}") print(f"Fee Rate: {user.fee * 100:.1f}%") print(f"2FA Enabled: {user.has_2fa}") print(f"Online: {user.online}") # Statistics stats = user.statistics print(f"\nStatistics:") print(f" Total Sales: {stats.total_sales}") print(f" Total Purchases: {stats.total_purchases}") print(f" Total Trades: {stats.total_trades}") print(f" Verified Trades: {stats.total_verified_trades}") print(f" Median Trade Time: {stats.median_trade_time}s") # Preferences prefs = user.preferences print(f"\nPreferences:") print(f" Offers Enabled: {prefs.offers_enabled}") print(f" Max Offer Discount: {prefs.max_offer_discount}%") # Pending actions print(f"\nPending Actions:") print(f" Pending Offers: {me.pending_offers}") print(f" Actionable Trades: {me.actionable_trades}") asyncio.run(main()) ``` -------------------------------- ### Get User Stall Listings - Python Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves all items listed for sale by a specific user, identified by their Steam ID. This function is useful for viewing a user's public stall and requires an API key. It allows for pagination with a limit parameter. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: # Get stall by Steam ID (as integer) stall = await client.get_stall(user_id=76561198012345678, limit=40) print(f"User has {len(stall.listings)} listings:") for listing in stall.listings: print(f" {listing.item.market_hash_name}") print(f" Price: ${listing.price / 100:.2f}") print(f" Float: {listing.item.float_value}") print() asyncio.run(main()) ``` -------------------------------- ### Get Pending Trades - Python Source: https://context7.com/rushifakami/csfloat_api/llms.txt Fetches a list of trades that are currently pending completion. Supports pagination and limit parameters. The output includes trade ID, state, and creation timestamp for each pending trade. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: pending = await client.get_pending_trades(limit=500, page=0) print(f"Pending Trades:") for trade in pending.get("trades", []): print(f" Trade ID: {trade['id']}") print(f" State: {trade['state']}") print(f" Created: {trade['created_at']}") print() asyncio.run(main()) ``` -------------------------------- ### Get Geographic Location with Python Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves geographic location information based on the client's IP address using the CSFloat API. Requires an API key and asyncio. Outputs country and region. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: location = await client.get_location() print(f"Location Info:") print(f" Country: {location.get('country', 'N/A')}") print(f" Region: {location.get('region', 'N/A')}") asyncio.run(main()) ``` -------------------------------- ### Get Buy Orders for Listing - Python Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves active buy orders for a specific CSFloat listing ID. This function helps understand what buyers are willing to pay for an item. It requires an API key and allows specifying a limit for the number of buy orders returned. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: buy_orders = await client.get_buy_orders(listing_id=123456789, limit=10) print(f"Buy orders for listing:") for order in buy_orders: print(f" Order ID: {order.id}") print(f" Price: ${order.price / 100:.2f}") print(f" Quantity: {order.qty}") print(f" Created: {order.created_at}") print() asyncio.run(main()) ``` -------------------------------- ### Get Inventory - Python Source: https://context7.com/rushifakami/csfloat_api/llms.txt Fetches the user's Steam inventory items that are available for listing on CSFloat. It returns details such as asset ID, item name, float value, and tradable status. The function supports iterating through the inventory data. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: inventory = await client.get_inventory() print(f"Inventory Items:") for item in inventory.get("data", []): print(f" Asset ID: {item['asset_id']}") print(f" Name: {item['market_hash_name']}") print(f" Float: {item.get('float_value', 'N/A')}") print(f" Tradable: {item.get('tradable', False)}") print() asyncio.run(main()) ``` -------------------------------- ### Get Trade History - Python Source: https://context7.com/rushifakami/csfloat_api/llms.txt Retrieves the user's trade history, allowing filtering by role (buyer or seller). It supports pagination and limit parameters to fetch recent completed trades. The function provides counts for both sales and purchases. ```python import asyncio from csfloat_api.csfloat_client import Client async def main(): async with Client(api_key="your_api_key_here") as client: # Get sales history (as seller) sales = await client.get_trade_history(role="seller", limit=30, page=0) print(f"Recent Sales: {len(sales.get('trades', []))} trades") # Get purchase history (as buyer) purchases = await client.get_trade_history(role="buyer", limit=30, page=0) print(f"Recent Purchases: {len(purchases.get('trades', []))} trades") asyncio.run(main()) ```