npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

boxrec

v8.0.5

Published

Retrieve information from BoxRec and return it in JSON format

Downloads

144

Readme

BoxRec

CircleCI Coverage Status
CII Best Practices npm version DeepScan grade Known Vulnerabilities

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: Notice before using this package :warning:

BoxRec has put in some work that will throw captchas if making too many quick requests and IP block you if you trip their firewall. For the sole purpose of blocking packages like this, which is understandable. But at the cost of making it a worse UX for actual people. If you use this project you put yourself at risk of being IP banned by BoxRec for some time, not by user but by IP. This is automatic from their firewall and not something they do manually. There are ways to get by this but nothing to discuss about at this time. Use this package for learning purposes at this time.

:warning: Maintenance :warning:

A few years ago a lot of time was spent on this project, but not so much at the time of this update. 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.

If you do find issues, please raise an issue so others are aware and so they can be triaged.

Thanks

Installation

This project is written in Node. Currently this project supports Node 8+.

npm install boxrec --save
yarn add boxrec

Quick Start

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
}

Methods

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;

How to contribute

Details on how to help can be found here

Additional Documentation

Latest npm published (master)

This link shows all the methods, the parameters and the expected response

Security Requirements

Questions

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.

Is using this software legal?

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.