Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sports-sdk/rotowire

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sports-sdk/rotowire

A package for interacting with the RotoWire API

  • 2.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

@sports-sdk/rotowire

This package provides clients for interacting with the RotoWire API with typed request parameters and responses.

Install

npm i @sports-sdk/rotowire
Feeds Included

You will need a RW API key to interact with this API

The sports and endpoints supported in this package align with use cases needed at the time of writing.

SportPlayersNewsInjuriesLineups
EPL:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
MLB:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
NBA:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
NCAAF:heavy_check_mark::heavy_check_mark::heavy_check_mark:N/A
NFL:heavy_check_mark::heavy_check_mark::heavy_check_mark:N/A
NHL:heavy_check_mark::heavy_check_mark::heavy_check_mark:N/A

Usage

Creating clients
import {RotowireClient} from "@sports-sdk/rotowire";
import {Sport} from "@sports-sdk/core";

// client with RW API token retrieved from environment variable ROTOWIRE_TOKEN
const client = new RotowireClient(Sport.NFL);

// client with RW API token passed into constructor
const clientWithToken = new RotowireClient(Sport.NFL, "rotowire-api-token");
Retrieving data
const news = client.getNews();
// date parameter
const newsOnDate = client.getNews({
    date: "2024-07-04"
});

const injuries = client.getInjuries();

const lineups = client.getLineups();
// date parameter
const lineupsOnDate = client.getLineups({
    date: "2024-07-04"
});
Have additional fields? No problem
import {RotowireClient, MLBNewsResponse, MLBPlayer, MLBUpdates} from "@sports-sdk/rotowire";

interface MyMLBPlayer extends MLBPlayer {
    SomeOtherId: string;
}
interface MyMLBUpdates extends Omit<MLBUpdates, "Player"> {
    Player: MyMLBPlayer;
}

interface MyMLBNewsResponse extends Omit<MLBNewsResponse, "Updates">{
    Updates: Array<MyMLBUpdates>;
} 
const client = new RotowireClient(Sport.MLB);
const myNews = client.getNews<MyMLBNewsResponse>();

Keywords

FAQs

Package last updated on 11 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc