Pagination

Public lists

Public lists answer a page at a time: items, page, limit, total and hasMore. limit is 25 unless you say, up to 50. page starts at 1 and stops at 10: the API is for looking things up, not for export. A number out of range is 400 invalid_request, not rounded.

  • GET /api/v1/standings
  • GET /api/v1/teams
  • GET /api/v1/matches
  • GET /api/v1/players/leaderboard

Ask for the next page while hasMore is true and page is under 10.

Every page, in JavaScript
async function allTeams() {
  const teams = []
  for (let page = 1; page <= 10; page++) {
    const res = await fetch(`https://gwl.gg/api/v1/teams?limit=50&page=${page}`, {
      headers: { Authorization: `Bearer ${process.env.GWL_API_KEY}` },
    })
    const body = await res.json()
    teams.push(...body.items)
    if (!body.hasMore) break
  }
  return teams
}

Team lists

These have no pages: limit says how many. Members, applications and slots come whole.

Team lists with a limit
Routelimit
GET /api/v1/team/fixturesDefault: 10. Minimum: 1. Maximum: 100
GET /api/v1/team/eloDefault: 100. Minimum: 1. Maximum: 100
GET /api/v1/team/eventsDefault: 50. Minimum: 1. Maximum: 100

The events cursor

GET /api/v1/team/events is a cursor. Send after=<the last id you handled> and keep the next it gives you. When hasMore is true, ask again at once.