sorare / api

Sorare API documentation
153 stars 47 forks source link

How to get API competition and team names #301

Open nachoroncero opened 1 year ago

nachoroncero commented 1 year ago

Hello,

I am trying to access a specific team players, but I do not find the team, and I am sure it is because I am not searching it with the right name, so I was thinking about getting the teams names from the API, using the competition they play.

How could I get the right names to access an specific team players?

Thanks in advance

jamb0ree commented 1 year ago

to get competitions' names, you can query :

query{
  leaguesOpenForGameStats{
    name
    slug
  }
}

On Sorare, if you click on "Licensed Partners" on the bottom of the welcome page, you get the "Coverage" part with this query.

Then if you want the clubs for each competition, you can query :

query{
  competition(slug: "2-bundesliga"){
    clubs{
      nodes{
        name
        slug
      }
    }
  }
}