AlanOC91 / YGOPRODeck

Yu-Gi-Oh! Card Database and Deck Share Site
81 stars 4 forks source link

Suggestion: Query by set code #392

Open DFazekas opened 2 years ago

DFazekas commented 2 years ago

Set codes are less ambiguous that card names.

The current process to search for a card by its card set, is to query by card name, then filter by set codes.

Please add set code as a query parameter.

AlanOC91 commented 2 years ago

Like this?

https://db.ygoprodeck.com/api/v7/cardsetsinfo.php?setcode=SDY-046

DFazekas commented 2 years ago

https://db.ygoprodeck.com/api/v7/cardsetsinfo.php?setcode=SDY-046

Almost. This API is for "card set info", not "card info". This request returns only a subset of the info; it does not return the entire card info, such as card image, attribute, etc. Therefore, it still requires two API requests to fetch all the card info via their set code:

  1. call /api/v7/cardsetsinfo.php?setcode={set_code} to extract card ID, then
  2. call /api/v7/cardinfo.php?id={card_id} to extract the rest of the info.

As a solution, could you simply add setcode as a query parameter to the /api/v7/cardinfo.php API? Allowing requests such as /api/v7/cardinfo.php?setcode={set_code}.

joseehilton147 commented 1 year ago

would be great