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 🙏

© 2025 – Pkg Stats / Ryan Hefner

credit-card-db-api

v1.0.0

Published

A simple, chainable JavaScript API for querying and filtering credit card data with 54+ cards including rewards, fees, APRs, and benefits

Readme

Credit Card Database API

A simple, chainable JavaScript API for querying and filtering credit card data. Contains 54+ carefully curated credit cards with detailed information including rewards, fees, APRs, benefits, and eligibility requirements.

📊 Database Overview

  • Total Cards: 54 unique credit cards
  • Issuers: Chase, Capital One, American Express, Citi, Discover, Wells Fargo, and more
  • Networks: Visa, Mastercard, American Express, Discover
  • Categories: Travel, Cash-back, Student, No Annual Fee, Balance Transfer, Hotel, Rewards, and more

🚀 Installation

npm install credit-card-db-api

📖 Usage

Basic Usage

const CreditCardAPI = require("credit-card-db-api");

// Get all cards
const api = new CreditCardAPI();
const allCards = api.getAll();
console.log(`Total cards: ${allCards.length}`);

Filtering (Chainable)

The API supports chainable filters, meaning you can combine multiple filters for precise queries:

// Find travel cards with no annual fee and 2%+ travel rewards
const travelCards = new CreditCardAPI()
    .filterByCategory("travel")
    .filterByAnnualFee(0, 0)
    .filterByCashback("travel", 2)
    .get();

🔍 Available Filters

Filter by Issuer

Case-insensitive search by bank/issuer name.

const chaseCards = new CreditCardAPI().filterByIssuer("Chase").get();
// Works with: 'chase', 'Chase', 'CHASE', etc.

Filter by Category

Search by credit card category (cash-back, travel, student, etc.)

const cashBackCards = new CreditCardAPI().filterByCategory("cash-back").get();

Available Categories:

  • travel - Travel rewards cards
  • cash-back - Cash back cards
  • college-student - Student cards
  • no-annual-fee - Cards with no annual fee
  • balance-transfer - Balance transfer cards
  • hotel - Hotel rewards cards
  • rewards - General rewards cards
  • bonus-offers - Cards with sign-up bonuses
  • good-credit - Cards for good credit
  • bad-credit - Cards for rebuilding credit
  • no-credit - Cards for those with no credit history
  • gas - Gas rewards cards
  • groceries - Grocery rewards cards
  • restaurants - Dining rewards cards

Filter by Network

Case-insensitive search by card network.

const visaCards = new CreditCardAPI().filterByNetwork("visa").get();

Available Networks: Visa, Mastercard, American Express, Discover

Filter by Type

Case-insensitive search by card type.

const studentCards = new CreditCardAPI().filterByType("Student").get();

Available Types: Consumer, Business, Student

Filter by Annual Fee

Filter by annual fee range (in dollars).

// Cards with $0 annual fee
const noFeeCards = new CreditCardAPI().filterByAnnualFee(0, 0).get();

// Cards with annual fee between $50 and $100
const midFeeCards = new CreditCardAPI().filterByAnnualFee(50, 100).get();

Filter by APR

Filter by APR (Annual Percentage Rate) range.

// Cards with APR under 20%
const lowAPRCards = new CreditCardAPI().filterByAPR(0, 20).get();

Filter by Bonus Offer

Filter by sign-up bonus (dollars, points, or miles).

// Cards with $200+ cash bonus
const bonusCards = new CreditCardAPI().filterByBonus({ dollars: 200 }).get();

// Cards with 50,000+ points
const pointsCards = new CreditCardAPI().filterByBonus({ points: 50000 }).get();

// Cards with 60,000+ miles
const milesCards = new CreditCardAPI().filterByBonus({ miles: 60000 }).get();

Filter by Cashback Rate

Filter by minimum cashback rate for specific categories.

// Cards with at least 3% dining cashback
const diningCards = new CreditCardAPI().filterByCashback("dining", 3).get();

// Cards with at least 5% travel cashback
const travelCards = new CreditCardAPI().filterByCashback("travel", 5).get();

Available Cashback Categories:

  • grocery - Grocery stores
  • automotive - Gas stations & automotive
  • travel - Travel purchases
  • shopping - Online/retail shopping
  • dining - Restaurants & dining
  • streaming - Streaming services
  • home_improvement - Home improvement stores
  • unlimited - Unlimited/everything else

Filter by Credit Score

Filter by required credit score range.

// Cards for credit scores 670-750
const goodCreditCards = new CreditCardAPI().filterByCreditScore(670, 750).get();

Filter by Name

Case-insensitive search in card name.

const sapphireCards = new CreditCardAPI().filterByName("sapphire").get();

Filter by Keyword

Case-insensitive search across name, benefits, and category.

// Find all cards with "protection" in benefits
const protectionCards = new CreditCardAPI().filterByKeyword("protection").get();

Custom Filter

Apply your own custom filter function.

