Skip to content

A Node.js package for interaction with the Yalies API.

License

Notifications You must be signed in to change notification settings

Yalies/js-yalies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yalies

NPM package summary for yalies

A JavaScript interface to the Yalies API.

Usage

First install with npm or your favorite package manager:

npm install yalies

Import into your project:

const yalies = require('yalies');
// Alternative:
const API = require('yalies').API;
// If you choose this option, simply instantiate as `new API(...)` below.

Instantiate the API by passing your API key:

const api = new yalies.API('api_key')

You'll want to store your in an environment variable or config file of some sort. At any rate, don't commit it to GitHub! :)

Finally, use the people method to query the API, passing an object containing any request criteria you wish, as explained in the Yalies API documentation.

api.people({
    query: 'John',
    filters: {
        school_code: ['YC'],
        college: [
            'Grace Hopper',
            'Davenport'
        ],
        year: [2023, 2024],
        floor: 3,
        leave: [true]
    },
    page: 1,
    page_size: 10
}).then(people => {
    for (let person of people) {
        console.log(person.netid);
    }
});

Feel free to open an issue if you need help!

Author

Erik Boesen

About

A Node.js package for interaction with the Yalies API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published