Star Trek Scripts API

This is a simple read-only API to demonstrate the usage of Express.js + MongoDB Atlas + Mongoose.

This API currently delivers JSON script lines from Star Trek: The Next Generation, Star Trek: Deep Space 9, and Star Trek: Voyager. Other shows may be added at a later date.


Endpoints

There are currently 3 endpoints:

Line:

startrek.taylorsreid.com/api/<3_LETTER_SHOW_CODE>/<SEASON_NUMBER>/<EPISODE_NUMBER>/<LINE_NUMBER returns a single line from an episode.

Ex: startrek.taylorsreid.com/api/tng/4/20/206 returns {"character":"WORF","line":"Sir, I protest. I am not a merry man.","_id":"6537b6d53e11e59438f860fe"}.

Episode:

startrek.taylorsreid.com/api/<3_LETTER_SHOW_CODE>/<SEASON_NUMBER>/<EPISODE_NUMBER> returns the script for an entire episode.

Ex: startrek.taylorsreid.com/api/tng/1/1 returns the entire script for Star Trek: The Next Generation, S01E01 (Encounter at Farpoint).

Random:

startrek.taylorsreid.com/api/random serves a random Star Trek line from the database.


Notes:

Currently supported show codes are: "tng", "ds9", and "voy".

Please note that many seasons do not have an episode 2 because episode 1 was double length and counted as episode 1 and 2 by the show's creators.