-
Hello!
However, my experience with API is zero, I'm a mere embedded systems programmer with no experience at all with web stuff. I tried seeking on google and even chatgpt but I couldn't find any leads that would get me somewhere apart from making random api requests and hitting a wall. I tried reading the documentation but I'm a fish out of water here. Could you help me out? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
The closest you can do is using graphql and filter per generation query searchForPokemonInFrench {
pokemon_v2_pokemon(
where: {
pokemon_v2_encounters: {
pokemon_v2_locationarea: { name: { _eq: "sinnoh-route-229-area" } }
}
_and: {
pokemon_v2_pokemonspecy: {
pokemon_v2_generation: { name: { _eq: "generation-i" } }
}
}
}
) {
id
name
}
} Our data |
Beta Was this translation helpful? Give feedback.
-
I don't understand. Can you list your inputs and your outputs clearly? The GraphQL above lists all Pokemon belonging to a specific generation that can be found in a certain location. Input: generation, location Output: pokemon This is the output of the query above: {
"data": {
"pokemon_v2_pokemon": [
{
"id": 16,
"name": "pidgey"
},
{
"id": 43,
"name": "oddish"
},
{
"id": 44,
"name": "gloom"
},
{
"id": 48,
"name": "venonat"
},
{
"id": 49,
"name": "venomoth"
},
{
"id": 69,
"name": "bellsprout"
},
{
"id": 70,
"name": "weepinbell"
},
{
"id": 118,
"name": "goldeen"
},
{
"id": 119,
"name": "seaking"
},
{
"id": 123,
"name": "scyther"
},
{
"id": 127,
"name": "pinsir"
},
{
"id": 129,
"name": "magikarp"
},
{
"id": 130,
"name": "gyarados"
}
]
}
} Learn more here on GraphQL: https://pokeapi.co/docs/graphql https://stackoverflow.com/a/52868182/3482533 |
Beta Was this translation helpful? Give feedback.
-
Thank you for your guidance. I managed to understand the basic principle behind GraphQL and after loads of try and error I'm now somewhat able to navigate pokeAPI and get what I want from with using some coding. |
Beta Was this translation helpful? Give feedback.
Thank you for your guidance. I managed to understand the basic principle behind GraphQL and after loads of try and error I'm now somewhat able to navigate pokeAPI and get what I want from with using some coding.