{"id":16131140,"url":"https://github.com/nerddiffer/backpack_tf","last_synced_at":"2026-01-16T00:56:39.081Z","repository":{"id":31460763,"uuid":"35024623","full_name":"NerdDiffer/backpack_tf","owner":"NerdDiffer","description":"A wrapper for the backpack.tf API","archived":false,"fork":false,"pushed_at":"2021-07-12T20:00:00.000Z","size":480,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-25T02:25:55.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NerdDiffer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-04T08:56:58.000Z","updated_at":"2019-08-20T16:26:12.000Z","dependencies_parsed_at":"2022-09-03T15:13:14.075Z","dependency_job_id":null,"html_url":"https://github.com/NerdDiffer/backpack_tf","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NerdDiffer%2Fbackpack_tf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NerdDiffer%2Fbackpack_tf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NerdDiffer%2Fbackpack_tf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NerdDiffer%2Fbackpack_tf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NerdDiffer","download_url":"https://codeload.github.com/NerdDiffer/backpack_tf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246796408,"owners_count":20835384,"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":[],"created_at":"2024-10-09T22:19:18.821Z","updated_at":"2026-01-16T00:56:39.052Z","avatar_url":"https://github.com/NerdDiffer.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# backpack_tf\n\n[![Build Status](https://travis-ci.org/NerdDiffer/backpack_tf.svg?branch=master)](https://travis-ci.org/NerdDiffer/backpack_tf)\n[![Code Climate](https://codeclimate.com/github/NerdDiffer/backpack_tf/badges/gpa.svg)](https://codeclimate.com/github/NerdDiffer/backpack_tf)\n[![Test Coverage](https://codeclimate.com/github/NerdDiffer/backpack_tf/badges/coverage.svg)](https://codeclimate.com/github/NerdDiffer/backpack_tf/coverage)\n\nBackpack.tf is a website for the in-game economies of Team Fortress 2 and Dota\n2. This gem is a wrapper for the backpack.tf\n[API](https://backpack.tf/developer).  The goal is to capture the results and\nturn them into Ruby objects for use in your application.\n\n### Contributing\n\nIf you are interested in contributing, please see any open issues and let me know.\n\n### Installation\n\n###### from the command line\n\n`$ gem install backpack_tf`\n\n###### from your Gemfile\n\n`gem 'backpack_tf'`\n\n### Usage \u0026 Examples\n\n[Register an API key](https://backpack.tf/developer), pass it in to the client.\n\n``` ruby\n#\n# create a new Client object\n#\nbp = BackpackTF::Client.new(\u003cyour_api_key\u003e)\n\n#\n# fetch some data\n#\nprices = bp.fetch(:prices)\nprice_history = bp.fetch(:price_history, { item: item_name_or_defindex })\nmarket_prices = bp.fetch(:market_prices)\ncurrencies = bp.fetch(:currencies)\nspecial_items = bp.fetch(:special_items)\nusers = bp.fetch(:users, { steamids: [array,of,64,bit,steam,ids] })\nlistings = bp.fetch(:user_listings, { steamid: 64_bit_steam_id })\n\n#\n# assign fetched data to the corresponding module\n#\nBackpackTF::Price.response = prices\nBackpackTF::PriceHistory.response = price_history\nBackpackTF::MarketPrices.response = market_prices\nBackpackTF::Currency.response = currencies\nBackpackTF::SpecialItem.response = special_items\nBackpackTF::User.response = users\nBackpackTF::UserListing.response = listings\n```\n\n## Interfaces \u0026 Responses\n\nLink to all [official documentation](https://backpack.tf/api/index.html).\n\n#### IGetPrices\n\n* Get pricing data for all priced items\n\nInformation on any particular item, (ie: 'Eviction Notice'), is captured in an\ninstance of `BackpackTF::Price::Item`. Furthermore, there may be several prices\nfor the same item. For example, an Eviction Notice with the Unique quality has a\ndifferent price than an Eviction Notice with the Strange quality.\n\nEach price is an instance of `BackpackTF::Price::ItemPrice`, and is stored in\nthe `@prices` hash of that item.\n\n##### hierarchy\n\n* `BackpackTF::Price` module\n  * `@items` hash of `BackpackTF::Price::Response`.\n    * `BackpackTF::Price::Item` object (ie: 'Beast From Below')\n    * `BackpackTF::Price::Item` object (ie: 'Taunt: Rock, Paper Scissors')\n    * `BackpackTF::Price::Item` object (ie: 'Eviction Notice')\n      * `@prices` hash of a `BackpackTF::Price::Item` object\n        * `BackpackTF::Price::ItemPrice` object (ie: price of a Unique item)\n        * `BackpackTF::Price::ItemPrice` object (ie: price of a Vintage item)\n        * `BackpackTF::Price::ItemPrice` object (ie: price of a Strange item)\n\n#### IGetPriceHistory\n\n* Get price history for an item\n\nYou must pass in the item name or its `defindex` number as value on the `name`\nkey when accessing this interface. IE:\n\n* `client.fetch(:price_history, item: 829)` or\n* `client.fetch(:price_history, item: 'War Pig')`\n\nIf you pass in a string as the `item`, then it must match the `item_name`\nproperty (not the `name` property) as per its definition in the schema. For more\ninformation, see the\n[TF2 Wiki page on item schema](https://wiki.teamfortress.com/wiki/Item_schema).\n\nYou can optionally pass the client `quality`, `tradable`, `craftable` or\n`priceindex` keys. See the\n\n#### IGetMarketPrices\n\n* Get Steam Community Market price information\n\n#### IGetCurrencies\n\n* Get internal currency data\n\nThere are currently 4 currencies available through the API.\nEach one is an instance of `BackpackTF::Currency` and is held in the\n`@currencies` hash of the `BackpackTF::Currency::Response` class.\n\n#### IGetSpecialItems\n\n* Get internal backpack.tf item placeholders\n\nThis is for items that only exist on backpack.tf. They are not real game items,\nbut you will see them returned in a call to `IGetSpecialItems`.\n\n#### IGetUsers\n\n* Get profile info for a list of 64-bit Steam IDs.\n* Does not require an API key\n\nGet some basic information for a list of backpack.tf users. It's basically the\ninfo that you'd see on their profile page.\nYou can request several users at once by sending an array.\n\n#### IGetUserListings\n\n* Get classified listings for a given user\n\nRequest all classified listings for one user.\nYou must pass in the 64-bit `steamid`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerddiffer%2Fbackpack_tf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnerddiffer%2Fbackpack_tf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerddiffer%2Fbackpack_tf/lists"}