Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,4 @@ dmypy.json

# Claude
.claude/*.local.*
CLAUDE.md
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Python Project Template ![](https://github.com/ahcode0919/python-project-template/actions/workflows/ci.yml/badge.svg?branch=main)
# PyPricecharting API Client ![](https://github.com/ahcode0919/pypricecharting/actions/workflows/ci.yml/badge.svg?branch=main)

Baseline Python project template
Pricecharting API Client written in Python

## Setup

Expand All @@ -18,7 +18,7 @@ Note: Project uses `uv` and `just` to manage project configuration and commands
* Install Docker
* Install VSCode
* Open project folder in VS Code
* Install recommended extensions
* Optional - Install recommended extensions
* Reopen in container using Remote Development Container menu

## Project Commands
Expand All @@ -33,3 +33,10 @@ Note: Project uses `uv` and `just` to manage project configuration and commands
## Usage

* Usage Notes

## Supporting Files

Project contains an OpenAPI spec and a Bruno project for easy testing and mocking

* `./bruno` - Bruno project
* `./open_api` - OpenApi spec
2 changes: 2 additions & 0 deletions bruno/PricechartingAPI/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PRICECHARTING_TOKEN=your_40_character_api_token
PRICECHARTING_TEST_TOKEN=your_40_character_api_token
10 changes: 10 additions & 0 deletions bruno/PricechartingAPI/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Secrets
.env*
!.env.example

# Dependencies
node_modules

# OS files
.DS_Store
Thumbs.db
38 changes: 38 additions & 0 deletions bruno/PricechartingAPI/Marketplace API/folder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
info:
name: Marketplace API
type: folder
seq: 2

request:
auth: inherit

docs:
content: |-
Automate selling on the PriceCharting Marketplace.

Prices are integer pennies. Throttle `/api/offers` requests to the same URL to once per 5 minutes.

#### `offer-status` values
`available`, `sold`, `ended`, `pending` (vacation hold or payment issue, see `pending-reason`), `collection`

#### Condition IDs (`condition-id`)

| ID | Video Games | Cards | Comics | Coins |
|---|---|---|---|---|
| 1 | Loose | Ungraded | Ungraded | Ungraded |
| 2 | New & Sealed | Grade 8 | 6.0 | AU (50-58) |
| 3 | CIB | Grade 7 | 4.0 | VF (20-35) |
| 5 | Graded | Grade 9 | 8.0 | MS62 |
| 6 | Box only | Grade 9.5 | 9.2 | MS64 |
| 7 | Manual only | Grade 10 | 9.8 | MS66 |
| 8 | Item and Box | BGS 10 | 10.0 | F (12-15) |
| 9 | Item and Manual | Grade 1 | 2.0 | XF (40-45) |
| 10 | Box and Manual | Grade 2 | 9.6 | MS60 |
| 13 | Graded CIB | Grade 3 | 3.0 | MS61 |

#### Genres
Accessories, Action & Adventure, Arcade, Baseball, Beat'em Up, Basketball, Board & Card, Casino, Compilation, Controllers, Dance, Demo & NFR, Extreme Sports, Educational, Fighting, Football, FPS, Golf, Hack and Slash, Horror, Light Gun, Magazine, Mini Games, Movie, Music, Other, Party, Pinball, Platformer, Puzzle, Racing, RPG, Simulation, Shoot'em Up, Soccer, Sports, Strategy, Systems, Third Person Shooter, Trivia, Visual Novel, Wrestling

#### Console IDs
e.g. `G17` NES, `G13` Super Nintendo, `G11` Wii, `G59` Nintendo Switch. Full table: https://www.pricecharting.com/api-documentation
type: text/markdown
79 changes: 79 additions & 0 deletions bruno/PricechartingAPI/Marketplace API/offer-details.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
info:
name: /offer-details
type: http
seq: 2

http:
method: GET
url: https://www.pricecharting.com/api/offer-details?offer-id=
params:
- name: offer-id
value: ""
type: query
description: Required. Offer ID
auth: inherit

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
forwardAuthorizationHeader: false

docs: |-
Full details for one offer, including buyer shipping info after a sale.

#### *Response*

```json
{
"status":"success",
"buyer": { // buyer's shipping info
"buyer-email":"[email protected]",
"shipping-city":"Anytown",
"shipping-country":"United States",
"shipping-line1":"123 Smith St",
"shipping-line2":"",
"shipping-name":"John Doe",
"shipping-state":"NY",
"shipping-zip":"00000-0000"
},
"buyer-left-feedback":true, // has buyer posted feedback
"condition":"Normal wear",
"console-name":"Super Nintendo",
"cost-basis":125
"ended-time":"2017-10-31", // time the listing ended
"has-pictures":true,
"id":7000,
"includes":"Game only",
"is-collection":false,
"is-ended":true, // has offer ended
"is-price-descending":true, // is offer a reverse auction
"is-refunded":false, // has offer been refunded
"is-shipped":true, // has offer been shipped
"is-sold":true, // has offer sold
"max-price":12000,
"min-price":10000,
"offer-id":"vtdsww72uyslgooawzyyijsllm", // unique offer ID
"offer-status":"sold",
"offer-url":"/offer/vtdsww72uyslgooawzyyijsllm", // url for offer
"price":11281, // sales price. $112.81
"product-name":"Mega Man 7",
"refunded-time":"0001-01-01", // date of refund. zero value
"sale-time":"2017-10-31",
"seller-left-feedback":true, // has seller posted feedback
"shipped-time":"2017-10-31", // date offer shipped.
"shipping-premium":0, // extra paid for shipping internationally
"sku":"",
"start-time":"2017-10-20",
"tracking-number":"9400111234567890000000" // tracking number for shipment
}
```

- `buyer`: `buyer-email`, `shipping-name`, `shipping-line1`, `shipping-line2`, `shipping-city`, `shipping-state`, `shipping-zip`, `shipping-country`
- `buyer-left-feedback`, `seller-left-feedback`
- `id`, `product-name`, `console-name`, `condition`, `includes`
- `price`, `max-price`, `min-price`, `cost-basis`, `shipping-premium`
- `has-pictures`, `is-collection`, `is-ended`, `is-price-descending`, `is-refunded`, `is-shipped`, `is-sold`
- `offer-id`, `offer-status`, `offer-url`, `sku`, `tracking-number`
- `start-time`, `sale-time`, `shipped-time`, `ended-time`, `refunded-time`
41 changes: 41 additions & 0 deletions bruno/PricechartingAPI/Marketplace API/offer-end.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
info:
name: /offer-end
type: http
seq: 6

http:
method: POST
url: https://www.pricecharting.com/api/offer-end
body:
type: form-urlencoded
data:
- name: t
value: "{{t}}"
description: Required. Access token
- name: offer-id
value: ""
description: Required. Offer ID
auth: none

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
forwardAuthorizationHeader: false

docs: |-
End an offer so it can no longer be purchased. For collection items, this removes the item from the collection.

#### *Response*

```json
{
"status":"success",
"offer-id":"vtdsww72uyslgooawzyyijsllm",
"is-ended":true,
"ended-time":"2017-10-31"
}
```

`status`, `offer-id`, `is-ended`, `ended-time`
47 changes: 47 additions & 0 deletions bruno/PricechartingAPI/Marketplace API/offer-feedback.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
info:
name: /offer-feedback
type: http
seq: 5

http:
method: POST
url: https://www.pricecharting.com/api/offer-feedback
body:
type: form-urlencoded
data:
- name: t
value: "{{t}}"
description: Required. Access token
- name: offer-id
value: ""
description: Required. Offer ID
- name: rating
value: "2"
description: "Required. 2 Great | 1 Good | 0 Ok | -1 Bad | -2 Awful"
- name: comment
value: Great buyer
description: Text explaining the rating
auth: none

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
forwardAuthorizationHeader: false

docs: |-
Leave feedback on an offer.

#### *Response*

```json
{
"status":"success",
"offer-id":"vtdsww72uyslgooawzyyijsllm",
"rating":2,
"comment":"Great buyer"
}
```

`status`, `offer-id`, `rating`, `comment`
Loading
Loading