Valid options for SortOrder parameter in catalog/groups endpoint?

(Gus Landt) #1

I call this endpoint without issue:
http://api.tcgplayer.com/v1.17.0/catalog/groups?categoryId=1&sortOrder=GroupName&sortDesc=true

However, I would prefer to sort so that the most recently released sets are first.
I know I can do this:
sortOrder=GroupId&sortDesc=true

but that gets the most recently added sets first, not necessarily the most recently released sets (for example, it currently returns 1995’s Renaissance set first, since that set was just added to TCGPlayer this month.

Doing:
sortOrder=publishedOn&sortDesc=true
doesn’t work, so apparently ‘publishedOn’ isn’t a valid option for sorting groups.

How do I find a list of valid fields to sort on?

(Joshua Burdick) #2

groupId and name are the only fields that can be sorted on for this call. Most people use these APIs to build a local database which can then sort data however you want.

(Gus Landt) #3

Thank you Joshua.
That is exactly what I do. The code that uses this call is one that populates my database with new cards, which is why I wanted to sort by recently released sets. I don’t have any interest in adding 1995’s Renaissance to my database, but I guess it doesn’t hurt anything. :smile: