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

enhancement: Add or modify cards endpoint to include more details #594

Closed
2 of 5 tasks
dsnidr opened this issue Nov 29, 2024 · 3 comments
Closed
2 of 5 tasks

enhancement: Add or modify cards endpoint to include more details #594

dsnidr opened this issue Nov 29, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@dsnidr
Copy link
Contributor

dsnidr commented Nov 29, 2024

Data affected

  • Card
  • Set
  • Serie
  • Other
  • new Data Type

Please explain in more details what idea you have

My Use-case

I have an app which periodically fetches data for all cards and builds a local mirror to avoid spamming API requests.

Currently, the only way to fetch the details I need using this API is to fetch cards one by one. There is the GET /v2/en/cards endpoint which will return partial data on all cards, but does not include fields I need such as:

  • set details
  • rarity
  • images
  • variants
  • etc...

Proposed Solution

I propose a paginated endpoint which will return full card objects, but only up to a sane limit (e.g 50 at a time). Ideally, it would also support basic sorting and other standard operations.

Having a paginated endpoint returning full card details would have the following benefits:

  1. Make the API easier and faster to work with
  2. Reduce load on the API by avoiding the overhead associated with tens of thousands of individual requests to fetch all cards
  3. It could provide a count of the total number of cards in the database

I'm happy to give this more thought and take up the implementation if this idea is well received.

@Aviortheking
Copy link
Member

Hey, for this use case, you can use the GraphQL API.
It is made for these use cases

@dsnidr
Copy link
Contributor Author

dsnidr commented Nov 29, 2024

Great! I'll just use that, then.

Do you think it's worth exploring a REST option for those who don't want to use GraphQL? If not, feel free to close this.

Thanks! 😄

@Aviortheking
Copy link
Member

Aviortheking commented Dec 1, 2024

You're welcome !

There is something that is meant to kinda add this in #606 (Strangely it was on the Discord but I forgot to add it to the Github)

@Aviortheking Aviortheking closed this as not planned Won't fix, can't repro, duplicate, stale Dec 1, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in TCGdex Iterative development Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants