Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matrixsenpai/pandascore-api
A Swift implementation of the PandaScore API
https://github.com/matrixsenpai/pandascore-api
api api-client league-of-legends pandascore swift
Last synced: about 1 month ago
JSON representation
A Swift implementation of the PandaScore API
- Host: GitHub
- URL: https://github.com/matrixsenpai/pandascore-api
- Owner: MatrixSenpai
- License: mit
- Created: 2019-04-24T12:10:14.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-11T19:48:39.000Z (over 4 years ago)
- Last Synced: 2024-10-15T09:55:34.998Z (3 months ago)
- Topics: api, api-client, league-of-legends, pandascore, swift
- Language: Swift
- Homepage: https://matrixsenpai.github.io/pandascore-api/
- Size: 1.15 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PandaScoreAPI
![Package Managers](https://img.shields.io/badge/Package%20Managers-SPM%20%7C%20CocoaPods-important.svg?style=for-the-badge)
![Cocoapods platforms](https://img.shields.io/cocoapods/p/PandaScoreAPI.svg?style=for-the-badge)
![Cocoapods](https://img.shields.io/cocoapods/v/PandaScoreAPI.svg?style=for-the-badge)
![Discord](https://img.shields.io/discord/569027254550528030.svg?style=for-the-badge)**DEPRECATED** in favor of [api-common/Pandascore](https://github.com/MatrixSenpai/api-common)
### A Swift implementation of the PandaScore API
A callback based API client with built-in reactive extensions
_Currently, this package does not support Live (`wss://`)_
#### Overview
To get started, create a client and pass in your token, like so:
```swift
let client: Client = Client("")
```##### Making a request
Each endpoint has a similar structure.Simple endpoints like `getChampion` and `getItem` can take an ID or a list of IDs, and return a single object or a filtered list.
More complex endpoints, like those for `games`, `matches`, `series`, and `tournaments`, have a slightly more complex structure
There are 3 main parts to these requests:
- page/per_page
- filter/range
- sortPage and per_page are relatively self-explainatory. They deal with the pagination of the request
> Note: In future versions, a response will contain the next and previous paging information, to allow for easier pagination of requestsFilter and range allow the limitations on the data returned by applying filters on the properties _of the returning object_.
Sort allows the data returned to be sorted by a property _on the returning objects_
A quick sample of making requests
```swift
let filterObject = GetMatchesParametersObject(finished: true, number_of_games: 1)
let sortObject = GetMatchesSortObject(keys: [(.begin_at, true)])
client.getMatches(filter: filterObject) { response in
// Do something
}
```
This request gets only finished matches with one game, and sorts them in ascending order by when they began.For further documentation on how the API works, check out [the PandaScore official documentation](https://developers.pandascore.co/doc/).
#### Problems?
Submit an issue