Django App for the MLS Soccer Stats API I'm playing with
Latest commit 89188fe Aug 19, 2013 @f4nt Merge pull request #16 from f4nt/django_project
Django project
Failed to load latest commit information.
mls_api more api tweaks Aug 8, 2013
mls_api_proj Bringing the Django project into this repo Aug 20, 2013
AUTHORS added AUTHORS file May 2, 2013
LICENSE license and readme files Apr 29, 2013 Bringing the Django project into this repo Aug 20, 2013
requirements.txt initial commit Apr 28, 2013


Scrapes and stores statistics.


In order to install clone this repo, and run:

python install

Then add:

  • mls_api
  • south
  • django_nose

to your list of INSTALLED_APPS in your Django project. Then just run:

python syncdb
python migrate mls_api

to add the necessary tables to your database.

Alternate Installation

While the mls_api project can be installed and added to your existing Django project, you can also use the Django project included in this repo. To do that you'll simply want to do the following:

  • Clone this repo: git clone
  • cd into the mls-api directory
  • Make use of the file like you would with any Django project, such as running the scrape_game command below.

Scraper Usage

This app includes a management command that will parse stats from the website. There are a couple methods of use:

python scrape_game

This method of running the scraper will parse all of the stats from the MLS Results Map for the current year. Optionally you can run with a year argument:

python scrape_game --year=2011

If a Result Map doesn't exist for the given year however, this will fail. MLS currently only tracks back to 2011.

If the script encounters a game with a statistics link that already exists it will skip that link. You can pass the option of forcing to the script to disable this:

python scrape_game --force

Finally, you can give the script a specific stats link for it to parse:

python scrape_game

Scraper Options

  • -f, --force: Forces the scraper to overwrite existing games.
  • -y, --year: Year of competition to parse
  • -w, --workers: Number of worker threads to parse with (Default: 5)