Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there an endpoint that returns a pokemon's image as in the game's pokedex? #346

Closed
nats12 opened this issue Aug 16, 2018 · 18 comments
Closed

Comments

@nats12
Copy link

nats12 commented Aug 16, 2018

Can't seem to find anything about pokemon icon/image in the documentation or in the object returned listing each pokemon. Are there any for icons and if not, will there be soon?

@Naramsim
Copy link
Member

https://github.com/PokeAPI/sprites

https://pokeapi.co/api/v2/pokemon/23/ -> look in sprites

@sashafirsov
Copy link

https://unpkg.com/[email protected]/sprites/pokemon/other/dream-world/87.svg

@Naramsim
Copy link
Member

Naramsim commented Dec 6, 2021

@sashafirsov, cool implementation. Would you be willing to port it at our official repo?

@sashafirsov
Copy link

@Naramsim, there are technical challenges in publishing the pokeApi sprites original repo you most likely aware of.
npm publish is generating the descriptor string more then 0.5Gb which crashes this node process. At the moment there is no ability to change this limit as it is hardcoded in V8 JS engine.

I have to remove all PNG( ~5Gb) files in fork https://github.com/sashafirsov/pokeapi-sprites
in order to make project publish-able in nodejs.com

Looking into popularity of https://github.com/PokeAPI/sprites such removal from original project does not look possible unless the PNG generation could be moved into separate repo or build step.

While publishing to npmjs.com is still possible by making PNG excluded from package, I am not sure about happiness of npm users from github url npm install github:PokeAPI/sprites.

From another side, I do not see the PNGs as valuable resource as most sizes and color variations could be rendered 1:1 by SVGs. The color variations also could be tuned on CSS or rendering level. IMO v3.0 could take this pattern as base and as such would not have restrictions in npm and CDN publishing. If there is an interest in such bold move, we could continue.

@Naramsim
Copy link
Member

Naramsim commented Dec 7, 2021

Ahh, I see your point. I didn't know about the limit. Well thanks again :)

@sashafirsov
Copy link

sashafirsov commented Dec 18, 2021

Does this one has a sense to be shared in PokeAPI community?
PokéAPI Explorer

@Naramsim
Copy link
Member

It's broken on my side

@sashafirsov
Copy link

CDN link is broken, will fix in a bit.

@sashafirsov
Copy link

https://unpkg.com/[email protected]/src/PokeApi-Explorer.html seems working, looking where in PokeAPI it could be embedded. Perhaps in https://pokeapi.co/

@Naramsim
Copy link
Member

I don't know @sashafirsov, I find it a bit difficult to use. What's the exact point you are trying to fix with this tool?

@sashafirsov
Copy link

@Naramsim, the initial intent was to show images from https://github.com/PokeAPI/sprites in relation to API.

I had trouble to understand the relation between those images and API and urls in data. With this "API explorer" minimal visualization of data and cross-linking API URLs, it become more clear. While it is not a developer tool for working with API, it is a teaser for API and image consumers.

Perhaps embedding or link to REST playground or GraphQL API console could be useful for such audience. Personally I would find such "visual preview" useful as a tab in data preview section of "Try it now" on pokeapi.co

Unlike Pokemon Wiki it is not oriented to give full info about pokemon games, just show what API has.

It immediately exposed that 1118 pokemon count does not match all 649 images in dreamworld. Which mean I have chosen either a wrong API to list all pokemons( https://pokeapi.co/api/v2/pokemon ) or image library is missing half of assets( https://unpkg.com/browse/pokeapi-sprites/sprites/pokemon/other/dream-world/ ). That was starting point to make a decision whether to use images from https://github.com/PokeAPI/sprites. With 650 "official" it would be OK, unofficial have to be filtered off or SVG images replaced with PNG. "visual preview" could help with finding what data could be used for recognition of non-official and what image to use as substitution.

PS. could you describe "difficult to use", please? I assume you had some kind of expectations and it did not match. What it is?

@Naramsim
Copy link
Member

Hi @sashafirsov, I see what you mean. If we go for such a solution/tool ideally it would be better if it could query every endpoint and that every property is returned. Right now your tool is only returning properties that have a list as a value. I would also use a standard tool, I don't know if API explorers are a thing.

The ultimate goal of the tool would be to showcase what is present in each endpoint visually and live. On one side we already have the documentation that allows people to see what's exposed by each endpoint, but the docs aren't live and you cannot try them as you would in Swagger.

By difficult to use I meant, difficult to understand. The mechanism that allows you to see and query inner resources tends to produce a lot of output and in the end, the webpage becomes a mess.

If your main intent was to list each and every sprite dynamically for a Pokemon, I think it would be better to stick with that goal. Otherwise maybe looking online for some API explorer tool would be much simpler than coding everything in-house.

@Naramsim
Copy link
Member

For the sprites you are right, we don't have a place where one can see if every pokemon has a particular sprite. We could extend our docs with the counts of each sprite folder, so that developers know that some sprites are missing

@rasolofonirina
Copy link

You also can use https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/${pokemonIndex}.png as indicated on : https://stackoverflow.com/questions/69239521/unable-to-display-pokemon-image-from-pokeapi-co

@jayk-gupta
Copy link

Can't seem to find anything about pokemon icon/image in the documentation or in the object returned listing each pokemon. Are there any for icons and if not, will there be soon?

I too can't find it working in my api. Is there any other alternative for using pokemon images?!

@deidyomega
Copy link

Can't seem to find anything about pokemon icon/image in the documentation or in the object returned listing each pokemon. Are there any for icons and if not, will there be soon?

I too can't find it working in my api. Is there any other alternative for using pokemon images?!

You can always use; https://assets.pokemon.com/assets/cms2/img/pokedex/detail/{id}.png
where id needs to be zero padded. 001, 002, etc etc

@C-Garza
Copy link
Member

C-Garza commented Jan 18, 2023

@justingolden21
Copy link

justingolden21 commented Apr 24, 2024

The vector art is awesome, but ends at 649 (https://unpkg.com/[email protected]/sprites/pokemon/other/dream-world/649.svg). Was wondering if there is any repo with vector art of all current pokemon (tall order, I know, and yeah I know it would probably have to come from some game)

EDIT: nvm, already mentioned here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants