### HTTP Authorization Header Example Source: https://docs.csgoempire.com/reference/getting-started-with-your-api This snippet demonstrates how to authenticate API requests using an API key as a Bearer token in the HTTP Authorization header. This is a standard method for securing API access. ```http Authorization: Bearer ``` -------------------------------- ### Trade Statuses Source: https://docs.csgoempire.com/reference/getting-started-with-your-api Reference the different status codes associated with trade operations. ```APIDOC ## Trade Statuses | Code | Status | | :--- | :--------------------- | | -1 | Error | | 0 | Pending | | 1 | Received | | 2 | Processing | | 3 | Sending | | 4 | Confirming | | 5 | Sent | | 6 | Completed | | 7 | Declined | | 8 | Canceled | | 9 | Timed Out | | 10 | Credited | | 11 | Disputed | | 13 | CompletedButReversible | ``` -------------------------------- ### Authentication Source: https://docs.csgoempire.com/reference/getting-started-with-your-api Authenticate API requests by including your API key in the Authorization header as a Bearer token. ```APIDOC ## Authentication You can authenticate yourself with our API by adding your API key (bearer token) in the HTTP header. ### Syntax ```text Authorization: ``` ### Example ```text Authorization: Bearer ``` ``` -------------------------------- ### Authentication Source: https://docs.csgoempire.com/reference/index All requests to the CSGOEmpire API must be authenticated. You can authenticate by adding your API key in the `Authorization` header as a Bearer token. ```APIDOC ## Authentication ### Description Authenticate API requests by including your API key in the `Authorization` header. ### Method All HTTP Methods ### Endpoint All Endpoints ### Parameters #### Headers - **Authorization** (string) - Required - `Bearer ` ### Request Example ```http Authorization: Bearer ``` ### Response #### Success Response (200) No specific response for authentication itself, but successful authentication allows access to other endpoints. #### Response Example N/A ``` -------------------------------- ### Rate Limits Source: https://docs.csgoempire.com/reference/getting-started-with-your-api Understand the API rate limits to avoid request restrictions. Exceeding the limit will result in a 429 Too Many Requests status code. ```APIDOC ## Rate Limits Rate limits limit the number of requests you can make per second from one IP. Currently there is a global request limit (to any endpoint) of 120 requests per 60 seconds. If you exceed a ratelimit you'll be unable to access any endpoints for 60 seconds. This will return a response with a status code of **429**. To avoid this, do not constantly poll endpoints - use WebSocket updates whenever possible. ``` -------------------------------- ### Trade Statuses Source: https://docs.csgoempire.com/reference/index This table outlines the various status codes used to represent the state of a trade within the CSGOEmpire system. ```APIDOC ## Trade Statuses ### Description Interprets the meaning of different trade status codes returned by the API. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response #### Trade Status Codes - **-1**: Error - **0**: Pending - **1**: Received - **2**: Processing - **3**: Sending - **4**: Confirming - **5**: Sent - **6**: Completed - **7**: Declined - **8**: Canceled - **9**: Timed Out - **10**: Credited - **11**: Disputed - **13**: CompletedButReversible #### Response Example N/A ``` -------------------------------- ### Rate Limits Source: https://docs.csgoempire.com/reference/index The CSGOEmpire API enforces rate limits to ensure fair usage. Exceeding these limits will result in a 429 Too Many Requests response. ```APIDOC ## Rate Limits ### Description Understand and adhere to the API rate limits to avoid request throttling. ### Method All HTTP Methods ### Endpoint All Endpoints ### Parameters No specific parameters for rate limits, but they are enforced based on request frequency. ### Request Example N/A ### Response #### Error Response (429) - **429** - Too Many Requests - Indicates that the rate limit has been exceeded. #### Response Example ```json { "error": "Rate limit exceeded. Please try again later." } ``` ``` -------------------------------- ### Connect to CSGOEmpire WebSocket with Node.js Source: https://docs.csgoempire.com/reference/connecting-to-the-websocket This JavaScript snippet demonstrates how to connect to the CSGOEmpire WebSocket using the 'socket.io-client' library. It requires an API key for authentication and handles user data retrieval and event subscriptions. Ensure Socket.IO v4.x client is installed. ```javascript const { io } = require('socket.io-client'); const axios = require('axios'); // Replace "YOUR API KEY HERE" with your API key const csgoempireApiKey = "YOUR API KEY HERE"; // Replace domain to '.gg' if '.com' is blocked const domain = "csgoempire.com" const socketEndpoint = `wss://trade.${domain}/trade`; // Set the authorization header for all axios requests to the CSGOEmpire API Key axios.defaults.headers.common['Authorization'] = `Bearer ${csgoempireApiKey}`; let userData = null; let userDataRefreshedAt = null; async function refreshUserData() { if (userDataRefreshedAt && userDataRefreshedAt > Date.now() - 15*1000) { // refreshed less than 15s ago, should be still valid return; } try { // Get the user data from the socket // Token is valid 30s userData = (await axios.get(`https://${domain}/api/v2/metadata/socket`)).data; userDataRefreshedAt = Date.now(); } catch (error) { console.log(`Failed to refresh user data: ${error.message}`); } } // Function for connecting to the web socket async function initSocket() { console.log("Connecting to websocket..."); try { await refreshUserData(); // Initalize socket connection const socket = io( socketEndpoint, { transports: ["websocket"], path: "/s/", secure: true, rejectUnauthorized: false, reconnect: true, query: { uid: userData.user.id, token: userData.socket_token, }, extraHeaders: { 'User-agent': `${userData.user.id} API Bot` } //this lets the server know that this is a bot } ); socket.on('connect', async () => { // Log when connected console.log(`Connected to websocket`); // Handle the Init event socket.on('init', async (data) => { if (data && data.authenticated) { console.log(`Successfully authenticated as ${data.name}`); // Emit the default filters to ensure we receive events socket.emit('filters', { price_max: 9999999 }); } else { await refreshUserData(); // When the server asks for it, emit the data we got earlier to the socket to identify this client as the user socket.emit('identify', { uid: userData.user.id, model: userData.user, authorizationToken: userData.socket_token, signature: userData.socket_signature }); } }) // Listen for the following event to be emitted by the socket after we've identified the user socket.on('timesync', (data) => console.log(`Timesync: ${JSON.stringify(data)}`)); socket.on('new_item', (data) => console.log(`new_item: ${JSON.stringify(data)}`)); socket.on('updated_item', (data) => console.log(`updated_item: ${JSON.stringify(data)}`)); socket.on('auction_update', (data) => console.log(`auction_update: ${JSON.stringify(data)}`)); socket.on('deleted_item', (data) => console.log(`deleted_item: ${JSON.stringify(data)}`)); socket.on('trade_status', (data) => console.log(`trade_status: ${JSON.stringify(data)}`)); socket.on("disconnect", (reason) => console.log(`Socket disconnected: ${reason}`)); }); // Listen for the following event to be emitted by the socket in error cases socket.on("close", (reason) => console.log(`Socket closed: ${reason}`)); socket.on('error', (data) => console.log(`WS Error: ${data}`)); socket.on('connect_error', (data) => console.log(`Connect Error: ${data}`)); } catch (e) { console.log(`Error while initializing the Socket. Error: ${e}`); } }; initSocket(); ``` -------------------------------- ### CSGOEmpire API Item Pagination Example Source: https://docs.csgoempire.com/reference/get-listed-items This example demonstrates how to paginate through trading items using the CSGOEmpire API. It shows the structure of the response, including pagination details like current page, next page URL, and total items. ```json { "current_page": 1, "data": [ { "id": "", "market_name": "", "name_color": "", "price_is_unreliable": "", "market_value": "", "deposit_value": "", "amount": "", "sticker_images": [], "imageurl": "", "inspect_url": "", "stickers": [], "is_commodity": "", "trade_lock_end": null, "trade_lock_end_timestamp": null, "asset_id": "", "class_id": "", "instance_id": "", "asset_value": "", "deposit_value_cents": "", "asset_value_cents": "", "buy_price_cents": "", "buy_price": "", "above_recommended_price": "", "recommended_price": "", "suggested_price": "", "lowest_price": "", "lowest_price_cents": "", "steam_market_price": "", "steam_market_price_cents": "", "steam_market_median_price": "", "steam_market_median_price_cents": "", "our_items_average_price": "", "our_items_average_price_cents": "", "our_items_max_price": "", "our_items_max_price_cents": "", "our_items_min_price": "", "our_items_min_price_cents": "", "our_items_suggested_price": "", "our_items_suggested_price_cents": "", "our_items_price": "", "our_items_price_cents": "", "our_items_lowest_price": "", "our_items_lowest_price_cents": "", "first_seen_at": "", "last_seen_at": "", "first_seen_at_timestamp": "", "last_seen_at_timestamp": "", "purchase_price": "", "purchase_price_cents": "", "profit_margin": "", "profit_margin_cents": "", "profit_margin_percentage": "", "last_price": "", "last_price_cents": "", "last_price_percentage": "", "last_purchase_price": "", "last_purchase_price_cents": "", "last_purchase_price_percentage": "", "suggested_price_cents": "", "recommended_price_cents": "", "sale_percentage": "", "sale_percentage_cents": "", "sale_percentage_percentage": "", "published_at": "", "fade_percentage": "", "blue_percentage": "", "is_on_steam": "", "profit_percentage": "", "profit_percentage_cents": "", "profit_percentage_percentage": "", "auction_ends_at": "", "auction_ends_at_timestamp": "", "auction_number_of_bids": "", "auction_highest_bid": "", "auction_highest_bid_cents": "", "auction_highest_bidder": "", "auction_is_over": "", "auction_is_active": "", "auction_is_won": "", "auction_is_lost": "", "auction_is_canceled": "", "auction_status": "", "auction_bid_increment": "", "auction_bid_increment_cents": "", "auction_reserve_price": "", "auction_reserve_price_cents": "", "auction_buyout_price": "", "auction_buyout_price_cents": "", "preview_id": "", "user_has_trade_notifications_enabled": "", "user_online_status": "", "steam_level_min_range": "", "steam_level_max_range": "", "delivery_rate_long": "", "delivery_rate_recent": "", "delivery_rate_status": "", "delivery_time_minutes_long": "", "delivery_time_minutes_recent": "" } ], "next_page_url": "http://csgoempire.com/api/trading/items?per_page=2&page=2", "path": "http://csgoempire.com/api/trading/items", "per_page": 2, "prev_page_url": null, "success": true, "to": 2, "total": 22328 } ``` -------------------------------- ### Emit Default Filters (JavaScript Example) Source: https://docs.csgoempire.com/reference/websocket-authentication Example of emitting the default filters to receive item updates after successful websocket authentication. This is typically done using a JavaScript-like syntax for emitting events. ```javascript emit('filters', {'price_max': 9999999}); ``` -------------------------------- ### Get Active Trades - OpenAPI Definition Source: https://docs.csgoempire.com/reference/get-active-trades This snippet defines the OpenAPI specification for retrieving active trades. It includes the endpoint path, HTTP method, summary, detailed description, operation ID, and response structure with an example. ```json { "openapi": "3.1.0", "info": { "title": "csgoempire-api", "version": "1.0" }, "servers": [ { "url": "https://csgoempire.com/api/v2/" } ], "components": { "securitySchemes": { "sec0": { "type": "apiKey", "in": "header", "name": "Authorization", "x-default": "", "x-bearer-format": "bearer" } } }, "security": [ { "sec0": [] } ], "paths": { "/trading/user/trades": { "get": { "summary": "Get Active Trades", "description": "Returns an array of all items currently being deposited or withdrawn by this account. This does not include bids placed on active items until the auction ends.", "operationId": "get-active-trades", "responses": { "200": { "description": "200", "content": { "application/json": { "examples": { "Result": { "value": "{\n \"success\":true,\n \"data\":{\n \"deposits\":[ { \"id\":291452362,\n \"total_value\":499,\n \"item_id\":4209852853,\n \"item\":{\n \"app_id\":730,\n \"context_id\":2,\n \"type\":\"Mil-Spec Grade Sniper Rifle\",\n \"asset_id\":4189826749,\n \"blue_percentage\":null,\n \"created_at\":\"2024-02-25 00:01:01\",\n \"fade_percentage\":null,\n \"full_position\":1,\n \"icon_url\":\"-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpot621FA957P3dcjFH7c6Jh4uem_vnDKnUkmld_cBOhuDG_Zi7iQ2w_RU5Z26md4TDewQ-aF7ZrAC6wL-81pK9tZXPy3pr7yl243eLmgv3309_PudPMg\",\n \"id\":4209852853,\n \"is_commodity\":false,\n \"market_name\":\"AWP | Acheron (Factory New)\",\n \"market_value\":499,\n \"name_color\":\"D2D2D2\",\n \"position\":null,\n \"preview_id\":\"44f1edad452a\",\n \"price_is_unreliable\":false,\n \"stickers\":[ ],\n \"suggested_price\":281,\n \"tradable\":true,\n \"trade_exists\":false,\n \"tradelock\":false,\n \"updated_at\":\"2025-02-26 00:00:01\",\n \"wear\":0.002\n },\n \"status\":3,\n \"status_message\":\"Sending\",\n \"tradeoffer_id\":22342312,\n \"metadata\":{\n \"item_validation\":{\n \"numWrongItemDetections\":0,\n \"validItemDetected\":false\n },\n \"expires_at\":1740426816,\n \"trade_url\":\"https://steamcommunity.com/tradeoffer/new/?partner=100&token=hi\",\n \"item_inspected\":true,\n \"partner\":{\n \"steam_id\":\"76561198382602085\",\n \"steam_name\":\"exampleProfile\",\n \"avatar\":\"https://avatars.steamstatic.com/60d676610e6303f1f5fde66f307dbe753fc91221.jpg\",\n \"avatar_full\":\"https://avatars.steamstatic.com/60d676610e6303f1f5fde66f307dbe753fc91221_full.jpg\",\n \"profile_url\":\"https://steamcommunity.com/profiles/76561198382602085\",\n \"timecreated\":171313223,\n \"steam_level\":10\n },\n \"auction_number_of_bids\":0\n },\n \"created_at\":\"2025-02-26 00:02:02\",\n \"updated_at\":\"2025-02-26 00:03:03\",\n \"suggested_price\":281\n }, { \"id\":292732111,\n \"total_value\":433,\n \"item_id\":4192817732,\n \"item\":{\n \"asset_id\":40244332222,\n \"blue_percentage\":null,\n \"created_at\":\"2024-02-25 00:35:35\",\n \"fade_percentage\":null,\n \"full_position\":18,\n \"icon_url\":\"-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgposLOzLhRlxfbGTjpR09q_goW0hPLiNrXuk21E-8x-hNbN_Iv9nBqxqUc_Nmz1ddCTewI7ZQzUr1i6lL25h5S_uJqcyHNg7HYm4yncn0e1n1gSOfUnguoV\",\n \"id\":4192817732,\n \"is_commodity\":false,\n \"market_name\":\"Five-SeveN | Boost Protocol (Minimal Wear)\",\n \"market_value\":4,\n \"name_color\":\"D2D2D2\",\n \"position\":null,\n \"preview_id\":\"f64dfd621113\",\n \"price_is_unreliable\":false,\n \"stickers\":[ ],\n \"suggested_price\":443,\n \"tradable\":true,\n \"trade_exists\":false,\n \"tradelock\":false,\n \"type\":\"Restricted Pisto\n },\n \"status\":3,\n \"status_message\":\"Sending\",\n \"tradeoffer_id\":22342313,\n \"metadata\":{\n \"item_validation\":{\n \"numWrongItemDetections\":0,\n \"validItemDetected\":false\n },\n \"expires_at\":1740426817,\n \"trade_url\":\"https://steamcommunity.com/tradeoffer/new/?partner=101&token=hi\",\n \"item_inspected\":true,\n \"partner\":{\n \"steam_id\":\"76561198382602086\",\n \"steam_name\":\"exampleProfile2\",\n \"avatar\":\"https://avatars.steamstatic.com/60d676610e6303f1f5fde66f307dbe753fc91222.jpg\",\n \"avatar_full\":\"https://avatars.steamstatic.com/60d676610e6303f1f5fde66f307dbe753fc91222_full.jpg\",\n \"profile_url\":\"https://steamcommunity.com/profiles/76561198382602086\",\n \"timecreated\":171313224,\n \"steam_level\":11\n },\n \"auction_number_of_bids\":0\n },\n \"created_at\":\"2025-02-26 00:37:37\",\n \"updated_at\":\"2025-02-26 00:38:38\",\n \"suggested_price\":443\n } ]\n }\n}" } } } } } } } } } } ``` -------------------------------- ### GET /websites/csgoempire_reference Source: https://docs.csgoempire.com/reference/get-active-auctions Retrieves reference data for CSGOEmpire items. This endpoint provides detailed information about various item properties, including their types, examples, and default values. It also includes depositor statistics and pricing information. ```APIDOC ## GET /websites/csgoempire_reference ### Description Retrieves reference data for CSGOEmpire items. This endpoint provides detailed information about various item properties, including their types, examples, and default values. It also includes depositor statistics and pricing information. ### Method GET ### Endpoint /websites/csgoempire_reference ### Parameters ### Request Example ### Response #### Success Response (200) - **data** (object) - Contains detailed item properties including `default`, `stickers`, `wear`, `published_at`, `id`, `depositor_stats`, and `above_recommended_price`. - **depositor_stats** (object) - Statistics related to item depositors, including `delivery_rate_recent`, `delivery_rate_long`, `delivery_time_minutes_recent`, `delivery_time_minutes_long`, `steam_level_min_range`, `steam_level_max_range`, `user_has_trade_notifications_enabled`, and `user_is_online`. #### Response Example { "data": { "default": {}, "stickers": { "type": "array" }, "wear": {}, "published_at": { "type": "string", "example": "2022-10-18T08:51:02.803761Z" }, "id": { "type": "integer", "example": 11204, "default": 0 }, "depositor_stats": { "type": "object", "properties": { "delivery_rate_recent": { "type": "number", "example": 0.6, "default": 0 }, "delivery_rate_long": { "type": "number", "example": 0.7567567567567568, "default": 0 }, "delivery_time_minutes_recent": { "type": "integer", "example": 7, "default": 0 }, "delivery_time_minutes_long": { "type": "integer", "example": 7, "default": 0 }, "steam_level_min_range": { "type": "integer", "example": 5, "default": 0 }, "steam_level_max_range": { "type": "integer", "example": 10, "default": 0 }, "user_has_trade_notifications_enabled": { "type": "boolean", "example": false, "default": true }, "user_is_online": {} } }, "above_recommended_price": { "type": "integer", "example": -5, "default": 0 } } } #### Error Response (400) - **Result** (object) - An empty object indicating a bad request. #### Error Response (429) - **Result** (string) - An empty string indicating that the request has been rate-limited. ``` -------------------------------- ### Calculate Item Pricing with Markup - Python Source: https://docs.csgoempire.com/reference/create-deposit This Python script demonstrates how to calculate the `coin_value` for items when creating a deposit. It takes an original market price and applies a specified markup percentage, rounding the result. The output is a list of dictionaries, each containing either an `id` (Empire item ID) or `asset_id` and the calculated `coin_value`, suitable for the create deposit API request. ```python # Markup percentage percent = 5 # Original market prices for two items item1_price = 10001 item2_price = 33053 # Apply the same markup to both prices item1_marked_up = round(item1_price * (1 + percent / 100)) item2_marked_up = round(item2_price * (1 + percent / 100)) # Create the list to send items = [ { "id": 3731677705, # You can either send the Empire itemId "coin_value": item1_marked_up }, { "asset_id": 45059553777, # Or you can use the item asset_id as well "coin_value": item2_marked_up } ] ``` -------------------------------- ### OpenAPI Definition for Deposit Status Check Source: https://docs.csgoempire.com/reference/check-deposit-status This OpenAPI 3.1.0 definition outlines the GET endpoint for checking deposit status. It includes request parameters, response schemas, and example responses for successful operations. Authentication is handled via an API key in the 'Authorization' header. ```json { "openapi": "3.1.0", "info": { "title": "csgoempire-api", "version": "1.0" }, "servers": [ { "url": "https://csgoempire.com/api/v2/" } ], "components": { "securitySchemes": { "sec0": { "type": "apiKey", "in": "header", "name": "Authorization", "x-default": "", "x-bearer-format": "bearer" } } }, "security": [ { "sec0": [] } ], "paths": { "/trading/deposit/status/{trackingCode}": { "get": { "description": "", "operationId": "get_tradingdepositstatus{trackingCode}", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "user_id": { "type": "integer" }, "item_id": { "type": "string" }, "status": { "type": "string" }, "error": { "type": "string" }, "created_at": { "type": "integer" }, "updated_at": { "type": "integer" }, "tracking_expires_at": { "type": "integer" }, "deposit_id": { "type": "integer" } } } } }, "examples": { "": { "summary": "", "value": { "success": true, "data": { "user_id": 9181092, "item_id": 4244017062, "status": "completed", "error": null, "created_at": 1758288162, "updated_at": 1758288166, "tracking_expires_at": 1758298962, "deposit_id": 328094591 } } }, " Success": { "summary": " Success", "value": { "success": true, "data": { "user_id": 9181092, "item_id": 4244017062, "status": "completed", "error": null, "created_at": 1758288162, "updated_at": 1758288166, "tracking_expires_at": 1758298962, "deposit_id": 328094591 } } } } } } } }, "parameters": [ { "in": "path", "name": "trackingCode", "schema": { "type": "string" }, "required": true } ] } } }, "x-readme": { "headers": [], "explorer-enabled": true, "proxy-enabled": true }, "x-readme-fauxas": true } ``` -------------------------------- ### PHP Stack Trace Example Source: https://docs.csgoempire.com/reference/check-trades This snippet illustrates a typical stack trace from a Laravel application, showing the sequence of function calls leading to an error. It includes file paths, line numbers, and middleware involved in request handling. ```text #0 /var/csgoempire/laravel/app/Http/Kernel.php(159): App\\Http\\Kernel->handle(Object(App\\Http\\Request))\n#1 /var/csgoempire/laravel/public/index.php(28): App\\Http\\Kernel->handle(Object(App\\Http\\Request))\n#2 {main}" } } ``` -------------------------------- ### Get Automation Status (OpenAPI) Source: https://docs.csgoempire.com/reference/get-status This OpenAPI definition describes the 'Get Status' endpoint for the CSGOEmpire API. It outlines the request method, URL, and expected JSON response, including success and error scenarios. The response details include whether an API key and access token are present and when the access token expires. ```json { "openapi": "3.1.0", "info": { "title": "csgoempire-api", "version": "1.0" }, "servers": [ { "url": "https://csgoempire.com/api/v2/" } ], "components": { "securitySchemes": { "sec0": { "type": "apiKey", "in": "header", "name": "Authorization", "x-default": "", "x-bearer-format": "bearer" } } }, "security": [ { "sec0": [] } ], "paths": { "/trading/automation/status": { "get": { "summary": "Get Status", "description": "Use this endpoint to check whether your account has the automation feature active.", "operationId": "get-status", "responses": { "200": { "description": "200", "content": { "application/json": { "examples": { "Result": { "value": "{\n\t\"success\": true,\n\t\"data\": {\n\t\t\"steam_id\": \"76561118883215332\",\n\t\t\"trade_url\": \"https://steamcommunity.com/tradeoffer/new/?partner=1033332211&token=So-S31aK\",\n\t\t\"has_api_key\": false,\n\t\t\"has_access_token\": true,\n\t\t\"access_token_expires_at\": \"2025-01-10T03:37:29.000000Z\",\n\t\t\"automation_enabled_read_only\": true\n\t}\n}" } }, "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": true, "default": true }, "data": { "type": "object", "properties": { "steam_id": { "type": "string", "example": "76561118883215332" }, "trade_url": { "type": "string", "example": "https://steamcommunity.com/tradeoffer/new/?partner=1033332211&token=So-S31aK" }, "has_api_key": { "type": "boolean", "example": false, "default": true }, "has_access_token": { "type": "boolean", "example": true, "default": true }, "access_token_expires_at": { "type": "string", "example": "2025-01-10T03:37:29.000000Z" }, "automation_enabled_read_only": { "type": "boolean", "example": true, "default": true } } } } } } } }, "400": { "description": "400", "content": { "application/json": { "examples": { "Result": { "value": "{}" } }, "schema": { "type": "object", "properties": {} } } } } }, "deprecated": false } } }, "x-readme": { "headers": [], "explorer-enabled": true, "proxy-enabled": true }, "x-readme-fauxas": true } ``` -------------------------------- ### Simulate Authentication in CSGOEmpire Configuration Source: https://docs.csgoempire.com/reference/tipping This configuration snippet demonstrates how to enable faux authentication, indicated by `x-readme-fauxas`, within the CSGOEmpire project. Setting this to true simulates authentication for testing or development purposes. It is a boolean flag with no specified inputs or outputs. ```json { "x-readme-fauxas": true } ``` -------------------------------- ### GET /trading/user/trade/{depositId}/{type} Source: https://docs.csgoempire.com/reference/get-trade Retrieves the status of a trade using its deposit ID and type. This endpoint serves as a backup for WebSocket events. ```APIDOC ## GET /trading/user/trade/{depositId}/{type} ### Description Check the status of a trade in case you missed the WebSocket event for it. It's recommended to primarily use WebSockets and this endpoint as a backup. ### Method GET ### Endpoint `/trading/user/trade/{depositId}/{type}` ### Parameters #### Path Parameters - **depositId** (integer) - Required - Can be either a deposit ID, a trade ID or a bid ID. - **type** (string) - Required - Can be either of these: bid/deposit/withdrawal ### Request Example ```json { "example": "Not applicable for GET request" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (object) - Contains trade details, which can include bid, deposit, and withdrawal information. The structure varies based on the trade status (e.g., no trade found, with type, no type provided). #### Response Example *No type provided:* ```json { "success": true, "data": { "bid": null, "deposit": { "id": 10001, "total_value": 87846, "item_id": 30001 ... }, "withdrawal": null } } ``` *With type:* ```json { "success": true, "data": { "id": 10001, "total_value": 24562, "item_id": 30001, ... } } ``` *No trade found:* ```json { "success": true, "data": { "bid": null, "deposit": null, "withdrawal": null } } ``` ``` -------------------------------- ### POST /trading/deposit Source: https://docs.csgoempire.com/reference/create-deposit Lists one or more CSGO Empire items for sale. It is recommended to chunk requests into groups of a maximum of 20 items to avoid rate limits and improve listing speed. Individual deposit states will be announced via WebSocket. ```APIDOC ## POST /trading/deposit ### Description Lists item(s) for sale. The `coin_value` is in coin cents, so 100.01 coins is represented as 10001. `coin_value` should be the price you want to list at. ### Method POST ### Endpoint `/trading/deposit` ### Parameters #### Request Body - **items** (array) - Required - An array of objects, where each object can be either `{"id": itemId, "coin_value": int}` or `{"asset_id": int, "coin_value": int}`. ### Request Example ```json { "items": [ { "id": 3731677705, "coin_value": 10500 }, { "asset_id": 45059553777, "coin_value": 34000 } ] } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (array) - An array of objects containing details for each successfully listed item. - **item_id** (integer) - The unique ID of the item on CSGO Empire. - **tracking_code** (string) - A code to track the deposit status. - **tracking_expires_at** (integer) - Timestamp when the tracking code expires. - **asset_id** (integer) - The asset ID of the item. #### Response Example ```json { "success": true, "data": [ { "item_id": 4242007012, "tracking_code": "01K3H28BXWM3HM5MDACGEKETN0", "tracking_expires_at": 1758298962, "asset_id": 45030133221 } ] } ``` #### Error Response (400) - Returns an empty JSON object `{}` for a bad request. ``` -------------------------------- ### Get Status Source: https://docs.csgoempire.com/reference/get-status This endpoint allows you to check if your account has the automation feature active. It returns information about your Steam ID, trade URL, and the status of your API key and access token. ```APIDOC ## GET /trading/automation/status ### Description Use this endpoint to check whether your account has the automation feature active. You should look for the '*has_access_token*' and the '*access_token_expires_at*' values to indicate whether this is active. ### Method GET ### Endpoint https://csgoempire.com/api/v2/trading/automation/status ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **data** (object) - Contains the status details: - **steam_id** (string) - The Steam ID of the user. - **trade_url** (string) - The user's trade URL. - **has_api_key** (boolean) - Whether the user has an API key set up. - **has_access_token** (boolean) - Whether the user has an access token. - **access_token_expires_at** (string) - The expiration date and time of the access token in ISO 8601 format. - **automation_enabled_read_only** (boolean) - Whether the automation feature is enabled in read-only mode. #### Response Example ```json { "success": true, "data": { "steam_id": "76561118883215332", "trade_url": "https://steamcommunity.com/tradeoffer/new/?partner=1033332211&token=So-S31aK", "has_api_key": false, "has_access_token": true, "access_token_expires_at": "2025-01-10T03:37:29.000000Z", "automation_enabled_read_only": true } } ``` #### Error Response (400) An empty JSON object is returned for a bad request. ``` -------------------------------- ### OpenAPI Definition for Create Deposit - JSON Source: https://docs.csgoempire.com/reference/create-deposit This OpenAPI 3.1.0 definition outlines the `/trading/deposit` endpoint for the CSGOEmpire API. It specifies the POST method, its summary, description, and operation ID. The request body expects a JSON object with an 'items' array, where each element can be an `id` or `asset_id` paired with a `coin_value`. It also details the structure of successful (200) and error (400) responses, including example data. ```json { "openapi": "3.1.0", "info": { "title": "csgoempire-api", "version": "1.0" }, "servers": [ { "url": "https://csgoempire.com/api/v2/" } ], "components": { "securitySchemes": { "sec0": { "type": "apiKey", "in": "header", "name": "Authorization", "x-default": "", "x-bearer-format": "bearer" } } }, "security": [ { "sec0": [] } ], "paths": { "/trading/deposit": { "post": { "summary": "Create Deposit", "description": "List item(s) for sale.", "operationId": "create-deposit", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "items": { "type": "string", "description": "Required array with array elements [id: itemId, coin_value: int] or [asset_id: int, coin_value: int]", "format": "json", "default": "" } }, "required": [] } } } }, "responses": { "200": { "description": "200", "content": { "application/json": { "examples": { "Result": { "value": { "success": true, "data": [ { "item_id": 4242007012, "tracking_code": "01K3H28BXWM3HM5MDACGEKETN0", "tracking_expires_at": 1758298962, "asset_id": 45030133221 } ] } } }, "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": true, "default": true } } } } } }, "400": { "description": "400", "content": { "application/json": { "examples": { "Result": { "value": "{}" } }, "schema": { "type": "object", "properties": {} } } } } }, "deprecated": false } } }, "x-readme": { "headers": [], "explorer-enabled": true, "proxy-enabled": true }, "x-readme-fauxas": true } ```