CardDweeb API

The CardDweeb API allows developers to retrieve card data, deck data and related information from the CardDweeb database. Use it to build tools, websites, applications, and other integrations.


Base URL

All API endpoints use the following base URL:

https://www.carddweeb.com/api

Requirements

Every request must include a non-empty User-Agent header identifying the client making the request. Requests without this header will be rejected.

We recommend identifying your application by name and version:

User-Agent: MyCardApp/1.0

Endpoints

GET /api/cards

Returns a paginated list of cards, including available card data and related information.

Query parameters

Parameter Type Default Description
limit Integer 50 Number of cards to return. Must be between 1 and 100.
offset Integer 0 Number of cards to skip. Must be zero or greater.

Example request:

GET https://www.carddweeb.com/api/cards?limit=25&offset=0

GET /api/cards/sets

Returns the available card sets.

GET /api/cards/landscapes

Returns the available landscape cards.

GET /api/cards/cardtypes

Returns the available card types.

GET /api/decks

Returns a paginated list of visible decks.

Query parameters

Parameter Type Default Description
limit Integer 50 Maximum number of decks to return in one response. Must be between 1 and 100.
offset Integer 0 Number of decks to skip before returning results. Must be zero or greater.

Example requests

Retrieve the first page of decks:

GET https://www.carddweeb.com/api/decks?limit=50&offset=0

Retrieve the next page:

GET https://www.carddweeb.com/api/decks?limit=50&offset=50

Response Format

Successful requests return JSON using a consistent response structure. The following is an example of a paginated card response:

{
  "data": [
    ...
  ],
  "elapsed": 12.4,
  "next": "https://www.carddweeb.com/api/[type]?limit=50&offset=50",
  "total": 237,
  "count": 50,
  "limit": 50,
  "offset": 0
}
Property Description
data The returned cards or other requested data.
elapsed Time taken to retrieve the data, in milliseconds.
next URL for the next page, or an empty value when no further page is available.
total Total number of matching records available.
count Number of records included in the current response.
limit Maximum number of records requested for this response.
offset Number of records skipped before this response.

Pagination

The cards endpoint supports pagination so clients can retrieve large datasets in smaller requests.

  • First page: /api/cards?limit=50&offset=0
  • Second page: /api/cards?limit=50&offset=50
  • Third page: /api/cards?limit=50&offset=100

Whenever possible, follow the URL provided in the next property rather than manually constructing the next request. The total property represents the total number of records, while count represents the number returned in the current response.

Errors

Invalid requests return an appropriate HTTP status code and a JSON error response.

Status Description
400 Bad Request Invalid pagination parameters or a missing User-Agent header.
404 Not Found The requested endpoint or resource does not exist.
500 Internal Server Error An unexpected server error occurred.

Example error response:

{
  "title": "Invalid limit",
  "status": 400,
  "detail": "Limit must be between 1 and 100."
}

The CardDweeb API is intended to make card data accessible to developers and community projects.