ByMykel / CSGO-API

An unofficial JSON API for Counter-Strike 2 in multiples languages. List of skins, cases, stickers, collections, collectibles, agents, graffiti, keys, patches and music kits.
https://bymykel.github.io/CSGO-API/
MIT License
260 stars 31 forks source link

Add Weapon Category #31

Closed FXXDEV closed 1 year ago

FXXDEV commented 1 year ago

There is some chance to get the weapon categories like the CSGOSTASH in an extra field?

 {
        "id": "skin-1967916",
        "name": "Tec-9 | Bamboo Forest",
        "description": "An ideal pistol for the Terrorist on the move, the Tec-9 is lethal in close quarters and features a high magazine capacity.",
        "weapon": "Tec-9",
        _**"category": "Pistols"**_
        "pattern": "Bamboo Forest",
        "min_float": 0,
        "max_float": 0.6,
        "rarity": "Consumer Grade",
        "stattrak": false,
        "paint_index": "459",
        "image": "https://steamcdn-a.akamaihd.net/apps/730/icons/econ/default_generated/weapon_tec9_hy_bamboo_jungle_light_large.31268450fbb5b5c2221e6eaadbe7124cf85f3e1d.png"
    },

For example, pistols, rifles, smg's...

And also, thank you for the great work!

ByMykel commented 1 year ago

Thank you, will try to add this ASAP as is seems simple.

ByMykel commented 1 year ago

@FXXDEV Done and deployed.

FXXDEV commented 1 year ago

Perfect @ByMykel, thank you so much!

I already done that detour for get the weapon types before your update, but ill remove and keep my code based at the API response only.

Also, do you have any intention to add the weapon condition range? Like for example:

{ "id": "skin-1967916", "name": "Tec-9 | Bamboo Forest", "description": "An ideal pistol for the Terrorist on the move, the Tec-9 is lethal in close quarters and features a high magazine capacity.", "weapon": "Tec-9", "category": "Pistols" ? "condition_range": [ FN, MW, FT, WW, BS] ? "pattern": "Bamboo Forest", "min_float": 0, "max_float": 0.6, "rarity": "Consumer Grade", "stattrak": false, "paint_index": "459", "image": "https://steamcdn-a.akamaihd.net/apps/730/icons/econ/default_generated/weapon_tec9_hy_bamboo_jungle_light_large.31268450fbb5b5c2221e6eaadbe7124cf85f3e1d.png" },

ByMykel commented 1 year ago

The condition range or wear is something that could be calculated with the min/max flot, but as you are the second one asking for this I should add this to close #21. I will add the long name (Well-Worn not WW) though.

@FXXDEV Let me know if you have more suggestions to improve this API.

FXXDEV commented 1 year ago

Yes, i already saw the #21 and its exact the same, i dont wanted to open a new topic about it.

Do you have any means that we can contact? Like steam?

If yes, you can add me steamcommunity.com/id/AndrewFXX/ ( just leave a comment before)

ByMykel commented 1 year ago

@FXXDEV I have added the wears to skins:

{
        "id": "skin-65604",
        "name": "Desert Eagle | Urban DDPAT",
        "description": "As expensive as it is powerful, the...",
        "weapon": "Desert Eagle",
        "category": "Pistols",
        "pattern": "Urban DDPAT",
        "min_float": 0.06,
        "max_float": 0.8,
        "rarity": "Industrial Grade",
        "stattrak": false,
        "paint_index": "17",

        "wears": [
            "Factory New",
            "Minimal Wear",
            "Field-Tested",
            "Well-Worn",
            "Battle-Scarred"
        ],

        "image": "https://steamcdn-a.akamaihd..."
    }