PriceCharting API Client written in Python
Project supports local development and VSCode Dev container development
Note: Project uses uv and just to manage project configuration and commands
- Install
just-brew install just - Set up project -
just setup- Installs Homebrew dependencies (
gitleaks,just,uv,zizmor) - Installs
prekgit hooks - Syncs project dependencies
- Installs Homebrew dependencies (
- Install Docker
- Install VSCode
- Open project folder in VS Code
- Reopen in container using Remote Development Container menu
just setup- install tools and git hooks, then sync dependenciesjust sync- sync project dependenciesjust build- build the sdist and wheel intodist/just lint- type check (ty), lint and format (ruff), and spellcheck (codespell). Fixes files in placejust ci-lint- same checks asjust lint, without modifying filesjust test- run unit testsjust prek- run all pre-commit hooksjust git-leaks- scan staged changes for secretsjust zizmor- audit GitHub Actions workflows for security issuesjust docs- serve the docs site locally with live reloadjust docs-build- build the docs site intosite/in strict modeuv add {package}- install a dependency
prek runs these hooks on commit (configured in prek.toml):
- Built-in checks: trailing whitespace, end of file, large files, YAML, and JSON
just ci-lintjust testgitleakssecret scan of staged changes
See CI.md for the GitHub Actions workflows and Dependabot setup.
The docs site is built with Zensical from mkdocs.yml and the pages in
docs/. API reference pages are generated from docstrings with mkdocstrings. The docs.yml
workflow deploys the site to GitHub Pages on every push to main.
Releases are published to GitHub Releases and to PyPI
by the Release workflow. See
RELEASE.md for how releases
and release labels work.
Both clients have a method for every Prices API and Marketplace API operation.
from pypricecharting import AsyncPriceCharting, PriceCharting
with PriceCharting("<40-character API token>") as client:
game = client.product(id="6910")
print(game.product_name, game.cib_price) # prices are in pennies
async with AsyncPriceCharting("<40-character API token>") as client:
game = await client.product(q="earthbound")
results = await client.products("chrono trigger") # up to 20 matchesWithout a token argument, the token is read from PRICECHARTING_TOKEN. See the docs site for
errors and client options.
Project contains an OpenAPI spec and a Bruno project for easy testing and mocking
./bruno- Bruno project./open_api- OpenAPI spec
- Offer details price limits -
OfferDetailsResponsereadsprice-maxandprice-min, the names in the documentation's key table. If the API sendsmax-priceandmin-priceinstead,price_maxandprice_mincome back asNonewith no error. Validate/api/offer-details - Extra Marketplace keys -
pending-reason,seller-id,image-url,best-competing-price,is-best-priced-offerandvalueare only onOfferDetailsResponse. The documentation doesn't say which endpoint returns each one. If/api/offersreturns any of them, add them toOffer