Skip to main content

Python library for integrating with the MLS (Major League Soccer) API.

Project description

MLS API Python Package Version

Python library for integrating with MLS API functionality.

Requirements

Python 2.7 and later.

Setup

You can install this package by using the pip tool and installing:

$ pip install mls-api

Or:

$ easy_install mls-api

Usage Example

import os, json
import mls_api

# Authentication
username = "your_username"
password = "your_password"
response_text = mls_api.login(username, password)
print("Login response:", response_text)

# Get all historical data
response_text = mls_api.get_all_hist()
print("All historical data response:", response_text)

# Get all real-time data (RTD)
response_text = mls_api.get_all_rtd()
print("All real-time data response:", response_text)

# Get a list of players with a custom limit and offset
limit = 20
offset = 10
response_text = mls_api.get_all_players(limit, offset)
print("Players response:", response_text)

# Get all top scorers data
all_topscorers = mls_api.get_all_topscorers()
print("All Top Scorers:")
print(all_topscorers)

# Get all offence data
all_offences = mls_api.get_all_offences()
print("All Offences:")
print(all_offences)

# Get all assists data
all_assists = mls_api.get_all_assists()
print("All Assists:")
print(all_assists)

# Get all teams data
all_teams = mls_api.get_all_teams()
print("All teams:\n", all_teams)

# Get all fixtures data
all_fixtures = mls_api.get_all_fixtures()
print("All fixtures:\n", all_fixtures)

# Get all standings data
all_standings = mls_api.get_all_standings()
print(all_standings)

# Get all news data
all_news = mls_api.get_all_news()
print(all_news)

Setting up an MLS API Account

Sign up for a self-service user account.

Using the MLS API

You can read the API documentation to understand what’s possible with the MLS API. If you need further assistance, don’t hesitate to contact us.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mls-api-1.0.10.tar.gz (15.7 kB view hashes)

Uploaded Source

Built Distributions

mls_api-1.0.10-py3.9.egg (39.2 kB view hashes)

Uploaded Source

mls_api-1.0.10-py3-none-any.whl (18.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page