Open andreagiovanesorare opened 2 years ago
Hello, you can use all the cards, or check the active clubs for their players
Thank you for your answer
Hello, did you get to find the players using the active clubs?
No, I used all the cards query because for active clubs you need the slug of club.
Hey ! I used the clubs and active players and got 100,000 players, looking at SorareData I saw there were over 400,000 players. By retrieving all the cards I can only retrieve them 50 by 50, it's extremely long and I still have to retrieve the player, how did you manage to retrieve all the players easily? Also do you know to see the exact number of players on Sorare? Thanks !
Hi, it's the same for me. I don't know a good way to do. I retrieve players 50 at time.
I don't think you can by-pass the "50 by 50" retrieval of all players.
As a quick workaround, I am using the allCards
endpoint, but filtering only cards with a serial number of 1, and with a limited rarity.
I know I don't have each and everyone player (because some players have rare cards but no limited), but I get most of them (and it's enough for me for now) ; but I guess you could do the same with every other rarity.
The query I am using (looping through every endCursor
variable) :
query($endCursor: String!) {
allCards(
rarities: [limited]
owned: true
serialNumber: 1
after: $endCursor
) {
nodes {
player {
slug
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
As a result, I get around 13700 distinct players that have at least a n°1 limited card.
Thank you for your answer, from what I had seen there were many more players than that on SorareData but I may have been wrong! I will try to retrieve them all with your query and I will see how many I have 😁
In case you need to scope things a little more, this is what I used to fetch all MLB players:
{
ARI: baseballTeam(slug: "arizona-diamondbacks") {
name
players {
displayName
slug
}
}
…
WSH: baseballTeam(slug: "washington-nationals") {
name
players {
displayName
slug
}
}
}
Hi, it seems that there is no query to get the list of all players inside Sorare both those that have club and also those not. I can get a player information with his slug but it's difficult guess the player's slug. Can you help me? How can I get the full list of players with their slugs and display names?