https://github.com/alfianlosari/xcafootballdataclient
Swift Client to interact with FootballData API
https://github.com/alfianlosari/xcafootballdataclient
football-api football-data swift
Last synced: about 1 month ago
JSON representation
Swift Client to interact with FootballData API
- Host: GitHub
- URL: https://github.com/alfianlosari/xcafootballdataclient
- Owner: alfianlosari
- License: mit
- Created: 2023-06-24T13:14:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-24T13:46:04.000Z (over 2 years ago)
- Last Synced: 2024-11-14T06:57:07.874Z (12 months ago)
- Topics: football-api, football-data, swift
- Language: Swift
- Homepage:
- Size: 9.77 KB
- Stars: 3
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# XCAFootbalDataClient
Swift Client to interact with [Football-Data API](https://www.football-data.org). It uses Swift Async Await API to fetch data from API.
## Register For API Key
To get a Free API Key with limited Quota, please visit [Football-Data API](https://www.football-data.org)
## Usage
### Initialize passing API Key
```swift
let client = FootballDataClient(apiKey: "Your API KEY")
```
### Fetch Standings
Fetch latest table standings for EPL
```swift
let standings = try await client.fetchStandings(competitionId: 2021, filterOption: .latest)
```
### Fetch Top Scorers
Fetch top scorers for Spanish La Liga on season 2020/2021
```swift
let scorers = try await client.fetchTopScorers(competitionId: 2014, filterOption: .year(2020)
```