npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

quotifyapi

v1.4.2

Published

A beautiful, fast, and reliable quote API with comprehensive documentation

Readme

💬 Quotify API

npm version License: MIT Node.js Version

A beautiful, fast, and reliable quote API that provides inspirational quotes across multiple categories. Built with Express.js and designed for performance, it's perfect for developers building applications that need motivational content.

⚠️ Important Copyright Notice

Quotify API does not own, create, or claim ownership of any quotes provided through this service. All quotes are the intellectual property of their respective authors, creators, and copyright holders. This API serves as a collection and distribution platform only.

Please respect the original authors' rights and ensure proper attribution when using these quotes in your applications.

✨ Features

  • 🚀 Fast & Reliable - Built with Express.js and optimized for performance
  • 🛡️ Secure - Rate limiting, security headers, and abuse protection
  • 📚 Rich Content - Multiple categories: happy, sad, love, motivational, wisdom
  • 🌐 Easy Integration - Simple REST API with comprehensive documentation
  • 📱 Responsive Design - Beautiful documentation website included
  • 🎯 CLI Tool - Command-line interface for quick access
  • 📊 Statistics - Detailed quote counts and category information

🚀 Quick Start

Install as NPM Package

npm install quotifyapi

Use in Your Code

The SDK supports both Offline Mode (using bundled local quotes) and Online Mode (querying the live Quote API server).

Offline Mode (No API key required)

const { getRandomQuote, getRandomQuoteByType } = require('quotifyapi');

// Get a random quote from any category
const randomQuote = getRandomQuote();
console.log(randomQuote.text); // "Life is what happens when you're busy making other plans."
console.log(randomQuote.author); // "John Lennon"

// Get a motivational quote
const motivationalQuote = getRandomQuoteByType('motivational');
console.log(motivationalQuote.text); // "The only way to do great work is to love what you do."

Online Mode (Requires API key)

const { ApiClient } = require('quotifyapi');

// Initialize the API client
const client = new ApiClient('your_api_key_here');

async function getOnlineQuotes() {
  try {
    // Get a random quote
    const quote = await client.getRandomQuote();
    console.log(`${quote.text} — ${quote.author}`);

    // Get a quote by category
    const wisdomQuote = await client.getRandomQuoteByType('wisdom');
    console.log(`${wisdomQuote.text} — ${wisdomQuote.author}`);
  } catch (error) {
    console.error('Error fetching quotes:', error.message);
  }
}

getOnlineQuotes();

CLI Usage

# Get a random quote
npx quotifyapi random

# Get a specific category
npx quotifyapi type motivational
npx quotifyapi type love

# Show available categories
npx quotifyapi types

# Show statistics
npx quotifyapi stats

# Get help
npx quotifyapi help

Note: The CLI requires authentication. If the QUOTIFY_API_KEY environment variable is not configured, the CLI will interactively prompt you to input your API key when running commands in a terminal.

🚀 GitHub Actions & CI/CD

This project uses GitHub Actions for automated testing, quality checks, and deployment. The following workflows are configured:

🔄 Automated Workflows

  • Test & Quality Check - Runs on every push and pull request
  • Deploy to Vercel - Automatically deploys to staging, manual approval for production
  • Release Management - Creates GitHub releases and publishes to npm on version tags
  • Dependabot - Automatically checks for dependency updates weekly

📋 Required GitHub Secrets

To enable automatic deployment, add these secrets to your repository:

| Secret Name | Description | How to Get | |-------------|-------------|------------| | VERCEL_TOKEN | Vercel deployment token | Vercel Account Settings | | ORG_ID | Vercel team/organization ID | Vercel Dashboard → Settings → General | | PROJECT_ID | Vercel project ID | Vercel Project Dashboard → Settings → General | | NPM_TOKEN | NPM publish token (optional) | NPM Account Settings |

🏗️ Workflow Details

  • Matrix Testing: Tests against Node.js 16.x, 18.x, and 20.x
  • Security Audits: Runs npm audit to check for vulnerabilities
  • Quality Gates: All tests must pass before deployment
  • Automatic Releases: Push a tag like v1.2.1 to trigger a release

For detailed setup instructions, see DEPLOYMENT.md.

🌐 API Endpoints

Base URL

https://quotify.dazzelr.tech

Get Random Quote

GET /api

Response:

{
  "quote": {
    "text": "Life is what happens when you're busy making other plans.",
    "author": "John Lennon"
  },
  "type": "random",
  "timestamp": "2025-01-15T10:30:00.000Z"
}

Get Quote by Category

GET /api?type=motivational

Available Categories:

  • happy - Uplifting and joyful quotes
  • sad - Thoughtful and reflective quotes
  • love - Romantic and affectionate quotes
  • motivational - Inspirational and encouraging quotes
  • wisdom - Philosophical and insightful quotes

Get Available Categories

GET /api/types

Response:

{
  "availableTypes": ["happy", "sad", "love", "motivational", "wisdom"],
  "total": 5
}

Get Statistics

GET /api/stats

Response:

