List Cards

Retrieve a paginated list of cards with optional filtering and pagination.

Endpoints

GET
/api/v1/cards

Example 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
ParameterTypeRequiredDescription
pagenumber
no
Page number for pagination (default: 1)
per_pagenumber
no
Number of cards per page (default: 20)
searchstring
no
Search term to filter cards by name
colorstring
no
Filter cards by color (e.g., red, blue, green)
setstring
no
Filter cards by set name
typestring
no
Filter cards by type (e.g., Character, Event, Stage)
costnumber
no
Filter cards by cost value
classstring
no
Filter cards by class (e.g., Leader, Character, Event)
counternumber
no
Filter cards by counter value
powernumber
no
Filter cards by power value
raritystring
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
PropertyTypeDescription
idstringUnique identifier from database, e.g. card_1234
codestringSerial number on card, e.g. OP01-001
raritystringCard rarity, e.g. C | L | P | R | SEC | SP CARD | SR | TR | UC
typestringCard type, e.g. CHARACTER | EVENT | LEADER | STAGE
namestringCard name, e.g. Monkey D. Luffy
costnumberCard cost, e.g. 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
attributestringCard attribute, e.g. Ranged | Slash | Special | Strike | Wisdom
powernumberAttack power, e.g. 1000 | 2000 | 3000 | 4000 | 5000 | 6000 | 7000 | 8000 | 9000 | 10000 | 11000 | 12000
counternumberCounter value, e.g. 1000 | 2000
colorstringCard color, e.g. Red | Blue | Green | Purple | Yellow | Black
classstringCard class, e.g. Alabasta | Alabasta/Straw Hat Crew | ...
effectstringCard effect description
setstringSet name, e.g. Tournament Pack Vol.6 | Tournament Pack Vol.3 | ...
imagestringCard image URL