eFootball Scraper API
API nội bộ để điều khiển scraper và truy vấn dữ liệu cầu thủ eFootball đã cào. Tất cả data được lấy từ eFootbase API và lưu vào MongoDB riêng.
Base URL: http://localhost:4000
Database: efootball_scraper (MongoDB)
Tổng cầu thủ: ~43,000 (432 pages × 100)
Nguồn dữ liệu gốc
Data được cào từ eFootbase API — API nội bộ của ứng dụng eFootbase (Dart/Flutter). Không có tài liệu chính thức.
| Header | Value |
|---|---|
x-api-key |
L-}i@R-KwsGk&nB;C4)RBSB+_AQsTSK5Sxa&d:>oz54
|
User-Agent |
Dart/3.3 (dart:io) |
| Param | Mô tả | Default |
|---|---|---|
limit |
Số cầu thủ/trang (max 100) | 50 |
page |
Số trang | 1 |
Scraper Control
Bắt đầu cào
Body (JSON):
| Field | Type | Mô tả | |
|---|---|---|---|
startPage |
number | Trang bắt đầu | optional |
endPage |
number | Trang kết thúc | optional |
limit |
number | Cầu thủ/trang (max 100) | optional |
skipImages |
boolean | Bỏ qua tải ảnh | optional |
Dừng scraper
Không cần body. Scraper sẽ dừng sau khi xong cầu thủ hiện tại và lưu progress.
Tiếp tục từ lần trước
Tiếp tục cào từ page cuối đã hoàn thành.
Cào lại page lỗi
Cào lại các page bị lỗi từ lần chạy trước.
Trạng thái hiện tại
Trả về toàn bộ trạng thái scraper: status, page hiện tại, counters, recent players...
Data API
Danh sách cầu thủ
| Param | Type | Mô tả | Default |
|---|---|---|---|
page |
number | Trang | 1 |
limit |
number | Số kết quả/trang | 20 |
search |
string | Tìm theo tên (regex) | — |
sort |
string | Sắp xếp theo field | overall.max |
Chi tiết cầu thủ
Trả về toàn bộ thông tin 1 cầu thủ theo efhubId.
Thống kê DB
Tổng số cầu thủ, OVR trung bình, OVR cao nhất.
Real-time SSE
Stream real-time trạng thái scraper. Dùng
EventSource trong JavaScript:
const es = new EventSource('/events'); es.onmessage = (event) => { const state = JSON.parse(event.data); console.log(state.currentPlayer, state.totalPlayers); };
Player Document Schema
Cấu trúc document MongoDB cho mỗi cầu thủ:
{
"efhubId": "89136409091415",
"name": "Lionel Messi",
"nameNormalized": "lionel messi",
"nameJa": "リオネル メッシ",
"nationality": "Argentina",
"club": "FC Barcelona",
"age": 19,
"height": 170,
"weight": 67,
"foot": "Left",
"positions": ["CF", "SS", "RWF", "AMF"],
"overall": { "base": 89, "max": 105 },
"levels": { "current": 1, "max": 34 },
"stats": {
"level1": {
"offensiveAwareness": 79,
"dribbling": 83,
"speed": 78,
// ... 26 chỉ số tổng cộng
},
"maxLevel": {
"dribbling": 104,
"speed": 104,
// ... stats ở max level
}
},
"skills": ["Double Touch", "One-touch Pass", ...],
"playstyles": ["Creative Playmaker"],
"playstylePassives": ["Mazing Run", "Trickster"],
"booster": { "name": "Booster +5", "stats": {...} },
"condition": { "form": "A", "injuryResistance": 1 },
"weakFoot": { "accuracy": 2, "usage": 1 },
"images": {
"transparent": "data/images/players/89136409091415.png",
"cardFront": "data/images/cards/89136409091415/front.png",
// ... back, mobile, dynamic
},
"emblems": {
"nationality": "data/images/emblems/xxx.png",
"league": "data/images/emblems/xxx.png",
"team": "data/images/emblems/xxx.png"
},
"originalUrls": { // URL gốc từ API },
"timeAdded": "2024-12-04T00:00:00.000Z",
"source": "efootbase.com",
"scrapedAt": "2026-05-29T06:00:00.000Z"
}