Skip to content

Auto download and parse recent hltv demos to get utilities data

License

Notifications You must be signed in to change notification settings

csgowiki/hltv-utility-api

Repository files navigation

hltv-utility-api

AutoParser CodeAnalysis CodeFactor

Auto download and parse recent hltv demos to get pro utility records

Build

OS

Ubuntu 20.04LTS

Golang

sudo apt install golang-go

Use go version to check version: 1.13.8 linux/amd64

We need go version higher than go 1.11

Demoinfocs-golang

Install demoinfocs-golang

go get -u github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs

If your network is in CN, you may change Golang's proxy

go env -w GOPROXY=https://goproxy.cn,direct

API Format

Match Info Index

GET: /<mapname>

get recent matches information index.

Request

Response

[
  {
    "event": "Flashpoint 3",
    "maxround": "26",
    "time": "2021-05-11 05:51:51",
    "team1": { "name": "Astralis", "result": 2 },
    "team2": { "name": "OG", "result": 0 },
    "matchId": "2348420"
  }
]

Match Info Detail

GET: /<mapname>/<matchId>

Get match utility records' detail from matchId

etc.

Request

/de_inferno/2348420

Response

[
    <datapack>
]

default tickrate=128

datapack format

Index remark type
0 aim_pitch float32
1 aim_yaw float32
2 air_time float32
3 end_x float32
4 end_y float32
5 end_z float32
6 is_duck bool
7 is_jump bool
8 is_walk bool
9 round int
10 round_throw_time float
11 nickname string
12 steamid string
13 teamname string
14 throw_x float32
15 throw_y float32
16 throw_z float32
17 utility_type string
18 velocity_x float32
19 velocity_y float32
20 velocity_z float32
21 entity_x float32
22 entity_y float32
23 entity_z float32

utility type enum

  • smokegrenade
  • flashbang
  • molotov
  • incgrenade
  • hegrenade

Match Round Detail

GET: /<mapname>/<matchId>/round<roundNumber>

Get match utility records' detail on specific round from matchId

etc.

Request

/de_inferno/2349057/round15

Response

[
    <datapack>
]

data format is same as previous.