There seems to be no way of getting all images for certain forms?
I apologize if this mentioned somewhere, I'm new to the the API. But I didn't see any clear answer to this in the docs or in existing issues. It seems like there's images for certain forms that are not exposed by the API directly. I namely noticed this with Deerling, but it almost certainly applies elsewhere
If you check https://pokeapi.co/api/v2/pokemon/deerling, the sprites field only has data for the default (spring) form. The Pokemon has 3 other forms however:
- https://pokeapi.co/api/v2/pokemon-form/10068 (summer)
- https://pokeapi.co/api/v2/pokemon-form/10069 (autumn)
- https://pokeapi.co/api/v2/pokemon-form/10070 (winter)
Each of these forms does have a sprites field as well, but they contain considerably less images than the pokemon endpoint provides, only providing the default sprites
Despite this, images for other platforms DO exist for these forms. Such as:
- https://github.com/PokeAPI/sprites/blob/master/sprites/pokemon/versions/generation-vi/x-y/585-summer.png
- https://github.com/PokeAPI/sprites/blob/master/sprites/pokemon/versions/generation-vi/x-y/585-autumn.png
- https://github.com/PokeAPI/sprites/blob/master/sprites/pokemon/versions/generation-vi/x-y/585-winter.png
But it seems like these images are not exposed by the API? The pokemon-form endpoints all point back to the same base form (spring), and none of the alternate forms seem to have dedicated pokemon entries
I suspect this issue applies to all Pokemon with multiple forms where the forms do not have dedicated pokemon entries, not just Deerling. I also noticed this same issue with Flabebe, as if has multiple forms and images for other platforms but seemingly no way to get the images from the API?
Just to be clear as well, this affects the GraphQL API as well (which I was surprised about, tbh, since I assumed the data was in the database and just not being exposed by the REST API). When searching for a Pokemon normally you can get all of it's images just fine:
query GetImages {
pokemon(where: {name: {_eq: "deerling"}}) {
id
name
pokemonsprites {
sprites
}
}
}
{
"data": {
"pokemon": [
{
"id": 585,
"name": "deerling",
"pokemonsprites": [
{
"sprites": {
"other": {
"home": {
"front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/home/shiny/585.png",
"front_female": null,
"front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/home/585.png",
"front_shiny_female": null
},
"showdown": {
"back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/showdown/back/shiny/585.gif",
"back_female": null,
"front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/showdown/shiny/585.gif",
"back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/showdown/back/585.gif",
"front_female": null,
"front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/showdown/585.gif",
"back_shiny_female": null,
"front_shiny_female": null
},
"dream_world": {
"front_female": null,
"front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/dream-world/585.svg"
},
"official-artwork": {
"front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/shiny/585.png",
"front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/585.png"
}
},
"versions": {
"generation-i": {
"yellow": {
"back_gray": null,
"front_gray": null,
"back_default": null,
"front_default": null,
"back_transparent": null,
"front_transparent": null
},
"red-blue": {
"back_gray": null,
"front_gray": null,
"back_default": null,
"front_default": null,
"back_transparent": null,
"front_transparent": null
}
},
"generation-v": {
"black-white": {
"animated": {
"back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/animated/back/shiny/585.gif",
"back_female": null,
"front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/animated/shiny/585.gif",
"back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/animated/back/585.gif",
"front_female": null,
"front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/animated/585.gif",
"back_shiny_female": null,
"front_shiny_female": null
},
"back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/back/shiny/585.png",
"back_female": null,
"front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/shiny/585.png",
"back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/back/585.png",
"front_female": null,
"front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-v/black-white/585.png",
"back_shiny_female": null,
"front_shiny_female": null
}
},
"generation-ii": {
"gold": {
"back_shiny": null,
"front_shiny": null,
"back_default": null,
"front_default": null,
"front_transparent": null
},
"silver": {
"back_shiny": null,
"front_shiny": null,
"back_default": null,
"front_default": null,
"front_transparent": null
},
"crystal": {
"back_shiny": null,
"front_shiny": null,
"back_default": null,
"front_default": null,
"back_transparent": null,
"front_transparent": null,
"back_shiny_transparent": null,
"front_shiny_transparent": null
}
},
"generation-iv": {
"platinum": {
"back_shiny": null,
"back_female": null,
"front_shiny": null,
"back_default": null,
"front_female": null,
"front_default": null,
"back_shiny_female": null,
"front_shiny_female": null
},
"diamond-pearl": {
"back_shiny": null,
"back_female": null,
"front_shiny": null,
"back_default": null,
"front_female": null,
"front_default": null,
"back_shiny_female": null,
"front_shiny_female": null
},
"heartgold-soulsilver": {
"back_shiny": null,
"back_female": null,
"front_shiny": null,
"back_default": null,
"front_female": null,
"front_default": null,
"back_shiny_female": null,
"front_shiny_female": null
}
},
"generation-vi": {
"x-y": {
"front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-vi/x-y/shiny/585.png",
"front_female": null,
"front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-vi/x-y/585.png",
"front_shiny_female": null
},
"omegaruby-alphasapphire": {
"front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-vi/omegaruby-alphasapphire/shiny/585.png",
"front_female": null,
"front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-vi/omegaruby-alphasapphire/585.png",
"front_shiny_female": null
}
},
"generation-iii": {
"emerald": {
"front_shiny": null,
"front_default": null
},
"ruby-sapphire": {
"back_shiny": null,
"front_shiny": null,
"back_default": null,
"front_default": null
},
"firered-leafgreen": {
"back_shiny": null,
"front_shiny": null,
"back_default": null,
"front_default": null
}
},
"generation-vii": {
"icons": {
"front_female": null,
"front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-vii/icons/585.png"
},
"ultra-sun-ultra-moon": {
"front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-vii/ultra-sun-ultra-moon/shiny/585.png",
"front_female": null,
"front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-vii/ultra-sun-ultra-moon/585.png",
"front_shiny_female": null
}
},
"generation-viii": {
"icons": {
"front_female": null,
"front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-viii/icons/585.png"
}
}
},
"back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/585.png",
"back_female": null,
"front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/585.png",
"back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/585.png",
"front_female": null,
"front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/585.png",
"back_shiny_female": null,
"front_shiny_female": null
}
}
]
}
]
}
}
But when you query for the forms, you only get the basic default sprites:
query GetImages {
pokemonform(where: {name: {_eq: "deerling-winter"}}) {
id
name
pokemonformsprites {
sprites
}
}
}
{
"data": {
"pokemonform": [
{
"id": 10070,
"name": "deerling-winter",
"pokemonformsprites": [
{
"sprites": {
"back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/585-winter.png",
"back_female": null,
"front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/585-winter.png",
"back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/585-winter.png",
"front_female": null,
"front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/585-winter.png",
"back_shiny_female": null,
"front_shiny_female": null
}
}
]
}
]
}
}
My only idea right now is to manually craft the image URLs and just hope for the best?
Yes, it's true! Pokemon forms currently don't expose all images like pokemon do. We should implement something along https://github.com/PokeAPI/pokeapi/blob/master/data/v2/build.py#L1461 but for line https://github.com/PokeAPI/pokeapi/blob/master/data/v2/build.py#L2118