Skip to content

Instantly share code, notes, and snippets.

Created August 18, 2017 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/7a8419748960a2bf3008a62a4dbe040b to your computer and use it in GitHub Desktop.
Save anonymous/7a8419748960a2bf3008a62a4dbe040b to your computer and use it in GitHub Desktop.
Scrape the top 10k overall FPL
import json
import requests
#ID for the overall global league
league_id = 313
page = 1
#Do 200 pages to get top 10k (50 teams/page)
while page <= 200:
URL="https://fantasy.premierleague.com/drf/leagues-classic-standings/{}?phase=1&ls-page={}".format(str(league_id),str(page))
data = requests.get(URL).json()
for t in data['standings']['results']:
print t['id']
page += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment