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 🙏

© 2025 – Pkg Stats / Ryan Hefner

odds-portal-scraper

v2.8.3

Published

odds portal scraper

Downloads

84

Readme

Odds Portal Scraper CLI

A command line tool for scraping soccer odds data from Odds Portal. The tool supports both historical odds data and upcoming matches across multiple leagues and formats.

Features

  • Scrape historical odds data for specified date ranges
  • Get odds for upcoming matches
  • Support for multiple leagues and odds formats
  • Export data to local files or S3 buckets
  • Built with Puppeteer for reliable scraping
  • Configurable logging and error handling

Installation

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • AWS CLI configured (for S3 exports)

Install via npm

npm install -g odds-portal-scraper

Install via yarn

yarn global add odds-portal-scraper

Usage

Commands Overview

odds-portal [command] [options]

Available Commands

| Command | Description | |-----------------|--------------------------------------------------| | historic | Scrape historical odds data | | next-matches | Scrape odds for upcoming matches | | soccer-leagues | List available leagues | | odds-format | List supported odds formats |

Command Details

Historic Odds

Scrape historical odds data for a specified league and date range.

odds-portal historic <leagueName> <startYear> <endYear> [options]

Parameters:

  • leagueName: Name of the league (use soccer-leagues command to see available options)
  • startYear: Starting year for historical data (e.g., 2020)
  • endYear: Ending year for historical data (e.g., 2023)

Options:

| Option | Description | |-----------------|--------------------------------------------------| | --odds-format | Odds format (default: EU) | | --local | Local directory to save JSON files | | --s3 | S3 bucket name to upload data |

Example:

odds-portal historic premier-league 2020 2023 --local ./data --odds-format eu

next-matches

Scrape odds for upcoming matches in a specified league.

Scrape next matches odds data for a given soccer league.

Parameters:

  • leagueName: Name of the league (use soccer-leagues command to see available options)

Options:

| Option | Description | |-----------------|--------------------------------------------------| | --odds-format | Odds format (default: EU) | | --local | Local directory to save JSON files | | --s3 | S3 bucket name to upload data |

odds-portal next-matches premier-league --local ./data --odds-format eu

This will scrape next matches odds data for the English Premier League.

Soccer Leagues

List all available leagues for scraping.

odds-portal soccer-leagues

Odds Formats

List all supported odds formats.

odds-portal odds-format

Configuration

Environment Variables

| Variable | Description | |------------------------|--------------------------------------------------| | ODDS_PORTAL_PROXY_URL | Proxy URL for scraping | | AWS_ACCESS_KEY_ID | AWS access key for S3 exports | | AWS_SECRET_ACCESS_KEY | AWS secret key for S3 exports |

Data Structure

Scraped data is saved in JSON format with the following structure:

{
  "scrapedAt": "2023-10-15 14:30:00",
  "day": "Sunday",
  "date": "2023-10-15",
  "time": "14:00",
  "homeTeam": "Manchester United",
  "awayTeam": "Liverpool",
  "mlFirstHalf": [
    {
      "bookMakerName": "Bet365",
      "hw": "2.10",
      "d": "3.25",
      "aw": "3.50"
    }
  ],
  "mlSecondHalf": [...],
  "mlFullTime": [...],
  "leagueName": "premier-league",
  "underOver25": [
    {
      "bookmakerName": "Bet365",
      "oddsOver": "1.80",
      "oddsUnder": "2.00"
    }
  ],
  "underOver15": [...],
  "underOver35": [...]
}

Error Handling

The tool includes comprehensive error handling with the following features:

  • Automatic retries for failed requests
  • Detailed error logging
  • Graceful shutdown on critical errors
  • Validation of input parameters

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Create a new Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support or feature requests, please open an issue on the GitHub repository.