Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aparrett/soccer-api
A GraphQL wrapper on a REST soccer api.
https://github.com/aparrett/soccer-api
Last synced: 2 days ago
JSON representation
A GraphQL wrapper on a REST soccer api.
- Host: GitHub
- URL: https://github.com/aparrett/soccer-api
- Owner: aparrett
- License: mit
- Created: 2020-06-27T22:23:24.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-13T04:23:27.000Z (almost 2 years ago)
- Last Synced: 2024-04-28T06:31:03.910Z (7 months ago)
- Language: JavaScript
- Size: 508 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# soccer-api
A GraphQL wrapper on a soccer (football) REST API. The REST API documentation can be found [here](https://www.api-football.com/documentation#teams-data-requests). **Beware: this API has outdated data. Teams and rosters may not be up-to-date.**FYI: The product API Key in Production is limited to 100 requests per day and requests can add up quickly since one GraphQL query can mean multiple requests.
### Local Installation
To run in local, you need to set up a .env file with your own API key from the api-football website. You will be limited to 100 requests per day.```
# .env
API_KEY=insert_api_key_here
```### Intended Use
This project is currently only being used for learning how to wrap a REST API with GraphQL but feel free to make PRs, comment suggestions, or use the API. Do not use this in a production environment.### Useful queries
Get all of the nested data for each team in a league
```
{
league(id: 2){
league_id,
teams {
name
venue_name
venue_surface
venue_address
venue_city
venue_capacity
players {
player_id
player_name
number
lastname
number
position
age
birth_date
birth_place
birth_country
nationality
}
}
}
}
```