Shower Thoughts
Shower Thoughts is a web api to get shower thoughts from r/showerthoughts. It makes calls to the reddit api every 90 seconds and stores any new shower thoughts in a postgresql database. You can access this data through the publically available api. These shower thoughts are added automatically, so some may not be quality shower thoughts. Examples of each endpoint are at the end of each one.
Base URL: https://showerthoughts.nickf.me/api/
Endpoint: thoughts
Returns an array of the most recent thoughts added to the database or an empty array if the options requirements do not meet the any thought in the database.
Options:
- author: Returns results only from this author (must be a valid reddit name whose in the database). Default is an empty string which means all authors.
- over_18: Returns nsfw shower thoughts if set to
true
and non-nsfw shower thoughts if set tofalse
. - from: All thoughts posted from the specified date (inclusive) to present or the to date. Formatted with
YYYY-MM-DD
and the default is an empty string (no set minimum). - to: All thoughts posted from the start of time or the from date to the the specified date (inclusive). Formatted with
YYYY-MM-DD
and the default is an empty string (no set maximum). - limit: The maximum amount of thoughts that can be returns with the api call. default is 10, minimum is 1, and maximum is 1000.
https://showerthoughts.nickf.me/api/thoughts
https://showerthoughts.nickf.me/api/thoughts?author=example
https://showerthoughts.nickf.me/api/thoughts?over_18=true
https://showerthoughts.nickf.me/api/thoughts?from=2023-12-15
https://showerthoughts.nickf.me/api/thoughts?to=2023-12-14
https://showerthoughts.nickf.me/api/thoughts?from=2023-12-15&to=2023-12-16
https://showerthoughts.nickf.me/api/thoughts?limit=1000
https://showerthoughts.nickf.me/api/thoughts?from=2023-12-15&to=2023-12-16&author=example&over_18=true&limit=1000
Endpoint: thoughts/{id}
Returns a specific thought from an id or an error if the id is not in the database.
Endpoint: thoughts/random
Returns a random thought or nothing if the options requirements do not meet the any thought in the database (i.e. there are no reddit posts from=1920-02-02, to=1922-05-10).
Options:
- author: Returns results only from this author (must be a valid reddit name whose in the database). Default is an empty string which means all authors.
- over_18: Returns nsfw shower thoughts if set to
true
and non-nsfw shower thoughts if set tofalse
. - from: All thoughts posted from the specified date (inclusive) to present or the to date. Formatted with
YYYY-MM-DD
and the default is an empty string (no set minimum). - to: All thoughts posted from the start of time or the from date to the the specified date (inclusive). Formatted with
YYYY-MM-DD
and the default is an empty string (no set maximum).
https://showerthoughts.nickf.me/api/thoughts/random
https://showerthoughts.nickf.me/api/thoughts/random?author=example
https://showerthoughts.nickf.me/api/thoughts/random?over_18=true
https://showerthoughts.nickf.me/api/thoughts/random?from=2023-12-15
https://showerthoughts.nickf.me/api/thoughts/random?to=2023-12-14
https://showerthoughts.nickf.me/api/thoughts/random?from=2023-12-15&to=2023-12-16
https://showerthoughts.nickf.me/api/thoughts/random?from=2023-12-15&to=2023-12-16&author=example&over_18=true
Endpoint: thoughts/counts
Returns the total number of thoughts currently in the database.