// Find cards with both high dining AND grocery cashback
const diningGroceryCards = new CreditCardAPI()
    .filter((card) => {
        const dining = parseFloat(card.cashback?.dining || "0%");
        const grocery = parseFloat(card.cashback?.grocery || "0%");
        return dining >= 3 && grocery >= 3;
    })
    .get();

🔗 Chaining Examples

Example 1: Best Travel Cards

Find travel cards with no annual fee and good rewards:

const bestTravelCards = new CreditCardAPI()
    .filterByCategory("travel")
    .filterByAnnualFee(0, 0)
    .filterByCashback("travel", 2)
    .get();

Example 2: Student Cards with Rewards

Find student cards with dining or grocery rewards:

const studentRewardsCards = new CreditCardAPI()
    .filterByType("Student")
    .filter((card) => {
        const dining = parseFloat(card.cashback?.dining || "0%") || 0;
        const grocery = parseFloat(card.cashback?.grocery || "0%") || 0;
        return dining >= 2 || grocery >= 2;
    })
    .get();

Example 3: High Bonus, Low Fee

Find cards with $200+ bonus and no annual fee:

const highBonusNoFee = new CreditCardAPI()
    .filterByBonus({ dollars: 200 })
    .filterByAnnualFee(0, 0)
    .get();

Example 4: Chase Cash Back Cards

Find all Chase cash-back cards:

const chaseCashBack = new CreditCardAPI()
    .filterByIssuer("Chase")
    .filterByCategory("cash-back")
    .get();

📋 Card Data Structure

Each card object contains:

{
  "category": "travel",
  "issuer": "CHASE",
  "network": "Visa",
  "name": "Chase Sapphire Preferred® Card",
  "type": "Consumer",
  "image_url": "https://...",
  "intro_annual_fee": "",
  "intro_annual_fee_period_years": 0,
  "annual_fee": "$95",
  "intro_apr_rate": "0%",
  "intro_apr_period_months": 15,
  "apr_rate": "20.49% - 27.49% variable",
  "balance_transfer_fee": "$5",
  "balance_transfer_percent": "5%",
  "bonus_offer": {
    "dollars": 0,
    "points": 60000,
    "miles": 0
  },
  "min_spend_for_bonus": 4000,
  "spend_bonus_deadline_months": 3,
  "cashback": {
    "grocery": "3%",
    "automotive": "",
    "travel": "5%",
    "shopping": "2%",
    "dining": "3%",
    "streaming": "",
    "home_improvement": "",
    "unlimited": "1%",
    "other": {
      "category": "",
      "rate": ""
    }
  },
  "benefits": "Purchase protection, trip cancellation insurance, lost luggage reimbursement",
  "eligibility_requirements": {
    "income": "",
    "credit_score": "Good 670-739",
    "employment_status": "",
    "citizenship": "Citizen"
  },
  "application_url": "https://..."
}

📊 Statistics

const api = new CreditCardAPI();
const allCards = api.getAll();

console.log(`Total Cards: ${allCards.length}`);

// Count by issuer
const byIssuer = {};
allCards.forEach((card) => {
    byIssuer[card.issuer] = (byIssuer[card.issuer] || 0) + 1;
});
console.log("Cards by Issuer:", byIssuer);

// Count by category
const byCategory = {};
allCards.forEach((card) => {
    byCategory[card.category] = (byCategory[card.category] || 0) + 1;
});
console.log("Cards by Category:", byCategory);

🛠️ API Reference

Constructor

new CreditCardAPI((cards = cardsData));

Initialize the API with optional custom card data.

Methods

| Method | Parameters | Returns | Description | | ------------------------------------- | -------------- | ------- | -------------------------------------- | | getAll() | None | Array | Returns all cards | | get() | None | Array | Executes filters and returns results | | filter(fn) | Function | this | Custom filter function | | filterByName(name) | String | this | Filter by card name | | filterByIssuer(issuer) | String | this | Filter by issuer (case-insensitive) | | filterByCategory(category) | String | this | Filter by category | | filterByNetwork(network) | String | this | Filter by network (case-insensitive) | | filterByType(type) | String | this | Filter by type (case-insensitive) | | filterByAnnualFee(min, max) | Number, Number | this | Filter by annual fee range | | filterByAPR(min, max) | Number, Number | this | Filter by APR range | | filterByBonus(options) | Object | this | Filter by bonus (dollars/points/miles) | | filterByCashback(category, minRate) | String, Number | this | Filter by cashback rate | | filterByCreditScore(min, max) | Number, Number | this | Filter by credit score range | | filterByKeyword(keyword) | String | this | Search across multiple fields |

📝 Notes

  • All text-based filters (filterByIssuer, filterByNetwork, filterByType) are case-insensitive
  • Filters are chainable - call multiple filters before calling .get()
  • Calling .get() executes all filters and resets the filter chain
  • The database contains deduplicated data with priority given to cards with complete issuer information

📄 License

ISC

🤝 Contributing

This is a curated database of credit card information. The data is sourced from publicly available information and standardized for easy querying.

⚠️ Disclaimer

Credit card terms, rates, and offers are subject to change. Always verify current information with the card issuer before applying. This database is for informational purposes only and does not constitute financial advice.