{"id":16535882,"url":"https://github.com/offish/stntrading","last_synced_at":"2025-10-28T12:30:17.919Z","repository":{"id":57471516,"uuid":"285299359","full_name":"offish/stntrading","owner":"offish","description":"Interact with STNTrading.eu's API","archived":false,"fork":false,"pushed_at":"2024-01-20T11:19:28.000Z","size":11,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T15:11:22.204Z","etag":null,"topics":["steam-api","steam-trade","steam-trade-bot","steam-trading","stntf","stntrading","tf2","tf2-trading-bot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/offish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-08-05T13:40:52.000Z","updated_at":"2024-02-04T06:35:51.000Z","dependencies_parsed_at":"2024-01-20T12:26:31.975Z","dependency_job_id":"49a36ff9-2c8c-4f1b-b308-0042fa2e81d3","html_url":"https://github.com/offish/stntrading","commit_stats":null,"previous_names":["offish/stntrading"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offish%2Fstntrading","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offish%2Fstntrading/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offish%2Fstntrading/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offish%2Fstntrading/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/offish","download_url":"https://codeload.github.com/offish/stntrading/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238646938,"owners_count":19507108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["steam-api","steam-trade","steam-trade-bot","steam-trading","stntf","stntrading","tf2","tf2-trading-bot"],"created_at":"2024-10-11T18:29:10.011Z","updated_at":"2025-10-28T12:30:17.438Z","avatar_url":"https://github.com/offish.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stntrading\r\n[![License](https://img.shields.io/github/license/offish/stntrading.svg)](https://github.com/offish/stntrading/blob/master/LICENSE)\r\n[![Stars](https://img.shields.io/github/stars/offish/stntrading.svg)](https://github.com/offish/stntrading/stargazers)\r\n[![Issues](https://img.shields.io/github/issues/offish/stntrading.svg)](https://github.com/offish/stntrading/issues)\r\n[![Size](https://img.shields.io/github/repo-size/offish/stntrading.svg)](https://github.com/offish/stntrading)\r\n[![Discord](https://img.shields.io/discord/467040686982692865?color=7289da\u0026label=Discord\u0026logo=discord)](https://discord.gg/t8nHSvA)\r\n[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\r\n\r\nInteract with STNTrading.eu's API hosted at https://api.stntrading.eu\r\n\r\nFor getting inventories and item names, I recommend using [tf2-utils](https://github.com/offish/tf2-utils). \r\n\r\n\r\n## Installation\r\n```bash\r\npip install stntrading\r\n```\r\n\r\n### Update\r\n```bash\r\npip install --upgrade stntrading\r\n```\r\n\r\n# Setup\r\nFind or register your API key on https://stntrading.eu/dev/apikey\r\n\r\nIf you want to access BETA endpoints shown [here](https://github.com/STNTrading/public-api/wiki), you need STN Premium.\r\nFor more information read [this](https://api.stntrading.eu/docs/#/beta).\r\n\r\n\r\n# Usage\r\n```python\r\n\u003e\u003e\u003e from stntrading import STN, EStateCodes\r\n\r\n\u003e\u003e\u003e stn = STN(\"26bf8abb59e86b4301aaff5b88547aaf\") # (fake api key)\r\n\r\n\u003e\u003e\u003e stn.get_key_prices()\r\n{'success': 1, 'result': {'pricing': {'buyPrice': 570.0, 'sellPrice': 606.0}}}\r\n\r\n\u003e\u003e\u003e stn.get_key_stock()\r\n{'success': 1, 'result': {'stock': {'canBuy': 15, 'canSell': 15, 'stockLevel': 702, 'stockLimit': 1770}}}\r\n\r\n\u003e\u003e\u003e stn.request_key_trade(\"buy\", 1)\r\n{'success': 0, 'error': \"Failed to create trade: 'NotEnoughCurrenciesUser'\"}\r\n\r\n\u003e\u003e\u003e stn.get_trade_status(20530029)\r\n{'success': 1, 'result': {'trade': {'state': 15, 'tradeOfferId': 6697968536}}}\r\n\r\n\u003e\u003e\u003e EStateCodes(15).name\r\nCANCELLED_AFTER_SENDING\r\n\r\n\u003e\u003e\u003e stn.request_item_trade(\"buy\", \"The Team Captain\", 1)\r\n{'success': 1, 'result': {'tradeDetails': {'id': 20530029, 'bot': '76561198309976634'}}}\r\n\r\n\u003e\u003e\u003e stn.request_item_trade(\"sell\", [12552033523], 1)\r\n{'success': 0, 'error': \"Failed to create trade: 'UserItemOverstocked'\"}\r\n\r\n# ----------------------\r\n# if STN Premium access:\r\n# ----------------------\r\n\u003e\u003e\u003e stn.get_schema()\r\n{'success': 1, 'result': {'schema': ['A Brush with Death', 'A Color Similar to Slate', 'A Deep Commitment to Purple', ...]}}\r\n\r\n\u003e\u003e\u003e stn.get_item_details(\"The Team Captain\")\r\n{'success': 1, 'item': {'full_name': 'The Team Captain', 'pricing': {'buy': {'keys': 0, 'metal': 10.0}, 'sell': {'keys': 0, 'metal': 10.88}}, 'stock': {'level': 48, 'limit': 100}}}\r\n```\r\n\r\n\r\n# Documentation\r\nDocumentation can be found on the [official wiki](https://github.com/STNTrading/public-api/wiki) or using [Swagger](https://api.stntrading.eu/docs/).\r\n\r\n\r\n# License\r\nCopyright (c) 2020-2024 offish\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the 'Software'), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffish%2Fstntrading","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foffish%2Fstntrading","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffish%2Fstntrading/lists"}