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

sportmonks

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sportmonks

Sportmonks Soccer API

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19
increased by850%
Maintainers
1
Weekly downloads
 
Created
Source

SportMonks Soccer API

installation

npm install sportmonks

usage

var sportmonks = new Sportmonks(__YOUR_API_TOKEN__); 

sportmonks.get(endpoint,params).then( function(resp){
  //resp.data will contain your data
  //resp.meta will contain the meta informations
  console.log(resp);
});

endpoint

you can get the endpoint from the official sportmonks documentation omitting the base url and the parameters (that are set with the params field)

sportmonks.get('v2.0/countries').then( function(resp){
    console.log(resp)
});

params

if you need to specify parameters you can set the params field as follow

sportmonks.get('v2.0/countries/{id}', { id: 13, competitions: true }).then( function(resp){
    //id in the params field will replace {id} in the endpoint
    //competitions: true, will add include=competitions in query string
});

pagination

page number can be added using the page param

sportmonks.get('v2.0/fixtures/between/{from}/{to}', { from: '1998-01-01', to: '2017-12-01', page: 2, lineup: true}).then( function(resp) {
   //pagination info can be found in
   console.log(resp.meta.pagination)
});

FAQs

Package last updated on 07 Jun 2017

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