Skip to main content

pkmnprices

Python client for the Pkmn Prices API. Pokemon TCG card pricing from TCGPlayer, Cardmarket, and eBay.

Sync and async clients, both built on httpx. Typed responses, typed errors, and iterators that page through results for you. Python 3.10+.

Install

pip install pkmnprices

Usage

from pkmnprices import PkmnPrices

client = PkmnPrices("pk_your_key_here")

page = client.cards.list(name="charizard", per_page=10)

card = client.cards.get(page.data[0].id)
for price in card.prices:
    symbol = "€" if price.currency == "EUR" else "$"
    print(f"{price.source}: {symbol}{price.market_price}")

client.close()

The client is also a context manager:

with PkmnPrices("pk_...") as client:
    health = client.health()

Async

import asyncio
from pkmnprices import AsyncPkmnPrices

async def main():
    async with AsyncPkmnPrices("pk_...") as client:
        page = await client.cards.list(name="charizard")
        async for card in client.cards.iterate(name="charizard"):
            print(card.name)

asyncio.run(main())

Get an API key from https://pkmnprices.com/dashboard.

Options

PkmnPrices(
    "pk_...",         # API key, sent as the x-api-key header
    max_retries=2,    # retries on 429 rate limits and 5xx/network errors
    timeout=30.0,     # per-request timeout in seconds
)

Rate-limit 429s are retried with backoff. Credit-limit 429s (credit_limit_exceeded) are not, since they don't reset until the next day.

Pagination

List endpoints return a Page (.data, .pagination). Listing endpoints (eBay, Cardmarket, and TCGplayer) return a CursorPage. Both resources expose iterators so you don't track pages or cursors:

for card in client.cards.iterate(name="charizard"):
    print(card.name)

all_sets = client.sets.list_all(language="english")

for sale in client.cards.listings.iterate_ebay(789, graded=True, grader="PSA", grade="10"):
    print(sale.title, sale.price)

for offer in client.cards.listings.iterate_cardmarket(789, condition="Near Mint", variant="Reverse Holo"):
    print(offer.seller, offer.price, offer.language)

for offer in client.cards.listings.iterate_tcgplayer(789, condition="Near Mint"):
    print(offer.seller_name, offer.price, offer.shipping_price)

Sealed products carry the same two listing sources, under client.sealed.listings:

for offer in client.sealed.listings.iterate_tcgplayer(5678):
    print(offer.seller_name, offer.price, offer.quantity)

for sale in client.sealed.listings.iterate_ebay(5678, sort="price_desc"):
    print(sale.title, sale.price, sale.sold_at)

Sealed TCGplayer offers are normally condition "Unopened" with an empty printing, so those two filters rarely narrow anything. Sealed eBay sales are never graded, so graded, grader, and grade aren't accepted there and grader/grade come back None. The async client mirrors all of these on AsyncPkmnPrices.

Cardmarket special attributes

Cardmarket sells more than one kind of good under a single card. Every Cardmarket offer carries three booleans, and they are always present:

for offer in client.cards.listings.iterate_cardmarket(789):
    if offer.graded:
        print(offer.grader, offer.grade)  # "PSA", "10"
    if offer.signed or offer.altered:
        continue  # not a clean card

A signed, altered or graded offer is real, and it is returned, but it does not contribute to the card's market price. A signed and altered Near Mint copy at EUR 200 must not set the Near Mint price of a card whose clean copies sell for EUR 3,800, and a slab is priced for the slab rather than for the card.

The practical consequence: the cheapest row you get back is not necessarily the card's market_price. Filter these out before deriving a price yourself.

grader and grade are named to match the graded eBay sale shape, so "PSA 10" reads the same whichever source it came from. Both are None unless graded is true, and can be None even then — Cardmarket flags a slab without always naming the grader, and the details are read from free-text seller comments.

Languages

A card's language comes from its set, and it decides what pricing that card can ever have.

Language Cards Pricing Plan
English 28,158 USD (TCGplayer, eBay) + EUR (Cardmarket) Free
Japanese 29,660 USD + EUR Pro+
German 13,078 EUR (Cardmarket) only Pro+
german = client.cards.list(language="German", currency="eur")

Spelling is normalised: "German", "german", "de" and "DE" all resolve to the same thing, and responses come back in the canonical form ("German").

German cards have no USD price and never will — TCGplayer does not sell German product. Asking for German with currency="usd" returns an empty list rather than an error, so reach for "eur".

A free key is limited to English. Asking for Japanese or German raises ForbiddenError, and omitting language returns English only rather than the whole catalogue.

German coverage runs from HeartGold & SoulSilver (2010) to current sets.

Currency

Every price has a currency field. Pass currency="usd" or currency="eur" to filter, or leave it off to get everything your plan allows. EUR (Cardmarket) prices need a Pro plan; a free key asking for eur raises ForbiddenError.

card = client.cards.get(789, currency="usd")
box = client.sealed.get(5678, currency="eur")

Cardmarket current prices are condition- and printing-specific marketplace prices. Each EUR row has one market_price for its exact condition and variant; for example, a Near Mint Reverse Holofoil price is distinct from a Mint or Normal price. The retired Price Guide low, trend, and avg fields are not returned. Live Cardmarket listings are automatically restricted to the card's language.

Cardmarket Mapping

Card and sealed detail responses expose Cardmarket's stable product identifiers when a mapping is available:

card = client.cards.get(789)
print(card.cardmarket_url)
print(card.cardmarket_product_id)

box = client.sealed.get(5678)
print(box.cardmarket_url)
print(box.cardmarket_product_id)

Both fields are None until the product has been mapped.

Errors

Everything raised subclasses PkmnPricesError, which carries status, code, rate_limit, and retry_after.

from pkmnprices import ForbiddenError, NotFoundError, RateLimitError

try:
    client.cards.get(789, currency="eur")
except ForbiddenError:
    ...  # needs a higher plan
except NotFoundError:
    ...  # no such card
except RateLimitError:
    ...  # ran out of retries

Subclasses: BadRequestError (400), UnauthorizedError (401), ForbiddenError (403), NotFoundError (404), ConflictError (409), CreditLimitError and RateLimitError (429), InternalServerError (5xx), APIConnectionError (network/timeout).

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pkmnprices-3.2.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pkmnprices-3.2.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file pkmnprices-3.2.0.tar.gz.

File metadata

  • Download URL: pkmnprices-3.2.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pkmnprices-3.2.0.tar.gz
Algorithm Hash digest
SHA256 a40835ee0c94217535d06f49e3f38b608301b1d00edee5f2c5890e83d1e1e926
MD5 2af23e6127eb53707932978e54e35f01
BLAKE2b-256 09dd21be7221e9eb6ecd40d157c0522f7f4a4b0ba7516539ff6b2e5250f8b65e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pkmnprices-3.2.0.tar.gz:

Publisher: publish.yml on preaverage/pkmnprices-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pkmnprices-3.2.0-py3-none-any.whl.

File metadata

  • Download URL: pkmnprices-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pkmnprices-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b0eefa19c5a09cf62f3d180d6465885b9619d6ad553b0053460e27d842364a4
MD5 cd3e2f65dee0dbbe158fc4a9a7cb175a
BLAKE2b-256 56dfd034969798632d937f2088ff5cf723f21958a697d9a93e6a3d3fc3e7063f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pkmnprices-3.2.0-py3-none-any.whl:

Publisher: publish.yml on preaverage/pkmnprices-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

4.0.0

2 files

3.4.0

2 files

3.3.0

2 files

This release

3.2.0 This release

2 files

3.1.0

2 files

3.0.0

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page