Metadata-Version: 2.5
Name: compsniper
Version: 0.2.0
Summary: Official Python client for the CompSniper API: real eBay sold prices, accepted Best Offer prices, 3 years of eBay sold history, PSA graded card prices and population, TCGplayer, Grailed, Depop, Poshmark and Mercari.
Project-URL: Homepage, https://compsniper.com
Project-URL: Documentation, https://compsniper.com/docs
Project-URL: Python guide, https://compsniper.com/guides/ebay-sold-listings-api-python
Project-URL: Pricing, https://compsniper.com/pricing
Author-email: CompSniper <support@compsniper.com>
License-Expression: MIT
License-File: LICENSE
Keywords: best offer,card comps,depop,ebay,ebay api,ebay sold listings,ebay sold prices,graded cards,grailed,price history,psa,sold comps,tcgplayer,terapeak alternative
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# CompSniper for Python

Real eBay sold prices from Python: up to 240 completed eBay sales per request with a cleaned price summary,
accepted Best Offer prices, and up to 3 years of eBay sold history. Plus PSA graded card prices and population,
TCGplayer, Grailed, Depop, Poshmark and Mercari, all with one API key. No dependencies.

```bash
pip install compsniper
export COMPSNIPER_API_KEY=cs_live_...   # free key: https://compsniper.com/signup (100 requests a month)
```

```python
from compsniper import CompSniper

client = CompSniper()

# Last ~90 days of eBay sold listings, with the real accepted price on Best Offer sales
sold = client.sold("charizard ex 199/165 psa 10", count=60, best_offer_price=True)
print(sold["summary"]["median"], len(sold["items"]))
for item in sold["items"][:5]:
    print(item["endedAt"], item["soldPrice"], item.get("acceptedOfferPrice"), item["title"])

# Up to 3 years of sold history
for row in client.history_pages("nintendo switch oled", start_date="2023-10-25", end_date="2026-10-25", max_pages=3):
    print(row["lastSoldDate"], row["averageSoldPrice"]["amount"], row["title"])

# Other eBay sites: ebay.co.uk, ebay.de, ebay.fr, ebay.it, ebay.es, ebay.ca, ebay.com.au
uk = client.sold("dyson v8", ebay_site="ebay.co.uk", itemCondition="used")

# PSA graded cards: prices by grade, sales with grader, grade and cert number, population report
card = client.psa_card("1999 pokemon base set charizard 4", grade="10")
print(card["priceByGrade"], card["population"]["gemRate"])
sets = client.psa_sets(game="pokemon", keyword="151")
population = client.psa_set(sets["items"][0]["headingId"])  # every card in the set, by grade

# Other marketplaces
tcg = client.tcgplayer_sold("charizard ex obsidian flames 223", count=100, history="annual")
grailed = client.grailed_sold("rick owens geobasket")   # price the buyer actually paid
depop = client.depop_listings("carhartt jacket", country="gb")

print(client.usage())
```

| Method | Endpoint |
| --- | --- |
| `sold`, `active`, `summary` | eBay sold or current listings and price summary (8 eBay sites) |
| `history`, `history_pages` | Up to 3 years of eBay sold history |
| `best_offer_prices` | Saved accepted Best Offer prices by item ID (free) |
| `psa_search`, `psa_card`, `psa_sets`, `psa_set` | PSA graded card prices by grade and population |
| `tcgplayer_sold`, `tcgplayer_listings` | TCGplayer completed sales, price history and listings |
| `grailed_sold`, `grailed_listings`, `depop_listings`, `poshmark_sold`, `mercari` | Other resale marketplaces |
| `usage` | Plan, quota and remaining requests |

Rate limits (HTTP 429) and temporary 502/503 errors are retried automatically, and failed requests are never
charged. Errors raise `CompSniperError` with `status`, `code` and `request_id`; a used-up monthly quota
(`quota_exceeded`) is never retried and carries `reset_at` and `upgrade_url`.

- Docs: https://compsniper.com/docs
- Python guide: https://compsniper.com/guides/ebay-sold-listings-api-python
- Pricing: https://compsniper.com/pricing (100 free requests a month, then from $9)
- Support: support@compsniper.com

MIT licensed.
