New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

api-sports

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-sports

An easy-to-use Node.js wrapper for the API Sports service.

latest
Source
npmnpm
Version
1.0.9
Version published
Weekly downloads
18
350%
Maintainers
1
Weekly downloads
 
Created
Source

api-sports

An easy-to-use Node.js wrapper for the API Sports service.

Installation

You can install api-sports using npm:

npm install api-sports

Usage

First, import the Sports class from the api-sports package:

const Sports = require('api-sports');

If you're using ES6 imports:

import Sports from 'api-sports';

Then, create a new Sports instance with your API key:

const sports = new Sports('your-api-key');

You can then use any of the available methods to make requests to the API. For example, if we to make a request to the football endpoint, the football method takes two parameters: the endpoint URL (as a string), and an object of query parameters:

sports.football('leagues', { id: 39 }) // || /leagues
  .then(data => console.log(data))
  .catch(error => console.error(error));

// should log
{
  // ...
  response: [
    {
      league: {
        id: 39,
        // ...
      }
    }
  ]
}

Methods

americanFootball(url, params)

Makes a GET request to the american football API endpoints. API Docs

  • url: The endpoint URL (as a string).
  • params: An object of query parameters.

Returns a Promise that resolves with the response data.

basketball(url, params)

Makes a GET request to the basketball API endpoints. API Docs

baseball(url, params)

Makes a GET request to the baseball API endpoints. API Docs

football(url, params)

Makes a GET request to the football API endpoints. API Docs

formula1(url, params)

Makes a GET request to the formula 1 API endpoints. API Docs

handball(url, params)

Makes a GET request to the handball API endpoints. API Docs

hockey(url, params)

Makes a GET request to the hockey API endpoints. API Docs

nba(url, params)

Makes a GET request to the nba API endpoints. API Docs

rugby(url, params)

Makes a GET request to the rugby API endpoints. API Docs

volleyball(url, params)

Makes a GET request to the volleyball API endpoints. API Docs

Contributing

Contributions are welcome! Please submit a pull request or create an issue to get started.

Keywords

api-football

FAQs

Package last updated on 07 Mar 2026

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