Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

M3MONs/hltv-scraper-api

Repository files navigation

hltv-api

An unofficial python flask api for popular CS2 website hltv.org.

Installation

Prerequisites: Python 3.x (check with python --version or python3 --version)

git clone https://github.com/M3MONs/hltv-api.git
cd hltv-api
pip install -r requirements.txt
python app.py

API Endpoints

Swagger

http://127.0.0.1:8000/apidocs/#/

Teams

Team Rankings

GET /api/v1/teams/rankings
GET /api/v1/teams/rankings/<type>
GET /api/v1/teams/rankings/<type>/<year>/<month>/<day>

Returns the HLTV or VALVE team ranking. Available types: hltv (default), valve. ranking

Team Search

GET /api/v1/teams/search/<name>

Searches for a team by name.

Team Profile

GET /api/v1/teams/<id>/<team_name>

Returns the team profile.

Team Matches

GET /api/v1/teams/<id>/matches
GET /api/v1/teams/<id>/matches/<offset>

Returns a list of team matches (optionally with an offset).

Results

Results

GET /api/v1/results/
GET /api/v1/results/<offset>

Returns the results of HLTV matches. results

Featured Results

GET /api/v1/results/featured

Returns featured results. results_featured

Matches

Upcoming Matches

GET /api/v1/matches/upcoming

Returns upcoming matches.

Match Details

GET /api/v1/matches/<id>/<match_name>

Returns details of the selected match.

Players

Player Search

GET /api/v1/players/search/<name>

Searches for a player by name.

Player Profile

GET /api/v1/players/<id>/<player_name>

Returns the player profile.

Player Stats Overview

GET /api/v1/players/stats/overview/<id>/<player_name>

Returns the player stats overview.

Note: This endpoint requires a valid Cloudflare session. Before using it, run:

python hltv_scraper/hltv_scraper/grab_cf.py

A browser window will open — solve the Cloudflare challenge if it appears. The session is saved to hltv_scraper/cf_session.json and reused by the scraper. If requests start failing with 403, the session has expired — re-run grab_cf.py to refresh it.

News

News

GET /api/v1/news
GET /api/v1/news/<year>/<month>/

Returns news from HLTV. If no parameters provided, returns current month's news.

About

An unofficial python scraper and flask api for popular CS2 website hltv.org.

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /