Git Product home page Git Product logo

kitagawachan-api's Introduction

kitagawachan

Kitagawachan Api

Rest Api Collection Quote Anime

Built Use

MongoDB Express.js NodeJS



Welcome to the Kitagawachan Api documentation. This API provides a collection of quotes from various anime series and characters. You can retrieve random quotes, quotes by anime title, quotes by anime character, create new quotes, and more. The API is built using Express.js and MongoDB.

To test the POST request functionality, you can visit the Try POST Request Page in your web browser. This page allows you to submit quotes to the Kitagawachan-Api and see the response.

Base URL: http://localhost:8000 (Update the URL if your server is running on a different host/port)

Endpoints

1. Get Random Quote

Retrieve a random anime quote.

  • URL: /quotes/random
  • Method: GET
  • Response:
{
  "_id": "quote_id",
  "anime": "Anime Title",
  "character": "Character Name",
  "quote": "Quote text..."
}

2. Get Random Quote by Anime Title

Retrieve a random anime quote based on the provided anime title.

  • URL: /quotes/random/:animeTitle
  • Method: GET
  • Parameters:
    • animeTitle: The title of the anime.
  • Response:
{
  "_id": "quote_id",
  "anime": "Anime Title",
  "character": "Character Name",
  "quote": "Quote text..."
}

3. Get Random Quote by Anime Character

Retrieve a random anime quote based on the provided anime character.

  • URL: /quotes/random/character/:animeCharacter
  • Method: GET
  • Parameters:
    • animeCharacter: The name of the anime character.
  • Response:
{
  "_id": "quote_id",
  "anime": "Anime Title",
  "character": "Character Name",
  "quote": "Quote text..."
}

4. Get Five Random Quotes

Retrieve a list of five random anime quotes.

  • URL: /quotes/random/5
  • Method: GET
  • Response:
[
  {
    "_id": "quote_id_1",
    "anime": "Anime Title",
    "character": "Character Name",
    "quote": "Quote text..."
  },
  {
    "_id": "quote_id_2",
    "anime": "Anime Title",
    "character": "Character Name",
    "quote": "Quote text..."
  },
  // ...
]

5. Get Five Random Quotes by Anime Title

Retrieve a list of five random anime quotes based on the provided anime title.

  • URL: /quotes/random/5/:animeTitle
  • Method: GET
  • Parameters:
    • animeTitle: The title of the anime.
  • Response:
[
  {
    "_id": "quote_id_1",
    "anime": "Anime Title",
    "character": "Character Name",
    "quote": "Quote text..."
  },
  {
    "_id": "quote_id_2",
    "anime": "Anime Title",
    "character": "Character Name",
    "quote": "Quote text..."
  },
  // ...
]

6. Get Five Quotes by Anime Character

Retrieve a list of five anime quotes based on the provided anime character.

  • URL: /quotes/character/:animeCharacter
  • Method: GET
  • Parameters:
    • animeCharacter: The name of the anime character.
  • Response:
[
  {
    "_id": "quote_id_1",
    "anime": "Anime Title",
    "character": "Character Name",
    "quote": "Quote text..."
  },
  {
    "_id": "quote_id_2",
    "anime": "Anime Title",
    "character": "Character Name",
    "quote": "Quote text..."
  },
  // ...
]

7. Create a New Quote

Create a new anime quote.

  • URL: /quotes
  • Method: POST
  • Request Body:
{
  "anime": "Anime Title",
  "character": "Character Name",
  "quote": "Quote text..."
}
  • Response (on successful creation):
{
  "_id": "new_quote_id",
  "anime": "Anime Title",
  "character": "Character Name",
  "quote": "Quote text..."
}

8. Get Quotes with Pagination

Retrieve a paginated list of anime quotes.

  • URL: /quotes
  • Method: GET
  • Query Parameters:
    • page: Page number (default: 1)
    • limit: Number of quotes per page (default: 10)
  • Response:
{
  "docs": [
    {
      "_id": "quote_id_1",
      "anime": "Anime Title",
      "character": "Character Name",
      "quote": "Quote text..."
    },
    {
      "_id": "quote_id_2",
      "anime": "Anime Title",
      "character": "Character Name",
      "quote": "Quote text..."
    },
    // ...
  ],
  "totalPages": 3,
  "currentPage": 1
  // ...
}

Error Responses

  • Status Code: 404 Not Found
    • Response:
{
  "message": "Quote not found"
}
  • Status Code: 500 Internal Server Error
    • Response:
{
  "error": "Error message..."
}

Note: Replace localhost:8000 with the appropriate base URL if your server is running on a different host or port. Make sure you have MongoDB properly configured and running.

That concludes the updated documentation for the Anime Quote API. Feel free to use these endpoints to fetch and create quotes from various anime series and characters. If you encounter any issues or have questions, please refer to the provided code or seek further assistance.

kitagawachan-api's People

Contributors

rakarmp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.