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 🙏

© 2026 – Pkg Stats / Ryan Hefner

public-banner-api

v1.0.3

Published

A Typescript wrapper for the Banner API used by many universities

Readme

Public Banner API Documentation

The BannerAPI class provides a structured interface for interacting with a Banner 9 server, allowing for basic operation, retrieving terms, subjects, and searching courses. It utilizes Axios for making HTTP requests and helps manage session tokens. Responses have typescript types for easy integration with typescript projects.

Usage Example

async function simpleDemo() {
  const banner = new BannerAPI(
    "https://nubanner.neu.edu/StudentRegistrationSsb/ssb"
  );
  // fetch terms
  const terms = await banner.getTerms();
  // expect terms to be an array with at least one element
  console.log(terms);
  //init search for courses in the first term
  await banner.initSearch(terms[0].code);
  //search all courses with that term code
  const searchResults = await banner.searchCourses({
    txt_term: terms[0].code,
    // sortColumn: "subjectDescription",
  });
  console.log(searchResults);
}

Class Initialization

const apiClient = new BannerAPI(baseURL);
  • baseURL: The url for the banner server. The URL varies by college but it likely follows this general format bannername.school.edu/StudentRegistrationSsb/ssb

Methods

getTerms(options: Options): Promise<Term[]>

Retrieves a list of terms based on the provided query parameters. Does not require a session token.

  • Parameters:
    • options (Optional): Object containing offset, max, and searchTerm.
  • Returns: A promise that resolves to an array of terms.

getSubjects(termId: string, options: Options): Promise<Subject[]>

Fetches subjects for a specified term ID with optional search filtering. Does not require a session token.

  • Parameters:
    • termId: The term ID for which to search subjects.
    • options: Object containing searchTerm, offset, and max.
  • Returns: A promise that resolves to an array of subjects.

initSearch(termId: number): Promise<boolean>

Initializes a search session for a specific term ID, creating a session token that authorizes searchCourses

  • Parameters:
    • termId: The term ID to initialize the search with.
  • Returns: A promise that resolves to a boolean indicating if the request was successful.

searchCourses(params, options?): Promise<SearchResponse>

Conducts a detailed search for courses based on specific criteria. This method can filter courses by subject, course number, term, and more. It can also handle pagination and sorting of the search results.

Parameters

  • params: Object - Specifies the criteria for filtering the course search.

    • txt_subject (optional): The subject code to filter courses (e.g., "CS" for Computer Science).
    • txt_courseNumber (optional): The course number to further refine the search (e.g., 101).
    • txt_term: The term ID to search within (e.g., 202480). This parameter is required and must match the term ID initialized with initSearch.
    • startDatepicker (optional)
    • endDatepicker (optional)
    • pageOffset (optional): The offset for pagination, useful for fetching courses in chunks.
    • pageMaxSize (optional): The maximum number of courses to return in one response. Must be between 1 and 500.
    • sortColumn (optional): The column to sort the search results by.
    • sortDirection (optional): The direction for sorting, either "asc" for ascending or "desc" for descending.
  • options (Optional): Object - Additional options for the course search.

    • initSearch: A boolean for choosing to auto init the search by calling initSearch with the txt_term, this is false by default
  • Returns:

    • Promise<SearchResponse>: A promise that, when resolved, returns a SearchResponse object containing the results of the search operation. This object includes details such as the total count of found courses, pagination details, and an array of courses that match the search criteria.

bannerFetch(method, endpoint, queryParams, headers, body): Promise<any>

Internal method for making HTTP requests to the API, including handling of session tokens and parsing of responses.

  • Parameters:
    • method: The HTTP method to use ("GET" or "POST").
    • endpoint: The specific endpoint to target for the data fetch.
    • queryParams: Query parameters to append to the request URL.
    • headers: Additional HTTP headers for the request.
    • body: The request body, applicable for "POST" method.
  • Returns: A promise that resolves to the parsed response data.

Types

Term

Represents a registration term, consisting of a term id (code) and description

Example Term object:

{
  "code": 202460,
  "description": "Summer 2 2024 Semester"
}

Subject

Describes a subject object, with subject code string and full description

Example Subject object:

{
  "code": "CHME",
  "description": "Chemical Engineering"
}

SearchResponse

TODO: document me