GithubHelp home page GithubHelp logo

kooora-unofficial-api's Introduction

kooora-unofficial-api

PyPi Version PyPI pyversions Downloads Upload Python Package

Kooora unofficial Python API.

Installation

pip3 install kooora

Current features

  • Search by keyword (leagues, teams, players)
  • Fetch matches by
    • Date
    • League
    • Team
  • Fetch match info
    • General information
    • Stats (played matches)
  • Fetch team info
  • Fetch league info
    • League table
    • Scorers

Examples

Below are some basic examples to use the library:

Initialize Kooora class

from kooora.kooora import *
api = Kooora()

Get the names of the leagues being played today

today_matches = api.get_today_matches()
# today_matches is a dict which keys are league ID numbers, let's extract the IDs
*today_matches_ids, = today_matches
for id in today_matches_ids[]:
    print(League.from_id(id).get_title())

Get matches being played today in a given league (example with spanish liga)

for match in today_matches[22393]:
    print(match)

Fetch stats for a given match

yesterday = api.get_yesterday_matches()[22495].get_stats()

Initialize a League variable by ID and fetch its ranking and top scorers

liga = League.from_id(22393) # you can also use api.search
liga_table = liga.get_table()
top_scorers = liga.get_top_scorers()

Find a team by its name and fetch its next match

eibar = None
for t in liga.get_teams():
    if t.get_name() == "إيبار":
        eibar = t
        break

Contributing

The project is still at a very early stage. See https://github.com/marrakchino/kooora-unofficial-api/projects/1 for a list of ideas or kindly open an issue to raise a bug or submit a feature request.

Idea

I've been fiddling with Kooora's website for years trying to understand the multiple aspects of the data they provide and had the idea of creating a public API of it knocking around my head since at least 2017. The initial version of this unofficial API was made possible by reverse-engineering Kooora's official Android application both by reversing the code and by sniffing the network requests.

License: MIT

kooora-unofficial-api's People

Contributors

dependabot[bot] avatar n-eq avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.