Skip to content

feat: Add Pricing Model#330

Open
advra wants to merge 9 commits into
tcgdex:masterfrom
advra:story/add-pricing-model
Open

feat: Add Pricing Model#330
advra wants to merge 9 commits into
tcgdex:masterfrom
advra:story/add-pricing-model

Conversation

@advra

@advra advra commented Jul 6, 2026

Copy link
Copy Markdown

Addresses #329

This adds the new pricing model

  • Define tcgplayer variants
  • Add variants to cardmarket and tcgplayer pricing model
  • Add untyped loose variants to support future api variants which we dont have explicitly defined
  • Support pricing object in response root and per variant
  • add unit test based off example response shown below.

Example: https://api.tcgdex.net/v2/en/cards/me02-001

{
  "category": "Pokemon",
  "id": "me02-001",
  ...
  "variants_detailed": [
    {
      "type": "normal",
      "size": "standard",
      "variantId": "endfynwn4n10gzq",
      "pricing": {
        "cardmarket": {
          "updated": "2026-07-14T18:04:08.636Z",
          "unit": "EUR",
          "idProduct": 857576,
          "avg": 0.03,
          "low": 0.02,
          "trend": 0.03,
          "avg1": 0.02,
          "avg7": 0.02,
          "avg30": 0.02,
          "avg-holo": 0.07,
          "low-holo": 0.02,
          "trend-holo": 0.07,
          "avg1-holo": 0.05,
          "avg7-holo": 0.07,
          "avg30-holo": 0.07
        },
        "tcgplayer": {
          "unit": "USD",
          "updated": "2026-07-14T18:04:20.943Z",
          "normal": {
            "productId": 662205,
            "lowPrice": 0.01,
            "midPrice": 0.15,
            "highPrice": 1000,
            "marketPrice": 0.15,
            "directLowPrice": 0.01
          },
          "reverse-holofoil": {
            "productId": 662205,
            "lowPrice": 0.01,
            "midPrice": 0.22,
            "highPrice": 19.98,
            "marketPrice": 0.22,
            "directLowPrice": 0.01
          }
        }
      }
    },
    {
      "type": "reverse",
      "size": "standard",
      "variantId": "cm4kqul3x1bwlz1f",
      "pricing": {
        "cardmarket": {
          "updated": "2026-07-14T18:04:08.636Z",
          "unit": "EUR",
          "idProduct": 857576,
          "avg": 0.03,
          "low": 0.02,
          "trend": 0.03,
          "avg1": 0.02,
          "avg7": 0.02,
          "avg30": 0.02,
          "avg-holo": 0.07,
          "low-holo": 0.02,
          "trend-holo": 0.07,
          "avg1-holo": 0.05,
          "avg7-holo": 0.07,
          "avg30-holo": 0.07
        },
        "tcgplayer": {
          "unit": "USD",
          "updated": "2026-07-14T18:04:20.943Z",
          "normal": {
            "productId": 662205,
            "lowPrice": 0.01,
            "midPrice": 0.15,
            "highPrice": 1000,
            "marketPrice": 0.15,
            "directLowPrice": 0.01
          },
          "reverse-holofoil": {
            "productId": 662205,
            "lowPrice": 0.01,
            "midPrice": 0.22,
            "highPrice": 19.98,
            "marketPrice": 0.22,
            "directLowPrice": 0.01
          }
        }
      }
    }
  ],
  ...
  "pricing": {
    "cardmarket": {
      "updated": "2026-07-14T18:04:08.636Z",
      "unit": "EUR",
      "idProduct": 857576,
      "avg": 0.03,
      "low": 0.02,
      "trend": 0.03,
      "avg1": 0.02,
      "avg7": 0.02,
      "avg30": 0.02,
      "avg-holo": 0.07,
      "low-holo": 0.02,
      "trend-holo": 0.07,
      "avg1-holo": 0.05,
      "avg7-holo": 0.07,
      "avg30-holo": 0.07
    },
    "tcgplayer": {
      "unit": "USD",
      "updated": "2026-07-14T18:04:20.943Z",
      "normal": {
        "productId": 662205,
        "lowPrice": 0.01,
        "midPrice": 0.15,
        "highPrice": 1000,
        "marketPrice": 0.15,
        "directLowPrice": 0.01
      },
      "reverse-holofoil": {
        "productId": 662205,
        "lowPrice": 0.01,
        "midPrice": 0.22,
        "highPrice": 19.98,
        "marketPrice": 0.22,
        "directLowPrice": 0.01
      }
    }
  }
}

Comment thread src/models/Other.d.ts
Comment thread src/models/Other.d.ts
@advra
advra force-pushed the story/add-pricing-model branch from e788051 to f0e55c0 Compare July 10, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant