Giter Site home page Giter Site logo

uefa-api's Introduction

Typescript bindings and utils for the UEFA API

This package provides typings as well as utility functions to retrieve matches, teams, players, competitions and statistics from the UEFA API. The API provides data for all official UEFA competitions, such as the EURO, Champions League, Europa League, Nations League, etc.

Usage

  1. Install the package
npm install uefa-api
  1. Import and use the package
import { getLivescore, getMatches } from 'uefa-api';

const livescore = await getLivescore();
const matchId = livescore[0].id;
const score = livescore[0].score.regular;

const matches = await getMatches({
  competitionId: 3,
  seasonYear: 2024
});

Methods

For the results of the methods, check the typings here.

getLivescore(): Livescore[]

Returns the score of currently running matches as well as information about upcoming matches in the next hour as well as finished matches in the last hour.

getCompetitions(ids): Competition[]

Returns a list of competitions. When no ids are provided, all competitions are returned. ids can be an array or single value.

getMatches(options, sortOrder, limit, offset): Match[]

Returns a list of matches for the given filter options. The options object can contain the following properties:

  • competitionId: The id of the competition
  • seasonYear: The year of the season
  • groupId: The id of the match group
  • opponentTeamIds: An array of team ids

Alternatively, you can provide a set of match ids to retrieve specific matches.

  • matchId: An array of match ids

getMatch(id): Match

Returns a single match by its id.

getMatchStats(id): MatchStats[]

Returns the statistics for a match by its id for each team.

getLineups(id): Lineup

Returns the lineup for a match by its id for each team.

getMatchEvents(id, sortOrder, limit, offset): MatchEventDetails[]

Returns a list of events for a match by its id. Events are for example goals, cards, substitutions, etc.

getPlayers(options, limit, offset): Player[]

Returns a list of players for the given filter options. The options object can contain the following properties:

  • competitionId
  • seasonYear

Alternatively, you can provide a set of player ids to retrieve specific players.

  • playerIds: An array of player ids

getStandings(options): Standing[]

Returns a list of standings for the given filter options. The options object can contain the following properties:

  • competitionId
  • seasonYear
  • groupIds
  • roundId
  • phase

getTeams(options, limit, offset): Team[]

Returns a list of teams for the given filter options. The options object can contain the following properties:

  • competitionId
  • seasonYear
  • roundIds
  • associationId

Alternatively, you can provide a set of team ids to retrieve specific teams.

  • teamIds: An array of team ids

Contributions

Contributions are welcome. Please open an issue or a pull request and include links to sample API requests when reporting issues or inconsistencies with the typings.

License

This package is licensed under the MIT license.

uefa-api's People

Contributors

erikmichelson avatar

Stargazers

 avatar Pascal avatar

Watchers

 avatar

Forkers

passidel

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.