This project allows you to query information from BoxRec and return it in JSON format. The purpose of this project is to act as an unofficial API for BoxRec. This project is not affiliated with BoxRec.
Warning
A few years ago a lot of time was spent on this project, but not so much these days. With the changes that go into BoxRec, it is always a game of cat and mouse when it comes to keeping things working. Do not expect this package to continuously work.
The current status of this project is that it is not working, or working very poorly. An attempt was made to use Puppeteer in headless mode to bypass captchas but it's not working well. Read more here. Any help devising a solution to unblock this project would be appreciated. The landscape has changed since last attempted (2022) so maybe a solution that is easier is readily available.
Note
If you do find issues, please raise an issue so others are aware and so they can be triaged.
This project is written in Node. Currently this project supports Node 8+.
npm install boxrec --save
yarn add boxrec
const boxrec = require("boxrec").Boxrec;
or
import {Boxrec as boxrec} from "boxrec";
Use credentials to log into BoxRec and then use any of the methods below. Pass the cookie into all methods.
example:
try {
const cookies = await boxrec.login(BOXREC_USERNAME, BOXREC_PASSWORD);
// successfully logged in
} catch (e) {
// error occurred logging in
}
Please read the documentation on how to use these methods
getBoutById
getBoxerPDF
getBoxerPrint
getChampions
getDate
getEventById
getEventsByLocation
getPeopleByLocation
getPeopleByName
getPersonById
getRatings
getResults
getSchedule
getTitleById
getTitles
getVenueById
getWatched
login
search
unwatch
watch
The return values are a class instance that can parse the data. To return the entire JSON object, use the output
accessor.
const boxer = await boxrec.getPersonById(352);
const {output} = boxer;
Details on how to help can be found here
This link shows all the methods, the parameters and the expected response
What and where is the BoxRec global ID?
The BoxRec global ID or ID is the unique ID of the person, event, bout, etc. It can be found in the URL bar. For people it can also be found on their page.
examples:
(Person) Vasiliy Lomachenko - http://boxrec.com/en/boxer/659771. The BoxRec global ID is 659771
.
(Bout) Terence Crawford vs. Amir Khan - http://boxrec.com/en/event/778793/2299385. The BoxRec bout ID is 778793/2299385
(Event) Golden Boy May 4th 2019 Event - http://boxrec.com/en/event/781894. The BoxRec event ID is 781894
Why is there global ID and ID?
I took the safe approach and assumed that there may be some difference between the two.
When this software was initially written, the Terms and Conditions on BoxRec did not include anything about web scraping.
BoxRec had updated their Terms and Conditions sometime in the middle of 2018 to include that you may not use software to extract data from BoxRec.
Web scraping on wikipedia states under legal issues "The legality of web scraping varies across the world. In general, web scraping may be against the terms of use of some websites, but the enforceability of these terms is unclear".
Conclusion: It is unclear. What you do with this package though could very well be illegal.