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
- Install via npm :
npm install seatgeek-js - Require the module
var SeatGeek = require('seatgeek-js') - Obtain an [API key from SeatGeek] (https://seatgeek.com/?next=%2Faccount%2Fdevelop#login).
- Initialize the
SeatGeekobject
var seatgeek = new SeatGeek("YOUR_API_KEY");- Begin using the API by chaining methods onto the created
SeatGeekobject.
Sample for the browser
var _seatgeek = new SeatGeek("YOUR_API_KEY");
_seatgeek.Events.all().get().then(function(res) {
});npm run rollup and the output file is in dist/seatgeek.js.
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.
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) {
});Purpose: Retrieve one specific event with an event ID.
var _seatgeek = new SeatGeek("YOUR_API_KEY");
_seatgeek.Events.byId(739515).get().then(function(res) {
});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) {
}Purpose: Retrieve one specific performer with a performer ID.
var _seatgeek = new SeatGeek("YOUR_API_KEY");
_seatgeek.Performers.byId(3).get().then(function(res) {
});Purpose: Retrieve one specific performer by name.
var _seatgeek = new SeatGeek("YOUR_API_KEY");
_seatgeek.Performers.byName('New York Mets').get().then(function(res) {
});Purpose: Retrieve one specific performer by name.
var _seatgeek = new SeatGeek("YOUR_API_KEY");
_seatgeek.Performers.bySearch('red hot').get().then(function(res) {
});