Having issues with the site or with our deck builder? Post it here.
  • User avatar
  • User avatar
User avatar
By Kurusedo
#59796
Hello all,

Before I continue I want to say I am not sure if this is the correct forum to post this...

But, I came across the YGOPRODECK API Guide while looking for some sort of CSV export that contained as many yugioh cards and card data as possible.

I wanted to ask if the collection found on that API is complete? Because I've come across some cards that I own that are not in the API list, or seem to be missing all of the information except the set code.

YGOPRODECK API Guide Link: https://db.ygoprodeck.com/api-guide/

Any pointers on where I could get a complete export would be grateful!

Thanks!
User avatar
By YGOPRODeck
#59797
Hi there,

Yes it should indeed be complete :)

Please give me an example of a card you have and I can cross check.

Thanks!
User avatar
By Kurusedo
#59798
Okay,

So I downloaded the "Get All Cards" link (https://db.ygoprodeck.com/api/v7/cardinfo.php) in JSON file and converted them to CSV.

When I open the CSV in Excel, which has a total of ~30,200 rows, I notice the following:

[spoiler]Image[spoiler]

Notice how on rows 10-11 and 16-20 have a card sets set code entered, but pretty much everything else is blank (card name, card type, etc.)

Also, there are some cases (see row 14) where there's a card name available, but the set code/set info is blank.

That's just a snippet of the lines that seem to be incomplete, there are about 19k rows total that have those issues.

NOTE: I downloaded the data twice thinking it was an export issue but I got the same results.
User avatar
By YGOPRODeck
#59801
Hi there,

The issue is how you are converting our data to your excel file. These aren't "missing cards" they are the same card with additional card sets. You'll need to accommodate this in the way you are converting the data.

For example, 4-Starred Ladybug of Doom

https://db.ygoprodeck.com/api/v7/cardin ... 0of%20Doom

Image
User avatar
By Kurusedo
#59806
Oh okay, I see what you mean. Makes sense.

Any pointers on how the query needs to be accommodated so that when converting from JSON to CSV it repeats all row labels instead of leaving them blank for those cases?

Or better yet, is there a way to download all card info collection directly in a csv o xlsx file type?
User avatar
By Kurusedo
#59970
For anyone that comes across this in the future, if you want to get an Excel export (.csv or .xlsx) of the Yu-Gi-Oh card collection, you can do the following;

  • Convert the JSON file to CSV using the converter of your choice. There are free online converters.
  • Open the CSV file in Excel, go to the VBA Developer window, insert a new module, and run the following code

    Sub FillDown_BlankRows()
    Dim Rng As Range

    For Each Rng In Range("A:A").SpecialCells(xlBlanks).Areas
    Rng.Offset(-1).Resize(Rng.Count + 1, 6).FillDown
    Rng.Offset(-1, 11).Resize(Rng.Count + 1, 23).FillDown
    Next Rng

    End Sub
The code takes less than 3-5 seconds to run. This will correctly fill any blank cells with the correct card information for cards that appear in more than one set.

Credit to Fluff from Mr.Excel Forum boards. Here's the link to the original post.
User avatar
By YGOPRODeck
#60331
Glad you got it sorted in the end! But yeah using an online converter to straight convert JSON to Excel normally won't cleanly convert depending on the data returned.

What a lot of developers would do (in their own preferred coding language) would be to call the API and get all cards, loop through each card and insert it into excel as a blank row. If the card contains more than one card set, duplicate the data with the new card set onto another row.

I'm glad you found an excel function to sort you out though!
Angry Panda (Scummy)

The following is a small excerpt of deck/article.[…]

Marincess

The following is a small excerpt of deck/article.[…]

droll and lock bird artifact lancea

to counter dogmatika