OpenCourseAPI / OpenCourseAPI

An open source API to scrape, process, and serve college course and class data 📒
https://opencourse.dev
MIT License
9 stars 6 forks source link

Batch Quarter & Year Parameters Are URL-Specific #13

Open Pandawan opened 3 years ago

Pandawan commented 3 years ago

When making a batch request (/:campus/classes), the quarter and year parameters are passed in the URL (as query parameters) rather than in the class object of the resources. This means that when requesting for multiple classes in different quarters or different years, a separate request is required. It'd make more sense if all of these could be grouped into one batch request.

Ideally, the batch endpoint could take resources like these:

{
  campus: string,
  CRN: number,
  year: number,
  quarter: 'summer' | 'fall' | 'winter' | 'spring'
}

Retaining the same possible combinations: CRN, dept, or dept + course. I also threw campus in there for the same reason; the endpoint would therefore be /classes.

It'd be more efficient (one batch request for any data in the entire database) and would probably allow for more use-cases.

madhavarshney commented 3 years ago

We may want to think about the max # of individual results the batch endpoint should accept and the max amount of data it should send.