{"openapi":"3.0.3","info":{"title":"TCG Collection Valuation API","version":"1.0.0","description":"Daily Pokémon Cardmarket EUR guide prices. Responses include an observation date for each available price."},"paths":{"/api/v1/valuation":{"post":{"operationId":"valueCollection","summary":"Value a collection in euros","description":"Free allows 20 rows per batch and 500 per UTC month. Pro allows 500 per batch and 30000 per month. Each submitted row counts once, including unmatched cards. Quantities do not affect row usage.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Valuation"},"example":{"metric":"trend","items":[{"game":"pokemon","set":"30C","number":"149/128","quantity":2}]}}}},"responses":{"200":{"description":"Cardmarket EUR price guide valuation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Unknown subscription","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Batch too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or row quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/demo/valuation":{"post":{"operationId":"previewValuation","summary":"Preview a valuation","description":"Preview up to 10 rows per request and 50 rows per UTC day per IP.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preview"},"example":{"metric":"trend","items":[{"game":"pokemon","set":"30C","number":"149/128","quantity":2}]}}}},"responses":{"200":{"description":"Cardmarket EUR price guide valuation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Unknown subscription","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Batch too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or row quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/api/v1/usage":{"get":{"operationId":"getUsage","summary":"Read current account usage","responses":{"200":{"description":"Usage for the current UTC month","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Unknown subscription","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Unsupported media type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Batch too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit or row quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/media/cards/pokemon/{card_id}":{"parameters":[{"name":"card_id","in":"path","required":true,"schema":{"type":"integer","format":"int64","minimum":1},"description":"Cardmarket product ID"}],"get":{"operationId":"getCardImage","summary":"Get the card image","security":[],"responses":{"200":{"description":"Image file","content":{"image/*":{"schema":{"type":"string","format":"binary"}}}},"304":{"description":"The cached image is current"},"404":{"description":"Image unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Card":{"oneOf":[{"type":"object","properties":{"game":{"type":"string","enum":["pokemon"]},"quantity":{"type":"integer","minimum":1,"maximum":10000,"default":1},"id":{"type":"integer","format":"int64","minimum":1}},"required":["game","id"],"additionalProperties":false},{"type":"object","properties":{"game":{"type":"string","enum":["pokemon"]},"quantity":{"type":"integer","minimum":1,"maximum":10000,"default":1},"set":{"type":"string","maxLength":150},"number":{"type":"string","maxLength":40}},"required":["game","set","number"],"additionalProperties":false}]},"Result":{"type":"object","properties":{"metric":{"type":"string","enum":["trend","low","avg7","avg30"],"default":"trend"},"currency":{"type":"string","enum":["EUR"]},"total":{"type":"number","format":"double"},"priced_quantity":{"type":"integer"},"requested_quantity":{"type":"integer"},"items":{"type":"array","items":{"type":"object","properties":{"game":{"type":"string","enum":["pokemon"]},"id":{"type":"integer","nullable":true},"name":{"type":"string","nullable":true},"quantity":{"type":"integer"},"set":{"type":"string","nullable":true},"number":{"type":"string","nullable":true},"unit_price":{"type":"number","format":"double","nullable":true},"image_url":{"type":"string","nullable":true,"description":"URL of this printing's hosted image, when available. Private previews use a path relative to the API origin."},"subtotal":{"type":"number","format":"double","nullable":true},"day":{"type":"string","format":"date","nullable":true},"status":{"type":"string","enum":["priced","unpriced","ambiguous","not_found"]}},"required":["game","quantity","status","unit_price","subtotal","day","image_url"],"additionalProperties":false}}},"required":["metric","currency","total","items"],"additionalProperties":false},"Usage":{"type":"object","properties":{"rows_used":{"type":"integer"},"rows_remaining":{"type":"integer"},"rows_limit":{"type":"integer"},"batch_limit":{"type":"integer"},"requests_per_minute":{"type":"integer"},"plan":{"type":"string","enum":["free","pro"]},"period":{"type":"string"},"resets_at":{"type":"string","format":"date-time"}},"required":["plan","rows_remaining","resets_at"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error","message"],"additionalProperties":false},"Valuation":{"type":"object","properties":{"metric":{"type":"string","enum":["trend","low","avg7","avg30"],"default":"trend"},"items":{"type":"array","minItems":1,"maxItems":500,"items":{"$ref":"#/components/schemas/Card"}}},"required":["items"],"additionalProperties":false},"Preview":{"type":"object","properties":{"metric":{"type":"string","enum":["trend","low","avg7","avg30"],"default":"trend"},"items":{"type":"array","minItems":1,"maxItems":10,"items":{"$ref":"#/components/schemas/Card"}}},"required":["items"],"additionalProperties":false}},"securitySchemes":{"DirectKey":{"type":"http","scheme":"bearer"},"RapidAPIKey":{"type":"apiKey","in":"header","name":"X-RapidAPI-Key","description":"Sent to your subscribed RapidAPI gateway host."}}},"security":[{"DirectKey":[]},{"RapidAPIKey":[]}]}