{
  "message": "Quote statistics by category",
  "counts": {
    "happy": 25,
    "sad": 20,
    "love": 30,
    "motivational": 35,
    "wisdom": 15,
    "total": 125
  }
}

🛡️ Security

Quotify API includes multiple layers of security protections:

XSS Protection

All dynamic content rendered in the documentation site and admin dashboard is sanitized through a global escapeHTML function. This prevents cross-site scripting attacks from malicious data in API responses, user names, or error messages.

Standardized Error Responses

All API endpoints return a consistent error format, making it easy to handle errors programmatically:

{
  "success": false,
  "error": "Validation error",
  "message": "All fields are required"
}

In production mode, internal server errors (500) are masked to prevent information leakage:

{
  "error": "Error",
  "message": "Something went wrong on the server"
}

In development mode, full error details including stack traces are returned for debugging.

Additional Protections

  • 🔒 Helmet - Security headers (CSP, HSTS, X-Frame-Options, etc.)
  • 🔑 JWT Authentication - Secure token-based API access
  • 🛡️ Rate Limiting - Protection against abuse and DDoS
  • 🔐 Payment Signature Verification - Razorpay HMAC validation
  • 🚫 Input Validation - All user inputs are validated before processing

🛡️ Rate Limits

To ensure fair usage and protect against abuse, the following rate limits are enforced:

  • General Requests: 1,000 requests per 15 minutes
  • API Endpoints: 500 requests per 15 minutes
  • Strict Limit: 50 requests per minute (additional protection)

Rate Limit Headers

The API includes rate limit information in response headers:

  • RateLimit-Limit - Maximum requests per window
  • RateLimit-Remaining - Remaining requests in current window
  • RateLimit-Reset - Time when the rate limit resets

🏗️ Installation & Setup

Option 1: Use as NPM Package (Recommended)

npm install quote-api

Option 2: Self-Hosted

# Clone the repository
git clone https://github.com/tanishq-sa/Quotifyapi
cd quotifyapi

# Install dependencies
npm install

# Start the server
npm start

# For development with auto-reload
npm run dev

The API will be available at https://quotify.dazzelr.tech

📚 Documentation Website

A beautiful, interactive documentation website is included and automatically served at the root URL when you run the server. Features include:

  • 📖 Comprehensive API documentation
  • 🧪 Interactive API tester
  • 💻 Code examples in multiple languages
  • 📱 Responsive design
  • 🎨 Modern dark theme
  • ⌨️ Keyboard shortcuts

Visit https://quotify.dazzelr.tech to explore the documentation.

🔧 Configuration

Environment Variables

PORT=3000                    # Server port (default: 3000)
NODE_ENV=production         # Environment mode

Customization

You can easily add your own quotes by editing the files in the quotes/ directory:

// quotes/custom.js
module.exports = [
  {
    text: "Your custom quote here",
    author: "Your Name"
  }
  // ... more quotes
];

Then update quotes.js to include your new category.

🚀 Deployment

Vercel (Recommended)

The project includes vercel.json for easy deployment to Vercel:

npm install -g vercel
vercel

Other Platforms

The API works on any Node.js hosting platform:

  • Heroku
  • Railway
  • DigitalOcean App Platform
  • AWS Lambda (with serverless framework)

📦 Package Structure

quotifyapi/
├── server.js          # Express server with global error handler
├── quotes.js          # Quote management functions
├── auth.js            # Authentication & passport config
├── database-adapter.js # Database abstraction layer
├── cli.js             # Command-line interface
├── config/
│   └── plan-limits.js # Rate limit plans
├── routes/            # API route modules
│   ├── admin.js       # Admin management endpoints
│   ├── auth.js        # OAuth & login endpoints
│   ├── contact.js     # Contact form handler
│   ├── payments.js    # Razorpay payment routes
│   ├── quotes.js      # Quote API endpoints
│   └── user.js        # User profile endpoints
├── quotes/            # Quote data files
│   ├── happy.js
│   ├── sad.js
│   ├── love.js
│   ├── motivational.js
│   └── wisdom.js
├── public/            # Documentation website
│   ├── index.html
│   ├── admin.html     # Admin dashboard (XSS-safe)
│   └── script.js      # Frontend with escapeHTML protection
├── package.json
├── README.md
├── DEPLOYMENT.md
├── SECURE_ENV_GUIDE.md
├── RAZORPAY_SETUP.md
├── EMAIL_SETUP.md
└── vercel.json

🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Adding Quotes

To add new quotes:

  1. Add your quotes to the appropriate category file in quotes/
  2. Follow the existing format: { text: "Quote text", author: "Author name" }
  3. Submit a pull request

Adding Categories

To add new quote categories:

  1. Create a new file in quotes/ (e.g., quotes/philosophy.js)
  2. Update quotes.js to include your new category
  3. Submit a pull request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Express.js - Web framework
  • Inter Font - Beautiful typography
  • Prism.js - Syntax highlighting
  • Community - For inspiration and feedback

📞 Support

🌟 Star History

Star History Chart

Made with ❤️ by Tanishq Saini

If this project helps you, please give it a ⭐️!