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

Use steam market_hash_name as name in Skin Endpoint #38

Closed RatzeR closed 1 year ago

RatzeR commented 1 year ago

Hi @ByMykel,

first of all, this project is super nice and very helpful! Thank you for creating this API! :-)

As I played around with the data, I found that the "wears" in the Skins endpoint might be not the best solution, when the idea is to use this API as a starting point and get for example price information from a second API, as you suggested in https://github.com/ByMykel/CSGO-API/issues/34.

The "problem" is that a lot of other services uses the market_hash_name from steam as unique identifier for a skin. In the market_hash_name the structure of the name is something like this:

%Stattrack% %NAME_OF_SKIN% (%WEAR%)

It would be easier to connect third party services when your naming system would follow this structure. I understand that this would mean that the JSON File would grow a lot, so this is just a suggestion, as it is also possible to transform the data on "our" side, when we aggregate the data in a database.

Nevertheless I suggest to follow the market_hash_name pattern, as you do this already in the Sticker Endpoint.

ByMykel commented 1 year ago

first of all, this project is super nice and very helpful! Thank you for creating this API! :-)

Thank you for opening issues suggesting things to improve this project.

It would be easier to connect third party services when your naming system would follow this structure. I understand that this would mean that the JSON File would grow a lot, so this is just a suggestion, as it is also possible to transform the data on "our" side, when we aggregate the data in a database.

As you mention that would make the JSON File grow a lot, public/api/en/all.json is already 6.6 MB.

My idea with name imitate the community market, but I run into this #32 issue that i kind of know how to solve.

I had the idea of making a separate endpoint that returs all the skins in every state (stattrak, not stattrak, FN, MW, etc) without grouping them and I think it making sense to implement it.

Solution

New endpoint /skins_not_grouped.json (provisional name) that would not be in public/api/en/all.json with the new attribute market_hash_name

What do you think @RatzeR, with this new endpoint should we group doppler and gamma doppler skins as suggested in #37 ??

RatzeR commented 1 year ago

I think this is a good idea! So you avoid breaking changes in the current API and also provide a new one which is aligned with the Community Market!

Regarding the Gamma Doppler Skins: In this new API I would suggest to go with you first suggestion:

{
    "phases": [
        { "phase": "Phase 1", "paint_index": 852, "image": "phase1_url"  },
        { "phase": "Phase 2"," paint_index": 853, "image": "phase2_url"  },
        { "phase": "Phase 3", "paint_index": 854, "image": "phase3_url" },
    ]
}