npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

seatgeek-client

v0.1.5

Published

Client for the SeatGeek API

Downloads

17

Readme

SeatGeek Client

Coverage Status Build Status

Introduction

A JavaScript client that serves as an interface layer on top of the SeatGeek API.

It allows fetching genre, performer, taxonomy, venue, and event information.

Installation

  • npm install seatgeek-client
  • NPMJS

Usage

*** ALL ARGUMENTS ARE OPTIONAL UNLESS OTHERWISE SPECIFIED ***

Global Pagination Arguments

  • perPage
    • Represents the number of records to return.
    • Default value is 100.
  • page
    • Represents the page to query.
    • Default value is 1.

Fetch Genres

import {SeatGeekClient} from 'seatgeek-client';

let firstOneHundredGenresFromPage1 = SeatGeekClient.getGenres();
let firstTenGenresFromPage1 = SeatGeekClient.getGenres({perPage: 10});
let firstTenGenresFromPage2 = SeatGeekClient.getGenres({perPage: 10, page: 2});

Fetch Taxonomies

import {SeatGeekClient} from 'seatgeek-client';

let firstOneHundredTaxonomiesFromPage1 = SeatGeekClient.getTaxonomies();
let firstTenTaxonomiesFromPage1 = SeatGeekClient.getTaxonomies({perPage: 10});
let firstTenTaxonomiesFromPage2 = SeatGeekClient.getTaxonomies({perPage: 10, page: 2});

Fetch Performers

import {SeatGeekClient, Taxonomy, Genre} from 'seatgeek-client';

// this search will return all performers with
// id = 1 OR id = 2 OR id = 3
// slug = performer-slug-1 AND slug = performer-slug-2 (which should never happen)
// part of the NBA Taxonomy OR the Concert Taxonomy
// part of the Pop Genre AND the Classical Genre
// search on the response document for jaebaebae
let performersSearch = {
  ids: [1, 2, 3],
  slugs: ['performer-slug-1', 'performer-slug-2'],
  taxonomies: [Taxonomy.NBA, Taxonomy.CONCERT],
  genres: [Genre.POP, Genre.CLASSICAL],
  queryString: 'jaebaebae',
  perPage: 4,
  page: 5
};

let performers = SeatGeekClient.getPerformers(performersSearch);

Arguments

  • ids
    • An array of performer ids to query for
    • An or search
    • Default value is an empty array
  • slugs
    • An array of performer slugs to query for
    • An and search
    • Default value is an empty array
  • taxonomies
    • An array of taxonomies to filter from
    • An or search
    • Default value is an empty array
  • genres
    • An array of genres to filter from
    • An and search
    • Default value is an empty array
  • queryString
    • A string to query against
    • Default behavior is an empty string

Fetch Venues

import {SeatGeekClient, Unit} from 'seatgeek-client';

// this search will return all venues with
// id = 1 OR id = 2 OR id = 3
// various location information (cityName, stateCode, etc.)
// use the ip address as the location to search venues on
// use the specified latitude and longitude
// only look for venues within a 6 mile radius
let venuesSearch = {
  ids: [1, 2 , 3],
  cityName: 'Boston',
  stateCode: 'MA',
  countryCode: 'USA',
  postalCode: '02122',
  queryString: 'WICKED PISSAH DOOD',
  useIpAddress: true,
  latitude: 4,
  longitude: 5,
  range: 6,
  unit: Unit.MILE,
  perPage: 7,
  page: 8,
};

let venues = SeatGeekClient.getVenues(venuesSearch);

Arguments

  • ids
    • An array of venue ids to query for
    • Default value is an empty array
  • cityName
    • A string representing a city name
    • Default value is an empty string
  • stateCode
    • A string representing the ISO state code
    • Default value is an empty string
  • countryCode
    • A string representing the ISO country code
    • Default value is an empty string
  • useIpAddress
    • A boolean representing whether or not to use the IP address location to search for venues
    • Default value is false
  • latitude and longitude
    • Use coordinates to search for venues
    • Cannot specify just latitude or longitude
  • range
    • An integer representing the search radius distance
    • Default value is 10
  • unit
    • An enum representing the search radius distance unit
    • Default value is Unit.MILE because fuck you, rest of the world, with your logical unit system.

Fetch Events

import {SeatGeekClient, PerformerField, PerformerSpecificity, Taxonomy, TaxonomyField, Unit, SortOption, SortDirection, FilterOption, Operator} from 'seatgeek-client';

let query = {
  ids: [1, 2, 3, 4],
  venues: {
    ids: [5, 6, 7],
    cityName: 'Boston',
    stateCode: 'MA',
    countryCode: 'US',
    postalCode: '02144'
  },
  performers: [
    {
      field: PerformerField.ID,
      specificity: PerformerSpecificity.ANY,
      value: 8
    },
    {
      field: PerformerField.SLUG,
      specificity: PerformerSpecificity.PRIMARY,
      value: 'boston-celtics'
    }
  ],
  taxonomies: [
    {
      taxonomy: Taxonomy.NBA
    },
    {
      taxonomy: Taxonomy.CONCERTS,
      field: TaxonomyField.PARENT_ID,
    }
  ],
  filters: [
    {
      option: FilterOption.AVERAGE_PRICE,
      operator: Operator.LESS_THAN,
      value: 9
    },
    {
      option: FilterOption.LISTING_COUNT,
      operator: Operator.GREATER_THAN_OR_EQUAL_TO,
      value: 10
    }
  ],
  geolocation: {
    useIpAddress: false,
    latitude: 10,
    longitude: 11,
    range: 12,
    unit: Unit.KILOMETER
  },
  sort: {
    option: SortOption.ID,
    direction: SortDirection.ASCENDING
  },
  perPage: 13,
  page: 14
};
let events = SeatGeekClient.getEvents(query);

Arguments

  • ids
    • An array of event ids to query for
    • Default value is an empty array
  • venues
    • An object used to specify venue filtering
    • ids
      • An array of venue ids to query for
      • Default value is an empty array
  • cityName
    • A string representing a city name
    • Default value is an empty string
  • stateCode
    • A string representing the ISO state code
    • Default value is an empty string
  • countryCode
    • A string representing the ISO country code
    • Default value is an empty string
  • useIpAddress
    • A boolean representing whether or not to use the IP address location to search for venues
    • Default value is false
  • latitude and longitude
    • Use coordinates to search for venues
    • Cannot specify just latitude or longitude
  • range
    • An integer representing the search radius distance
    • Default value is 10
  • unit
    • An enum representing the search radius distance unit
    • Default value is Unit.MILE because fuck you, rest of the world, with your logical unit system.