Package Exports
- credit-card-db-api
- credit-card-db-api/api.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (credit-card-db-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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 cardscash-back- Cash back cardscollege-student- Student cardsno-annual-fee- Cards with no annual feebalance-transfer- Balance transfer cardshotel- Hotel rewards cardsrewards- General rewards cardsbonus-offers- Cards with sign-up bonusesgood-credit- Cards for good creditbad-credit- Cards for rebuilding creditno-credit- Cards for those with no credit historygas- Gas rewards cardsgroceries- Grocery rewards cardsrestaurants- 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 storesautomotive- Gas stations & automotivetravel- Travel purchasesshopping- Online/retail shoppingdining- Restaurants & diningstreaming- Streaming serviceshome_improvement- Home improvement storesunlimited- 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.