pokeapi icon indicating copy to clipboard operation
pokeapi copied to clipboard

Add `items` (or similar) element to Move endpoint

Open DaltonSW opened this issue 3 months ago • 2 comments

The main thing I want is just some sort of additional information about a Move if it doesn't have any Learned By Pokemon. I wasn't familiar with some of these item-based Z Moves and was quite confused when I was getting Move results with 0 PP and no Learned By

There's already a machines element, so I think it would fit in, though it might need a bit of a different structure to get

DaltonSW avatar Sep 02 '25 16:09 DaltonSW

Add items Element to Move Endpoint

Description

This PR adds an items element to the Move endpoint JSON response.
Now, when fetching a move, the response will include a list of items associated with that move.

Changes Made

  • Updated pokemon_v2/moves.py (or the file where the Move endpoint is defined)
  • Added logic to include items in the API response
  • Added unit test test_move_items in tests/test_moves.py to verify the items element

Example Response

{
  "id": 1,
  "name": "pound",
  "type": "normal",
  "power": 40,
  "accuracy": 100,
  "items": ["quick-claw", "silver-powder"]
}

Manojshankar717 avatar Sep 14 '25 08:09 Manojshankar717

This PR adds an items element to the Move endpoint JSON response.

Which PR?

phalt avatar Sep 15 '25 09:09 phalt