> For the complete documentation index, see [llms.txt](https://quotifyhub.gitbook.io/quotify-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://quotifyhub.gitbook.io/quotify-hub/quotify-hub-api-documentation.md).

# Quotify Hub API Documentation

## 🌍 Base URL

```
https://quotifyhub.vercel.app/api/
```

## 📌 Endpoints

| Endpoint                      | Method | Description                                      |
| ----------------------------- | ------ | ------------------------------------------------ |
| `/random`                     | GET    | Returns a random quote                           |
| `/random?category=motivation` | GET    | Returns a random quote from a specific category  |
| `/random?limit=10`            | GET    | Returns multiple random quotes (limit specified) |
| `/quotes`                     | GET    | Returns all available quotes                     |
| `/quotes?category=motivation` | GET    | Fetch quotes from a specific category            |
| `/quotes?limit=10`            | GET    | Fetch a limited number of quotes                 |
| `/quotes/id/:id`              | GET    | Fetch a quote by its ID                          |

## 🏷️ Available Categories

Here are the categories you can use when filtering quotes:

* Action
* Age
* Alone
* Amazing
* Anger
* Anniversary
* Architecture
* Art
* Attitude
* Beauty
* Best
* Birthday
* Business
* Car
* Change
* Christmas
* Communication
* Computers
* Cool
* Courage
* Dad
* Dating
* Death
* Design
* Diet
* Dreams
* Easter
* Education
* Environmental
* Equality
* Experience
* Failure
* Faith
* Family
* Famous
* Fathersday
* Fear
* Finance
* Fitness
* Food
* Forgiveness
* Freedom
* Friendship
* Funny
* Future
* Gardening
* God
* Good
* Government
* Graduation
* Great
* Happiness
* Health
* History
* Home
* Hope
* Humor
* Imagination
* Innovation
* Inspirational
* Intelligence
* Jealousy
* Knowledge
* Leadership
* Learning
* Legal
* Life
* Love
* Marriage
* Medical
* Memorialday
* Men
* Mom
* Money
* Morning
* Mothersday
* Motivation
* Motivational
* Movies
* Movingon
* Music
* Nature
* Newyears
* Parenting
* Patience
* Patriotism
* Peace
* Pet
* Poetry
* Politics
* Positive
* Positivity
* Possibility
* Power
* Relationship
* Religion
* Respect
* Risk
* Romantic
* Sad
* Saintpatricksday
* Science
* Self
* Smile
* Society
* Sports
* Strength
* Success
* Sympathy
* Teacher
* Technology
* Teen
* Thankful
* Thanksgiving
* Time
* Travel
* Trust
* Truth
* Valentinesday
* War
* Wedding
* Wisdom
* Women
* Work

## 🚀 Example Responses

### 📜 Random Quote (`/api/random`)

```json
{
  "id": 19,
  "quote": "The secret of success is to do the common thing uncommonly well.",
  "author": "John D. Rockefeller Jr.",
  "category": "Success"
}
```

### 🎯 Random Quote by Category (`/api/random?category=motivation`)

```json
{
  "id": 14,
  "quote": "You miss 100% of the shots you don’t take.",
  "author": "Wayne Gretzky",
  "category": "Motivation"
}
```

### 🔢 Multiple Random Quotes (`/api/random?limit=2`)

```json
[
  {
    "id": 35,
    "quote": "A diplomat is a man who always remembers a woman's birthday but never remembers her age.",
    "author": "Robert Frost",
    "category": "Age"
  },
  {
    "id": 9,
    "quote": "The only way to do great work is to love what you do.",
    "author": "Steve Jobs",
    "category": "Work"
  }
]
```

### 🔍 Quote by ID (`/api/quotes/id/1`)

```json
{
  "id": 1,
  "quote": "The only limit to our realization of tomorrow is our doubts of today.",
  "author": "Franklin D. Roosevelt",
  "category": "Motivation"
}
```

### 📂 Quotes by Category (`/api/quotes?category=motivation`)

```json
[
  {
    "id": 1,
    "quote": "The only limit to our realization of tomorrow is our doubts of today.",
    "author": "Franklin D. Roosevelt",
    "category": "Motivation"
  }
]
```

### 🔢 Limited Quotes (`/api/quotes?limit=10`)

```json
[
  {
    "id": 1,
    "quote": "The only limit to our realization of tomorrow is our doubts of today.",
    "author": "Franklin D. Roosevelt",
    "category": "Motivation"
  },
  {
    "id": 2,
    "quote": "The best way to predict the future is to invent it.",
    "author": "Alan Kay",
    "category": "Innovation"
  }
]
```

## 📊 Rate Limiting

To prevent API abuse, rate limits are applied:

* **200 requests per 10 minutes** per IP.
* If you exceed the limit, you'll receive this response:

```json
{
  "message": "Too many requests from this IP, please try again after 10 minutes"
}
```

## 📜 Usage Examples

### Fetching a Random Quote (JavaScript Example)

```js
fetch('https://quotifyhub.vercel.app/api/random')
    .then(response => response.json())
    .then(data => {
        console.log(data.quote);
        console.log("- " + data.author);
    });
```

### Fetching All Quotes

```js
fetch('https://quotifyhub.vercel.app/api/quotes')
    .then(response => response.json())
    .then(data => {
        data.forEach(quote => {
            console.log(quote.quote);
            console.log("- " + quote.author);
        });
    });
```

### Fetching a Quote by ID

```js
const quoteId = 1; // Example ID
fetch(`https://quotifyhub.vercel.app/api/quotes/id/${quoteId}`)
    .then(response => response.json())
    .then(data => {
        console.log(data.quote);
        console.log("- " + data.author);
    });
```

## 🏆 Credits & Inspiration

This project was **forked and inspired by** [Quotes-API](https://github.com/theriturajps/Quotes-API). The original author of this repository is [**Ritu Raj Pratap Singh**](https://github.com/theriturajps).

## 📜 License

This API is open-source and licensed under the **MIT License**.

## 🤝 Contributing

If you’d like to contribute:

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Make your changes and commit (`git commit -m "Added a new feature"`).
4. Push your changes (`git push origin feature-branch`).
5. Open a **Pull Request**.

## 📬 Contact

* GitHub: [Quotify Hub](https://github.com/itz-rj-here/Quotify-Hub)
* For issues or support, open an **Issue** on the GitHub repository.

***

Happy coding! 🚀
