pokeapi icon indicating copy to clipboard operation
pokeapi copied to clipboard

Pokemon with Ability in Version

Open justingolden21 opened this issue 5 months ago • 6 comments

Currently, an ability will return which pokemon have it.

I can also check which pokemon are in what generation.

However, I cannot check what pokemon have an ability in a generation.

For example, does Gengar have Levitate in BDSP? The answer is no, even though Gengar is in the game, and Gengar had levitate in gen 4, because BDSP is gen 8.

I was hoping to make a pokedex that would allow the user to select game version and see information pertaining to that version.

Let me know if this is possible currently. Thanks in advance!

justingolden21 avatar Jun 10 '25 05:06 justingolden21

We would need to implement the logic. Dont' know if anyone has the time to do it

Naramsim avatar Jun 10 '25 14:06 Naramsim

Gotcha, thanks for the reply. Valuable info (especially since many other sites don't seem to display it), but I understand it would take some effort.

I'm wondering what version specific data you have if any (other than the list of games in general). I checked the docs and didn't find much other than past abilities and past types etc. but none refer to a specific game. Thanks again.

justingolden21 avatar Jun 11 '25 03:06 justingolden21

@justingolden21 - this seems to be possible with some data. For example, with the pokemon endpoint and looking at moves, there is a version_group_details section for each move a Pokémon can learn that holds data for each generation. Is this what you're looking for but with abilities?

JSON:

"moves": [
    {
      "move": {
        "name": "pound",
        "url": "https://pokeapi.co/api/v2/move/1/"
      },
      "version_group_details": [
        {
          "level_learned_at": 1,
          "move_learn_method": {
            "name": "level-up",
            "url": "https://pokeapi.co/api/v2/move-learn-method/1/"
          },
          "order": 4,
          "version_group": {
            "name": "x-y",
            "url": "https://pokeapi.co/api/v2/version-group/15/"
          }
        },
        {
          "level_learned_at": 1,
          "move_learn_method": {
            "name": "level-up",
            "url": "https://pokeapi.co/api/v2/move-learn-method/1/"
          },
          "order": 4,
          "version_group": {
            "name": "omega-ruby-alpha-sapphire",
            "url": "https://pokeapi.co/api/v2/version-group/16/"
          }
        },
        {
          "level_learned_at": 1,
          "move_learn_method": {
            "name": "level-up",
            "url": "https://pokeapi.co/api/v2/move-learn-method/1/"
          },
          "order": 6,
          "version_group": {
            "name": "sun-moon",
            "url": "https://pokeapi.co/api/v2/version-group/17/"
          }
        },
        {
          "level_learned_at": 1,
          "move_learn_method": {
            "name": "level-up",
            "url": "https://pokeapi.co/api/v2/move-learn-method/1/"
          },
          "order": 6,
          "version_group": {
            "name": "ultra-sun-ultra-moon",
            "url": "https://pokeapi.co/api/v2/version-group/18/"
          }
        },
        {
          "level_learned_at": 1,
          "move_learn_method": {
            "name": "level-up",
            "url": "https://pokeapi.co/api/v2/move-learn-method/1/"
          },
          "order": 4,
          "version_group": {
            "name": "scarlet-violet",
            "url": "https://pokeapi.co/api/v2/version-group/25/"
          }
        }
      ]
    },
    {
      "move": {
        "name": "ice-punch",
        "url": "https://pokeapi.co/api/v2/move/8/"
      },
      "version_group_details": [
        {
          "level_learned_at": 0,
          "move_learn_method": {
            "name": "tutor",
            "url": "https://pokeapi.co/api/v2/move-learn-method/3/"
          },
          "order": null,
          "version_group": {
            "name": "omega-ruby-alpha-sapphire",
            "url": "https://pokeapi.co/api/v2/version-group/16/"
          }
        },
        {
          "level_learned_at": 0,
          "move_learn_method": {
            "name": "tutor",
            "url": "https://pokeapi.co/api/v2/move-learn-method/3/"
          },
          "order": null,
          "version_group": {
            "name": "ultra-sun-ultra-moon",
            "url": "https://pokeapi.co/api/v2/version-group/18/"
          }
        },
        {
          "level_learned_at": 0,
          "move_learn_method": {
            "name": "machine",
            "url": "https://pokeapi.co/api/v2/move-learn-method/4/"
          },
          "order": null,
          "version_group": {
            "name": "scarlet-violet",
            "url": "https://pokeapi.co/api/v2/version-group/25/"
          }
        }
      ]
    },

digitalghost-dev avatar Jun 12 '25 18:06 digitalghost-dev

Yes exactly! Thanks for looking into this! That's what I would want for abilities. I think it would get one very large step closer to being able to show version specific info on everything important in game.

I think there isn't much value in just showing every move Bulbasaur learns in any game for example, but there is a lot of value in showing every move Bulbasaur can learn the current game the user is playing. Otherwise, they'd just go to serebii or similar. I think it really brings the value provided by pokeapi to the next level.

Thanks again!

justingolden21 avatar Jun 13 '25 01:06 justingolden21

@justingolden21 - well, you may not find value in some of the data but others may! I use this data for a CLI tool I am building and need the moves sorted out by generation like this. For example, Machamp is not in SV so I need to switch to SS to get the latest data for that Pokémon.

As for your original issue, I would be willing to work on this. I would just need some confirmation from the admins on how to go about it. To me, setting up the abilities in the same manner as the moves example I showed make sense, but I could be wrong.

I'll have to see what thoughts @Naramsim or @phalt has. (These are the only two admins I know 😅)

digitalghost-dev avatar Jun 13 '25 15:06 digitalghost-dev

Awesome! That would be really cool. If you are able to document how you do it as well, I'd be curious so maybe I could contribute in the future. Adding data like that to an API like this isn't really my wheelhouse 😅

As for the usefulness: exactly. I just think that seeing Gengar and its stats, moves, abilities in general isn't very useful to the average player, but seeing its stats, moves and abilities in crystal for a player playing crystal is exactly what they're looking for 99% of the time. If I'm playing crystal for example, I'm just going to serebii, not some website that shows every move and ability Gengar has ever had, or every move and ability it has in the most recent game. In my opinion, it takes pokeAPI from something used for smaller fan projects to something that can be used as a utility app/website for nearly any game and any player. I think it's just the version specifics that are the primary missing link. It's certainly a rabbit hole, as stats have been rebalanced, types added, special/physical split, items are in different games. I think the more complex work (encounters, moves, held items) is already done. Anyway, sorry for rambling 😄

justingolden21 avatar Jun 13 '25 16:06 justingolden21