Flashscore API Scraper
Personal Project
Node.jsJavascriptAPIScraping
This project is a modified fork of the original FlashscoreScraping tool. The original logic was refactored from a local script that generated flat files into a standalone microservice that provides real-time data through a JSON interface.
Key Changes and Improvements
- Transformation into an API: The server utilizes the native Node.js
httpmodule to deliver data through a dedicated/api/scrapeendpoint. - Performance Optimization: While the original implementation performed a linear number of requests based on the match count, this version is optimized to use a fixed constant number of parallel requests. By collecting data simultaneously from both "results" and "fixtures" indexes, the total execution time has been dramatically reduced.
API Specification
Endpoint: GET /api/scrape
The service requires three query parameters to construct a valid request:
sport: Type of sport (e.g.,hockey)country: Country or region (e.g.,world)league: League name (e.g.,world-championship)
Example Request:
GET /api/scrape?sport=hockey&country=world&league=world-championship