MagicTheGathering/mtg-api

Add a "newest edition only" query parameter

RenanRossiDias opened this issue · 1 comments

The problem:
When using /cards, the search returns both newer and oldest printed cards.
This is a useful tool and allows a lot of possibilities for developers to treat received information when needed.

The "workaround":
But when we don't want to display oldest printed cards, it demands more server queries in order to "advance" the search since the results are paginated, and it ends by consuming json spaces that could host different cards, minimizing server requests.
On my end, i treat the results by searching oldest editions when newers are found, and simply trash those oldest editions.
I didn't shipped my application yet, and i will not until i find a better way to treat this information, avoiding unecessary requests and throwing api money by the window.
I think this is very counterproductive to do, since requests means money.

The suggestion:
I think that computional cost of sorting the results to return only newest printings when a "boolean" parameter is added to the query could mean a most efficient way to treat this information.
As the API grows and it's users develop new ways to use it, i think this could also avoid less or none money being thrown by that window.

I really appreciate the work of everyone involved in this API, and i want to contribute as many as possible when i ship my application. Until that i must say: Thank you!

Thanks for the detailed question! I'll look into this, as I can certainly see this being a useful addition.