Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/beeequeue/dota-matches-api
🟥 An API that returns upcoming Dota 2 matches from Liquipedia
https://github.com/beeequeue/dota-matches-api
api cloudflare cloudflare-workers dota2 dota2-api match matches schedule series
Last synced: 13 days ago
JSON representation
🟥 An API that returns upcoming Dota 2 matches from Liquipedia
- Host: GitHub
- URL: https://github.com/beeequeue/dota-matches-api
- Owner: beeequeue
- License: other
- Created: 2022-07-19T11:53:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-23T07:29:58.000Z (2 months ago)
- Last Synced: 2024-11-24T19:42:08.360Z (2 months ago)
- Topics: api, cloudflare, cloudflare-workers, dota2, dota2-api, match, matches, schedule, series
- Language: TypeScript
- Homepage: https://dota.haglund.dev/v1/matches
- Size: 1.4 MB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Dota 2 Team Matches API
A simple API that fetches, caches and formats the
current [upcoming match schedule from Liquipedia](https://liquipedia.net/dota2/Liquipedia:Upcoming_and_ongoing_matches).It caches matches for 3 hours after initially fetching them.
Big thanks to [Liquipedia](https://liquipedia.net) for providing the data! It is an amazing website ran and maintained
by amazing people.## API
**Base URL:** `https://dota.haglund.dev`
```ts
type Team = {
name: string | null
url: string | null
}type Match = {
hash: string
teams: [Team | null, Team | null]
matchType: string | null
startsAt: string | null
leagueName: string | null
leagueUrl: string | null
streamUrl: string | null
}
```### `GET /v1/matches`
```ts
type ResponseBody = Match[]
```## Development
### Setup
1. Install dependencies
`pnpm install`
1. Execute DB migrations
`pnpm dev:migrate`
1. Start development server
`pnpm dev`
1. Go wild!### Architecture
```mermaid
flowchart TD
clients([API Clients])
browser([Browser])
worker(Worker):::cf
discord([Discord]):::discord
d1[("D1 (SQLite)")]:::cf
cache("Cache"):::cfclassDef cf stroke:#FFC500,stroke-width:2px
classDef discord stroke:#5865F2subgraph Cloudflare
worker
d1
cache
endd1 <-- all data* --> worker
cache <-- /matches requests --> worker
worker <-- /matches --> clients
worker <-- validate oauth, commands --> discord
%% worker <--> browser
discord <-- init oauth --> browser
```\*Matches,