# CardWise Intelligence (`fundamental_quillwort_ooj/cardwise-intelligence`) Actor

Monitor Indian credit card terms with issuer evidence, historical changes, and published-criteria screening.

- **URL**: https://apify.com/fundamental_quillwort_ooj/cardwise-intelligence.md
- **Developed by:** [ansar hussain](https://apify.com/fundamental_quillwort_ooj) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## 💳 CardWise Intelligence

#### Credit-card data infrastructure for fintechs, powered by Apify

**Collect. Verify. Monitor. Match.** CardWise Intelligence turns fragmented Indian credit-card terms into structured, source-backed datasets that fintech products can integrate into catalogs, comparison engines, analyst workflows, and recommendation systems.

> **B2B product:** Built for fintech data teams, credit-card advisory platforms, and developers, not as a consumer credit-card application.

[Quick start](#quick-start) · [Interactive demo walkthrough](#two-minute-demo-walkthrough) · [Four modes](#four-actor-modes--example-json) · [Integration](#api-integration) · [Technical documentation](#technical-reference)

### Why CardWise?

Credit-card benefits change. Reward caps shrink, lounge-access rules tighten, fees increase, and eligibility conditions vary across issuers. Maintaining an accurate catalog by hand is difficult.

CardWise provides four connected capabilities:

| Capability | What it delivers | Typical consumer |
|---|---|---|
| 🗂️ **Card database** | Normalized fees, eligibility, rewards and official-source references | Product catalog or comparison site |
| 🔔 **Devaluation watch** | Field-level differences between verified snapshots | Monitoring and alerting team |
| 🎯 **Eligibility matching** | Published-criteria screening and explainable ranking | Recommendation engine |
| 🔄 **Full refresh** | Collection, change detection and optional profile scoring in one run | Data pipeline or scheduled job |

#### How the pipeline works

```mermaid
flowchart LR
    A[Official issuer pages and documents] --> B[Fetch and normalize]
    B --> C[Current card records]
    C --> D[Snapshot comparison]
    D --> E[Change records]
    C --> F[Published-criteria screening]
    F --> G[Match results]
    C --> H[Apify Dataset / API]
    E --> H
    G --> H
```

### Quick start

Requires **Node.js 22.12+**, network access to npm and issuer sites, and the [Apify CLI](https://docs.apify.com/cli/docs/quick-start).

```bash
npm ci
npm test
npm run check
npm run demo
apify run --input-file examples/card_database.json
```

The local Dataset is written under `storage/datasets/default`. The named snapshot and history stores persist under `storage/key_value_stores` and `storage/datasets` when the same storage directory is reused.

### Four Actor modes & example JSON

The Actor uses a `record_type` discriminator so downstream systems can handle card specifications, change events, and matching results separately.

| Mode | Main output | Does it crawl? |
|---|---|---|
| `full_refresh` | `card`, `change`, `match_result`, run summary | Yes |
| `card_database` | `card`, run summary | Yes |
| `devaluation_watch` | `change`, change/run summary | Yes |
| `eligibility_matching` | `match_result`, run summary | No, uses saved snapshots |

**Important input-schema note:** The examples immediately below use the *presentation contract* from the supplied demo. In the current implementation, the storage keys are `snapshot_store` and `history_dataset` (rather than `snapshot_store` and `history_dataset_name`). Custom card sources also use the `sources` array described in the technical reference, not direct `product_url` / `mitc_url` fields. Adapt these before running against the current Actor.

#### 1. 🔄 Full refresh

**Use case:** Update the catalog, compare previous snapshots, identify material changes, and optionally rank cards for a sample spending profile.

<details open>
<summary><strong>Example input JSON</strong></summary>

```json
{
  "mode": "full_refresh",
  "country": "IN",
  "max_cards": 15,
  "include_sources": true,
  "detect_changes": true,
  "calculate_scores": true,
  "snapshot_store_name": "cardwise-snapshots-in",
  "history_dataset_name": "cardwise-change-history-in",
  "cards": [],
  "profile": {
    "monthly_income_inr": 100000,
    "preferred_benefits": ["cashback", "travel", "lounge_access"],
    "annual_fee_preference": "ltf_preferred",
    "monthly_spend": {
      "dining": 5000, "travel": 10000, "online": 8000,
      "groceries": 5000, "fuel": 3000, "utilities": 2000, "other": 5000
    }
  }
}
```

</details>

<details open>
<summary><strong>Example output Dataset JSON</strong></summary>

```json
[
  {
    "record_type": "card",
    "card_id": "hdfc_millennia_credit_card",
    "issuer": "HDFC Bank",
    "name": "Millennia Credit Card",
    "fees": {"joining_fee_inr": 1000, "annual_fee_inr": 1000, "waiver_spend_threshold_inr": 100000},
    "eligibility": {"minimum_monthly_income_inr": 35000, "employment_types": ["salaried", "self_employed"]},
    "rewards_summary": {"cashback_rate_online_merchants": 0.05, "cashback_rate_other_spend": 0.01, "monthly_reward_cap_inr": 1000},
    "last_updated": "2025-02-15T08:30:00Z"
  },
  {
    "record_type": "change",
    "change_id": "chg_axis_ace_2025_001",
    "card_id": "axis_bank_ace_credit_card",
    "issuer": "Axis Bank",
    "detected_at": "2025-02-15T08:30:00Z",
    "field_path": "rewards_summary.monthly_reward_cap_inr",
    "old_value": 1000, "new_value": 500,
    "change_type": "devaluation", "severity": "high",
    "manual_review_required": false
  },
  {
    "record_type": "match_result",
    "card_id": "icici_amazon_pay_credit_card",
    "issuer": "ICICI Bank",
    "name": "Amazon Pay ICICI Credit Card",
    "eligibility_status": "eligible",
    "eligibility_reason": "Monthly income INR 100,000 meets or exceeds published threshold of INR 25,000.",
    "net_annual_value_inr": 7920,
    "stability_risk": "low", "stability_risk_score": 18,
    "overall_score": 86, "recommendation_rank": 1
  }
]
```

</details>

**Demo takeaway:** A single run can feed a product catalog, a terms-change queue, and a recommendation engine.

#### 2. 🗂️ Card database

**Use case:** Collect canonical card specifications with provenance from issuer product pages and official terms.

<details open>
<summary><strong>Example input JSON</strong></summary>

```json
{
  "mode": "card_database", "country": "IN", "max_cards": 15,
  "include_sources": true,
  "cards": [
    {
      "card_id": "hdfc_millennia_credit_card",
      "product_url": "https://www.hdfcbank.com/personal/pay/cards/credit-cards/millennia-credit-card",
      "mitc_url": "https://www.hdfcbank.com/content/api/contentstream-id/72379801-2f15-4610-a96d-96e00f576304/16e917d0-7988-4903-8868-6b8969e06e00"
    },
    {
      "card_id": "sbi_cashback_credit_card",
      "product_url": "https://www.sbicard.com/en/personal/credit-cards/rewards/cashback-sbi-card.page",
      "mitc_url": "https://www.sbicard.com/sbi-card-en/assets/docs/pdf/mitc.pdf"
    }
  ]
}
```

</details>

<details open>
<summary><strong>Example output Dataset JSON</strong></summary>

```json
[
  {
    "record_type": "card",
    "card_id": "hdfc_millennia_credit_card", "issuer": "HDFC Bank", "name": "Millennia Credit Card",
    "fees": {"joining_fee_inr": 1000, "annual_fee_inr": 1000, "waiver_spend_threshold_inr": 100000},
    "eligibility": {"minimum_monthly_income_inr": 35000, "criteria_status": "verified"},
    "source_fields": {
      "minimum_monthly_income_inr": "https://www.hdfcbank.com/personal/pay/cards/credit-cards/millennia-credit-card#eligibility",
      "annual_fee_inr": "https://www.hdfcbank.com/content/api/contentstream-id/72379801-2f15-4610-a96d-96e00f576304/16e917d0-7988-4903-8868-6b8969e06e00"
    }
  },
  {
    "record_type": "card",
    "card_id": "sbi_cashback_credit_card", "issuer": "SBI Card", "name": "CASHBACK SBI Card",
    "fees": {"joining_fee_inr": 999, "annual_fee_inr": 999, "waiver_spend_threshold_inr": 200000},
    "eligibility": {"minimum_monthly_income_inr": null, "criteria_status": "unknown"},
    "source_fields": {
      "annual_fee_inr": "https://www.sbicard.com/en/personal/credit-cards/rewards/cashback-sbi-card.page"
    }
  }
]
```

</details>

**Demo takeaway:** Missing salary thresholds remain `null` and `unknown`; the pipeline must not invent them. The URLs shown are sample provenance links, not proof of current verification.

#### 3. 🔔 Devaluation watch

**Use case:** Compare normalized terms with saved snapshots and surface meaningful changes rather than cosmetic website edits.

<details open>
<summary><strong>Example input JSON</strong></summary>

```json
{
  "mode": "devaluation_watch", "country": "IN",
  "detect_changes": true,
  "snapshot_store_name": "cardwise-snapshots-in",
  "history_dataset_name": "cardwise-change-history-in",
  "cards": []
}
```

</details>

<details open>
<summary><strong>Example output Dataset JSON — simulated change fixtures</strong></summary>

```json
[
  {
    "record_type": "change", "change_id": "chg_axis_ace_2025_001",
    "card_id": "axis_bank_ace_credit_card", "issuer": "Axis Bank",
    "detected_at": "2025-02-15T09:00:00Z",
    "field_path": "rewards_summary.monthly_reward_cap_inr",
    "old_value": 1000, "new_value": 500,
    "change_type": "devaluation", "severity": "high",
    "manual_review_required": false
  },
  {
    "record_type": "change", "change_id": "chg_hdfc_regalia_2025_004",
    "card_id": "hdfc_regalia_gold_credit_card", "issuer": "HDFC Bank",
    "detected_at": "2025-02-15T09:00:00Z",
    "field_path": "lounge_access.domestic_spend_threshold_per_quarter_inr",
    "old_value": 0, "new_value": 50000,
    "change_type": "devaluation", "severity": "high",
    "manual_review_required": true
  },
  {
    "record_type": "change_summary", "run_timestamp": "2025-02-15T09:00:15Z",
    "cards_checked": 42, "changes_detected": 2,
    "high_severity_count": 2, "failed_sources": 0
  }
]
```

</details>

**Demo takeaway:** A cap reduction or newly introduced lounge-access spend requirement can be expressed as a machine-readable field delta. **These specific events are simulated, not verified issuer announcements.**

#### 4. 🎯 Eligibility matching

**Use case:** Screen a generalized profile against *published* criteria and rank matches with explainable annual-value estimates.

<details open>
<summary><strong>Example input JSON</strong></summary>

```json
{
  "mode": "eligibility_matching", "country": "IN",
  "calculate_scores": true,
  "snapshot_store_name": "cardwise-snapshots-in",
  "profile": {
    "monthly_income_inr": 40000,
    "annual_fee_preference": "ltf_preferred",
    "preferred_benefits": ["cashback", "low_fees"],
    "monthly_spend": {
      "dining": 3000, "travel": 2000, "online": 10000,
      "groceries": 4000, "fuel": 2000, "utilities": 1500, "other": 2500
    }
  }
}
```

</details>

<details open>
<summary><strong>Example output Dataset JSON</strong></summary>

```json
[
  {
    "record_type": "match_result", "card_id": "icici_amazon_pay_credit_card",
    "issuer": "ICICI Bank", "name": "Amazon Pay ICICI Credit Card",
    "eligibility_status": "eligible",
    "eligibility_reason": "Monthly income INR 40,000 meets or exceeds published threshold of INR 25,000.",
    "net_annual_value_inr": 6240, "stability_risk": "low",
    "stability_risk_score": 12, "overall_score": 85, "recommendation_rank": 1
  },
  {
    "record_type": "match_result", "card_id": "sbi_cashback_credit_card",
    "issuer": "SBI Card", "name": "CASHBACK SBI Card",
    "eligibility_status": "unknown",
    "eligibility_reason": "Minimum monthly income is not publicly specified by the issuer.",
    "net_annual_value_inr": 5001, "stability_risk": "moderate",
    "stability_risk_score": 35, "overall_score": 74, "recommendation_rank": 2
  },
  {
    "record_type": "match_result", "card_id": "hdfc_regalia_gold_credit_card",
    "issuer": "HDFC Bank", "name": "Regalia Gold Credit Card",
    "eligibility_status": "criteria_not_met",
    "eligibility_reason": "Monthly income INR 40,000 is below published threshold of INR 150,000.",
    "net_annual_value_inr": 0, "stability_risk": "low",
    "stability_risk_score": 20, "overall_score": 0, "recommendation_rank": null
  }
]
```

</details>

**Demo takeaway:** Known published-criteria failures are excluded from recommendations. Unknown thresholds are not silently treated as eligible. The example `eligible` status is only a simplified demo label, **not a bank approval prediction**.

### Two-minute demo walkthrough

1. **0:00–0:20 — Problem:** Credit-card terms are fragmented across bank pages and PDFs; a stale reward cap can mislead a downstream product.
2. **0:20–0:45 — Card database:** Show a normalized `card` record, fee and eligibility fields, and its `source_fields` provenance.
3. **0:45–1:10 — Devaluation intelligence:** Show the **simulated** cashback cap change from ₹1,000 to ₹500 and the field-level `change` record. Explain that live alerts require a verified previous snapshot and current source evidence.
4. **1:10–1:35 — Eligibility matching:** Show a synthetic ₹40,000/month profile, ranked results, and an explicitly unknown eligibility criterion.
5. **1:35–2:00 — B2B integration:** Show `record_type` routing and the Apify Dataset API. Explain how a fintech can update its catalog and queue changes for review.

### Data contract and governance

| Record type | Modes | Primary key / discriminator | Purpose |
|---|---|---|---|
| `card` | `full_refresh`, `card_database` | `card_id` | Canonical card data and provenance |
| `change` | `full_refresh`, `devaluation_watch` | `change_id` | Field-level term deltas |
| `change_summary` | Demo `devaluation_watch` | `run_timestamp` | Aggregated monitoring counts |
| `match_result` | `full_refresh`, `eligibility_matching` | `card_id` + rank in demo | Screening and scores |
| `run_summary` | Current Actor modes | Run context | Actual implementation run totals and source status |

> **Contract distinction:** `change_summary` and the simplified `eligible` / `unknown` values above come from the presentation fixtures. The current Actor uses `run_summary` and richer screening statuses including `likely_eligible`, `manual_review_required`, and `insufficient_information`. Its normalized field names may also differ. Use the real run output and `src/types.ts` for production integrations.

#### Scoring model

| Component | Default weight |
|---|---:|
| Benefits fit | 35% |
| Estimated net annual value | 30% |
| Published eligibility fit | 20% |
| Benefit stability | 15% |

**Net annual value** = modeled cashback + modeled rewards + defensibly valued usable benefits − recurring annual fee − applicable modeled costs. Unknown or unsupported rules must not be fabricated. Current implementation only prices supported rules and does not automatically monetize all perks.

**Stability risk** is a heuristic index from historical observations, not a probability of future devaluation. A first snapshot does not justify a low-risk label; return `insufficient_data` until enough comparable history exists.

#### Security and responsible use

- **Published criteria only:** Salary checks do not represent issuer underwriting, bureau decisions, or approval probabilities.
- **No sensitive identity data required:** Do not submit PAN, full names, card/account numbers, phone numbers, or exact addresses.
- **Minimize profile retention:** Matching logic uses generalized estimates; the Actor avoids copying exact profiles into output and logs. Apify stores run inputs separately, so configure access and retention appropriately.
- **Evidence before alerts:** Treat source failures and missing fields as unknown, not as confirmed benefit removals. Require analyst review where evidence is ambiguous.
- **Historical integrity:** Preserve accepted snapshots on failed fetches; use persistent named stores and deduplicate change events by `change_id`.

### API integration

After deploying your Actor, start a run and retrieve its Dataset through the authenticated Apify API:

```bash
curl -X POST "https://api.apify.com/v2/acts/USERNAME~cardwise-intelligence/runs" \
  -H "Authorization: Bearer ${APIFY_TOKEN}" \
  -H "Content-Type: application/json" \
  --data @examples/card_database.json

curl "https://api.apify.com/v2/datasets/DATASET_ID/items?format=json&offset=0&limit=100" \
  -H "Authorization: Bearer ${APIFY_TOKEN}"
```

Use `card_id` to upsert catalog entries, `change_id` to deduplicate alerts, and `match_result` status plus score explanations to build transparent screening workflows. See the [Actor runs API](https://docs.apify.com/api/v2/act-runs-post) and [Dataset items API](https://docs.apify.com/api/v2/dataset-items-get).

***

### Technical reference

The following section preserves the original implementation-specific instructions, operational caveats, and deployment guidance.

### Run locally (original implementation notes)

Requires Node.js 22.12 or later and network access to npm and issuer sites. Install the official [Apify CLI](https://docs.apify.com/cli/docs/quick-start) for local Actor runs and deployment.

```shell
npm ci
npm test
npm run check
npm run demo
apify run --input-file examples/card_database.json
apify run --input-file examples/devaluation_watch.json
apify run --input-file examples/eligibility_matching.json
```

The default local output lives in `storage/datasets/default`. The named stores are under `storage/key_value_stores` and `storage/datasets`. Use the same local directory and storage names across runs. The demo runs without external packages and writes isolated, labeled JSON to `storage/demo/simulated-*`.

### Inputs and outputs

| Mode | Dataset rows |
|---|---|
| `full_refresh` (default) | Cards, detected changes, optional matches, summary |
| `card_database` | Cards and summary. With change detection enabled, new changes also go to named history |
| `devaluation_watch` | Detected changes and summary. Always compares snapshots |
| `eligibility_matching` | Matches and summary. Reads saved snapshots without crawling |

See [example inputs](examples/) and [TypeScript contracts](src/types.ts). Use `record_type` to route items to a product catalog, alert queue, or screening workflow. The run summary distinguishes an empty change feed from an inaccessible crawl. Exact profile values stay out of output rows, history, and logs. Apify manages the original input separately in the run input store. Use business-approved retention and synthetic examples where appropriate. The Actor accepts no payment identifiers or contact information.

The [starter registry](src/registry.ts) covers 13 products from SBI Card, HDFC Bank, Axis Bank, and ICICI Bank. Omit `cards` to use it or supply your own verified issuer links. Custom entries take `card_id`, `issuer`, `card_name`, optional `adapter` (default `generic`), and `sources`. Each source takes a public HTTPS `url`, a `kind` (`product`, `terms`, `fees`, `rewards`, `notice`, or `eligibility`), and a `scope` (`card` by default or `issuer`). Provide one card-scoped product source. The Actor treats custom URLs as caller-attested issuer sources. Mark shared documents `issuer` so lines for unrelated products cannot be scored.

`source_fields` gives each field a status. `verified` means the extractor found evidence for the stated scope. `review_required` marks conflicts. `unknown` and `source_unavailable` indicate a missing observation. Empty lists require their corresponding status to be interpreted. Use `include_sources=false` to omit card evidence and successful checks. Change evidence and access failures remain visible.

### Screen a user in Apify

Run `card_database` or `full_refresh` to populate the snapshot store. Then open the Actor’s **Input → JSON** tab and run this example. Replace the synthetic profile values with the caller’s authorized values and set `max_cards` and `snapshot_store` to the values used by the refresh.

```json
{
  "mode": "eligibility_matching",
  "max_cards": 10,
  "snapshot_store": "cardwise-snapshots-v1",
  "calculate_scores": false,
  "profile": {
    "city": "Bengaluru",
    "employment_type": "salaried",
    "monthly_income_inr": 50000,
    "credit_score_band": "750_plus"
  }
}
```

In **Output**, read the rows with `record_type: "match_result"`. Each row has a card ID, `eligibility_status`, `criteria_met`, `criteria_not_met` and `unknown_criteria`. `likely_eligible` means the user meets the comparable published criteria and some checks remain unknown. `manual_review_required` means a published condition needs review. `insufficient_information` means the Actor lacks enough comparable criteria. `screening_basis: "no_snapshot"` identifies missing stored data for that card. These statuses describe published criteria screening. Issuers make approval decisions.

The same profile can be included in `full_refresh` to screen against freshly collected observations in one run. Enable `calculate_scores` and supply preferences and spend only if you also want ranking. Keep live profiles in private run inputs. Do not include identity numbers, contact details or payment information. [Apify secret input](https://docs.apify.com/actors/development/actor-definition/input-schema/secret-input)

If a snapshot store was populated by the build that mixed Axis recommendation tiles into card terms, start a clean baseline with a new pair of names, such as `cardwise-snapshots-v2` and `cardwise-changes-v2`, on the corrected build. Use the same pair for future refreshes and watches and the same snapshot name for matching. The existing history is retained in its original Dataset.

### History and scoring

The default named stores are `cardwise-snapshots-v1` and `cardwise-changes-v1`. The first successful observation establishes a baseline. Subsequent refreshes compare normalized terms tied to the same source. Unknown observations and incomplete collections preserve the earlier evidence. For example, a missing lounge paragraph does not establish removal. An explicit no-access statement can. Newly published structured rules and qualifying restrictions can generate review-required changes. A source migration may require a new storage namespace. Disabling `detect_changes` advances accepted terms without recording their differences.

Keep one refresh writer per snapshot store. A pending change batch is saved with the snapshot before appending to the named Dataset. Retries can deliver the same change again. Deduplicate by `change_id`. Configure snapshot and history names together when isolating schedules or tenants. Matching omits individual observations older than 30 days.

Screening uses published criteria and does not predict bank approval. Known failures are unranked. Missing, conditional or conflicting criteria are returned for review. Compare a supplied credit-score band with the published minimum only when the band lies wholly above or below the threshold. The supplied monthly income is assumed to match the issuer's income definition. Annual ITR and invitation conditions require review.

The weighted score uses benefits fit (35%), modeled annual value (30%), published eligibility fit (20%), and stability (15%). Missing components are omitted and the remaining weights are normalized. Read score coverage before comparing cards. Annual value is a partial estimate that applies modeled rewards and verified caps to qualifying spend, then subtracts the recurring fee. Known transaction minimums are withheld from aggregate estimates, and unsupported reward rules produce no estimate. Automatic spend mapping covers qualifying SBI Cashback online and offline spend and explicitly uncapped point rules with a recognized spend category. Keep online and offline buckets separate from category buckets. Point-value overrides apply only to mappable rules with verified earning terms. Perks, tax, interest, and potential fee waivers are unpriced. See the individual score explanations for assumptions.

Stability uses a trailing 365-day severity-weighted index. It needs three comparable refresh dates spanning 30 days and a recent observation. The index is a heuristic, so 78/100 is not a 78% probability. A first snapshot returns `insufficient_data`.

### Deploy and consume

1. From this directory, run `apify login` and confirm in your browser. Run `apify push` and open the Console link printed when the build succeeds. On Windows, use `apify.cmd` if PowerShell blocks the script shim. [Apify CLI quick start](https://docs.apify.com/cli/docs/quick-start)
2. In the Actor's Input tab, run `card_database` with `max_cards: 5` and `include_sources: true`. In the finished run's Output tab, inspect the default Dataset as JSON. Look for five `card` rows and a `run_summary` with `cards_with_verified_fields` greater than zero. Check `source_fields` and review any failures under `source_checks`.
3. Run `devaluation_watch` with the same card selection and storage names. An immediate rerun can return `changes: 0` when terms match the baseline. For a controlled example of a reduction, use the [simulated demo](docs/DEMO.md).
4. Run [eligibility_matching.json](examples/eligibility_matching.json) with `max_cards` set to `5`. Look for `match_result` rows with `screening_basis: stored_snapshot`. Check eligibility status, score explanations, and rank where available.
5. Complete the Publishing tab, accept the Store terms through the account owner, and select **Publish on Store**. Verify access to the listing and a successful run under the published build. [Apify Store publication](https://docs.apify.com/actors/publishing/publish)

Use the authenticated REST API to start a run, wait for success, then paginate the run's `defaultDatasetId`. Keep the token in an environment secret.

```shell
curl -X POST "https://api.apify.com/v2/acts/USERNAME~cardwise-intelligence/runs" \
  -H "Authorization: Bearer ${APIFY_TOKEN}" \
  -H "Content-Type: application/json" \
  --data @examples/card_database.json

curl "https://api.apify.com/v2/datasets/DATASET_ID/items?format=json&offset=0&limit=100" \
  -H "Authorization: Bearer ${APIFY_TOKEN}"
```

Use the [Actor runs API](https://docs.apify.com/api/v2/act-runs-post) and [Dataset items API](https://docs.apify.com/api/v2/dataset-items-get) for integration details. Fintech teams can upsert current records by `card_id`, fan out negative changes to an analyst queue, and rank matches using the returned status, score and explanations.

### Coverage and demo

Adapters are deterministic and may miss issuer wording, text rendered by JavaScript, scanned PDFs and complex cross-product tables. The crawler honors robots rules and access restrictions. It records blocked sources and protects the previous baseline. Verify meaningful changes against linked issuer evidence before publishing them downstream.

See the [two-minute demo](docs/DEMO.md), [simulated JSON output](examples/simulated-output.json), [milestones](docs/MILESTONES.md), and [progress log](docs/PROGRESS.md).

# Actor input Schema

## `mode` (type: `string`):

Choose the refresh, database, change watch or stored matching workflow.

## `country` (type: `string`):

Indian credit cards.

## `max_cards` (type: `integer`):

Maximum number of cards selected in registry order.

## `include_sources` (type: `boolean`):

Return field evidence and successful source checks. Source failures and detected change evidence are always included.

## `detect_changes` (type: `boolean`):

Compare and log changes on refresh. Watch mode always compares. Disable only to rebaseline without change alerts.

## `calculate_scores` (type: `boolean`):

Calculate matching score components and ranking when a profile is provided.

## `cards` (type: `array`):

Leave empty to use the starter registry. Each entry needs card_id, issuer, card_name, and sources. Supply one card-scoped product source and optional terms, fees, rewards, notice or eligibility sources.

## `profile` (type: `object`):

Use only the supported profile fields. Use synthetic values for demos. Required in eligibility matching mode.

## `point_values_inr` (type: `object`):

Map card IDs to INR per point valuations. Each estimate discloses the override.

## `snapshot_store` (type: `string`):

Reuse this store name to retain accepted terms across runs.

## `change_dataset` (type: `string`):

Reuse this dataset name to retain append-only change history.

## Actor input object example

```json
{
  "mode": "full_refresh",
  "country": "IN",
  "max_cards": 15,
  "include_sources": true,
  "detect_changes": true,
  "calculate_scores": true,
  "cards": [],
  "point_values_inr": {},
  "snapshot_store": "cardwise-snapshots-v1",
  "change_dataset": "cardwise-changes-v1"
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("fundamental_quillwort_ooj/cardwise-intelligence").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("fundamental_quillwort_ooj/cardwise-intelligence").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call fundamental_quillwort_ooj/cardwise-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fundamental_quillwort_ooj/cardwise-intelligence"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/BeYG89jSwY7FFT469/builds/b3jvVhRjkQIqStCFd/openapi.json
