understanding api

Eduardo Gomez 3,416 Reputation points
2020-12-30T11:41:06.69+00:00

Hello everybody

This is a very basic and stupid question, but I have been staring at this API for a while now, and I have been checking the dock,

I want to get all the YUGIOH cards from a specific Set (https://db.ygoprodeck.com/api-guide/) but the only thing I can think of is to get all the cards and do a query for the set that belongs to.

Every time I try to get all the cards when I put that link on my browser, it says "Oversize limit"

Anyone has used this API before @Cole Xia (Shanghai Wicresoft Co,.Ltd.)

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,479 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 49,781 Reputation points
    2020-12-30T14:48:32.337+00:00

    I have no knowledge of this API but reading the docs it says to use the endpoint ttps://db.ygoprodeck.com/api/v7/cardinfo.php and pass the query string with the parameter cardset set to the "set" you want. That would, in theory, return back all the cards in that set which is what I understand you're trying to do. They even have an example query: https://db.ygoprodeck.com/api/v7/cardinfo.php?cardset=metal%20raiders&attribute=dark

    For the error you're getting back though that is different and can happen on any call. The issue appears to be that there is too much data for it to return to you. However there docs don't seem to indicate how they do paging, if they support it at all. I would recommend that you try filtering down even further first just to get valid data back. Once that works then try the full set again.

    Note that for testing APIs you should consider using either curl (command line) or Postman (UI). The browser may work for simple GET requests but you are limited in what you can do with it. Many APIs ask that you set some HTTP headers when sending requests and the browser wouldn't make this easy. It is possible you need to set an HTTP header telling their server how much to return in a batch. Their docs don't talk about this so you may need to contact them about how paging works.


0 additional answers

Sort by: Most helpful