/seatgeek-js

Unofficial Javascript wrapper for the SeatGeek API

Primary LanguageJavaScriptMIT LicenseMIT

seatgeek-js

Unofficial Javascript wrapper for the SeatGeek API

This library works with the SeatGeek API to provide an easy way to consume their API through Node.js and the browser.

To see simple examples of client or server, refer to examples/client and examples/sever

Getting started

var seatgeek = new SeatGeek("YOUR_API_KEY");
  • Begin using the API by chaining methods onto the created SeatGeek object.

Node.js Express sample server

  • requires express.js: `npm install express --save"
var SeatGeek = require('seatgeek-js');
var seatgeek = new SeatGeek("YOUR_API_KEY");
var express = require('express');
var app = express();
app.listen(3001);
app.get('/events', _getAllEvents);

function _getAllEvents(request, response) {
    console.log('here')
  return seatgeek.Events.all().get().then(function (res) {
      response.send(res)
  });
}

Sample for the browser

var _seatgeek = new SeatGeek("YOUR_API_KEY");

_seatgeek.Events.all().get().then(function(res) {

});

Currently Supported methods

All functions documented below will be available on the SeatGeek object unless otherwise noted.
To invoke a request, .get() must be chained on all operations.

Events

Events.all()

Purpose: Retrieve all events (result set is returned in pages. See chaining for additional options)

var _seatgeek = new SeatGeek("YOUR_API_KEY");
_seatgeek.Events.all().get().then(function(res) {

});

Events.byId()

Purpose: Retrieve one specific event with an event ID.

var _seatgeek = new SeatGeek("YOUR_API_KEY");
_seatgeek.Events.byId(739515).get().then(function(res) {

});

Chaining methods

  • per_page - Define size of result sets.
  • sortResults - Define how result sets are sorted.
  • page - Request specific page of result set, i.e. paginated results.

Usage

var _seatgeek = new SeatGeek("YOUR_API_KEY");
_seatgeek.Events.all()
        .per_page(20)
        .page(5)
        .get()
        .then(function (res) {
        }

Performers

Performers.byId()

Purpose: Retrieve one specific performer with a performer ID.

var _seatgeek = new SeatGeek("YOUR_API_KEY");
_seatgeek.Performers.byId(3).get().then(function(res) {

});

Performers.byName()

Purpose: Retrieve one specific performer by name.

var _seatgeek = new SeatGeek("YOUR_API_KEY");
_seatgeek.Performers.byName('New York Mets').get().then(function(res) {

});

Performers.bySearch()

Purpose: Retrieve one specific performer by name.

var _seatgeek = new SeatGeek("YOUR_API_KEY");
_seatgeek.Performers.bySearch('red hot').get().then(function(res) {

});