Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/4rnv/quotesapi
NodeAPI to fetch anime quotes.
https://github.com/4rnv/quotesapi
anime nodejs pug quotes-api
Last synced: about 1 month ago
JSON representation
NodeAPI to fetch anime quotes.
- Host: GitHub
- URL: https://github.com/4rnv/quotesapi
- Owner: 4rnv
- Created: 2024-07-21T15:30:44.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-29T15:40:43.000Z (4 months ago)
- Last Synced: 2024-10-10T23:01:12.307Z (about 1 month ago)
- Topics: anime, nodejs, pug, quotes-api
- Language: JavaScript
- Homepage: https://yurippe.vercel.app/
- Size: 134 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Quotes API
This API lets you fetch and add quotes from various anime characters and shows. Built with MongoDB, Express, Pug, and Node.js, it's designed to be convienent and straightforward to use.
### Endpoints
#### 1. Get Quotes
**URL**: `/api/quotes`
Fetches quotes based on character and show filters.
**Method**: `GET`
**Query Parameters**:
- `character=`: Filters quotes by character. Case-insensitive, partial matches allowed. You can filter for quotes from multiple characters by separating them with a comma.
- `show=`: Filters quotes by show. Case-insensitive, partial matches allowed. You can filter for quotes from multiple shows by separating them with a comma.
- `random=` (optional): Number of random quotes to fetch. Takes any non-zero integer value. Default is 1. If this is not set the API will return all quotes from whatever show or character you have selected.**Example Queries**:
- Get all quotes by particular character: `/api/quotes?character=lelouch`
- Get random quote from particular character: `/api/quotes?character=lelouch&random=1`
- Get all quotes from particular show: `/api/quotes?show=code geass`
- Get random quote from particular show: `/api/quotes?show=code geass&random=1`
- Get quotes by multiple characters: `/api/quotes?character=lelouch,oscar jarjayes,spike spiegel`
- Get quotes by multiple shows: `/api/quotes?show=code geass,rose of versailles,violet evergarden`
- Get random quote from list of characters: `/api/quotes?character=lelouch,oscar jarjayes,spike spiegel&random=1`
- Get random quote from list of shows: `/api/quotes?show=code geass,rose of versailles,violet evergarden&random=1`
- Get all quotes: `/api/quotes`**Responses**:
- Status: `200 OK`
- Body: JSON Array of quotes filtered by show and/or character
- Status: `404 Not Found`
- Body: "No quotes found for the given criteria"
- Status: `500 Internal Server Error`
- Body: "Error Message"### Usage Examples
You can use cURL to get quotes in the terminal. Alternatively, you could also use the [hosted instance](https://yurippe.vercel.app/) directly through your web browser by appending your query to the URL in the specified format.
**Get quotes by character**:
```sh
curl -X GET "https://yurippe.vercel.app/api/quotes?character=lelouch"
```**Get random quotes**:
```sh
curl -X GET "https://yurippe.vercel.app/api/quotes?character=lelouch&random=2"
```**Get quotes by multiple characters and shows**:
```sh
curl -X GET "https://yurippe.vercel.app/api/quotes?character=lelouch,oscar&show=code geass,rose of versailles"
```### Notes
Most of the quotes used in this project were extracted from [cf-anime-quotes](https://github.com/aynh/cf-anime-quotes) by [AynH](https://github.com/aynh). Apart from these, several dozen quotes from newer or unquoted shows were added by yours truly.