List Cards
Retrieve a paginated list of cards with optional filtering and pagination.
Endpoints
GET
/api/v1/cardsExample Request
cURL
curl -G https://optcg-api.ryanmichaelhirst.us/api/v1/cards \
-d page=1 \
-d per_page=20 \
-d color=red \
-d search=Monkey \
-d rarity=L
Query Parameters
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
page | number | no | Page number for pagination (default: 1) |
per_page | number | no | Number of cards per page (default: 20) |
search | string | no | Search term to filter cards by name |
color | string | no | Filter cards by color (e.g., red, blue, green) |
set | string | no | Filter cards by set name |
type | string | no | Filter cards by type (e.g., Character, Event, Stage) |
cost | number | no | Filter cards by cost value |
class | string | no | Filter cards by class (e.g., Leader, Character, Event) |
counter | number | no | Filter cards by counter value |
power | number | no | Filter cards by power value |
rarity | string | no | Filter cards by rarity (e.g., C, U, R, SR, SEC) |
Example Response
JSON
{
"data": [
{
"id": "card_1234",
"code": "OP01-001",
"rarity": "SEC",
"type": "Character",
"name": "Monkey D. Luffy",
"cost": 4,
"attribute": "Straw Hat",
"power": 5000,
"counter": 1000,
"color": "red",
"class": "Leader",
"effect": "When this card attacks, you may draw 1 card.",
"set": "Romance Dawn",
"image": "https://example.com/card_image.jpg"
}
],
"total": 1,
"current_page": 1,
"per_page": 20,
"total_pages": 1
}
Card Properties
Response Schema
Property | Type | Description |
---|---|---|
id | string | Unique identifier from database, e.g. card_1234 |
code | string | Serial number on card, e.g. OP01-001 |
rarity | string | Card rarity, e.g. C | L | P | R | SEC | SP CARD | SR | TR | UC |
type | string | Card type, e.g. CHARACTER | EVENT | LEADER | STAGE |
name | string | Card name, e.g. Monkey D. Luffy |
cost | number | Card cost, e.g. 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
attribute | string | Card attribute, e.g. Ranged | Slash | Special | Strike | Wisdom |
power | number | Attack power, e.g. 1000 | 2000 | 3000 | 4000 | 5000 | 6000 | 7000 | 8000 | 9000 | 10000 | 11000 | 12000 |
counter | number | Counter value, e.g. 1000 | 2000 |
color | string | Card color, e.g. Red | Blue | Green | Purple | Yellow | Black |
class | string | Card class, e.g. Alabasta | Alabasta/Straw Hat Crew | ... |
effect | string | Card effect description |
set | string | Set name, e.g. Tournament Pack Vol.6 | Tournament Pack Vol.3 | ... |
image | string | Card image URL |