sorare / api

Sorare API documentation
153 stars 47 forks source link

How can I get a list of slugs for all NBA players? #452

Open aaauyzzzz opened 1 year ago

aaauyzzzz commented 1 year ago

Is that possible to get a list of all slugs for all NBA players? And I would like to use them to get all the transaction data for NBAcards. Are there any good ways to get them?

When I try to write a query on the playground, it always shows like this: { "data": { "nbaPlayers": [] } }

jmaupoux commented 1 year ago

use nba collections to get all player slugs

0d1n92 commented 1 year ago
 tokens {
    allNfts(sport:[NBA], after:"WyIwMDAwMDRlNS01MjRiLTRkOTMtYTk5Yi1hOWQ0OWEyOTRjOTIiXQ") {
      edges {
        node {
          slug
        }
      }
       pageInfo {
        hasNextPage
        startCursor
        endCursor

      }
    }

  }
}

this returns the slugs, then you have to navigate the results by page using allNfts(sport:[NBA], after:"stringOfEndCursor")