Skip to main content

KRCG API

PyPI version Validation Python version License Code Style

A web API for V:tES based on the VEKN official card texts and the Tournament Winning Deck Archive (TWDA).

Portions of the materials are the copyrights and trademarks of Paradox Interactive AB, and are used with permission. All rights reserved. For more information please visit white-wolf.com.

Dark Pack

Online API and documentation

KRCG is a free to use (and documented) online API. Anyone is free to use it, without warranty.

Breaking changes will only be introduced at major version upgrades, after a proper deprecation period.

Contribute

Contributions are welcome !

This API is an offspring of the KRCG python package, so please refer to that repository for issues, discussions and contributions guidelines.

Cards and decks are served in the KRCG v5 JSON format.

Examples

Query a card by name or ID, get text, rulings, prints and image URL (prints and rulings truncated here for brevity):

curl -X GET "http://127.0.0.1:8000/card/Alastor" -H  "accept: application/json"
{
  "id": 100038,
  "printed_name": "Alastor",
  "kind": "Library",
  "types": ["Political Action"],
  "url": "https://static.krcg.org/card/alastor.jpg",
  "text": "Requires a justicar or Inner Circle member...",
  "legal": "2004-06-16",
  "artists": ["Monte Moore"],
  "prints": [
    {
      "set": { "id": 300012, "code": "Gehenna" },
      "occurrences": [{ "type": "Rarity", "frequency": "R", "multiplier": 1.0 }],
      "url": "https://static.krcg.org/card/set/gehenna/alastor.jpg"
    }
  ],
  "rulings": [
    {
      "text": "If the weapon retrieved costs blood, that cost is paid by the vampire chosen by the terms. [LSJ 20040518]",
      "reminder": false,
      "references": [
        {
          "text": "[LSJ 20040518]",
          "label": "LSJ 20040518",
          "url": "https://groups.google.com/g/rec.games.trading-cards.jyhad/c/4emymfUPwAM/m/B2SCC7L6kuMJ"
        }
      ]
    }
  ],
  "i18n": {},
  "variants": [],
  "cards": []
}

A card whose text names another card marks it in place with <Card Name>, and lists the cards it names in cards:

{
  "printed_name": "Villein",
  "text": "Trifle.\nPut this card on a vampire you control who has any amount of blood and move 2 to 5 blood from that vampire to your pool. Cards named <Minion Tap> cost you +1 pool to play. Villein costs +1 pool to play on this vampire.",
  "cards": [
    {
      "id": 101217,
      "printed_name": "Minion Tap",
      "unicity_suffix": "",
      "suffix": ""
    }
  ]
}

Every marker left in the text names a card listed in cards, so a client can render them as links; strip the angle brackets to display the plain text.

Search for cards by text, type, discipline, title, city, artist, set, preconstructed starter, group, capacity, trait, sect, bonus values, etc.:

curl
    -X POST "http://127.0.0.1:8000/card_search"
    -H "Content-Type: application/json"
    -d "{\"type\":[\"political action\"],\"sect\":[\"anarch\"]}"
[
    "Anarch Salon",
    "Eat the Rich",
    "Firebrand",
    "Free States Rant",
    "Patsy",
    "Reckless Agitation",
    "Revolutionary Council",
    "Sweeper"
]

Get candidates for your decklist out of the TWDA:

curl
    -X POST "http://127.0.0.1:8000/candidates"
    -H  "Content-Type: application/json"
    -d "{\"cards\":[\"Cybele\",\"Nana Buruku\"]}"
[
  {
    "average": 14,
    "card": "Ashur Tablets",
    "deviation": 6.25,
    "score": 1
  },
  {
    "average": 1,
    "card": "Giant's Blood",
    "deviation": 0,
    "score": 1
  },
  {
    "average": 2,
    "card": "The Parthenon",
    "deviation": 0.81,
    "score": 1
  },
  {
    "average": 1,
    "card": "Archon Investigation",
    "deviation": 0,
    "score": 0.9
  },
  ...
]

And a few other features, including:

  • search decks in the TWDA, by cards, dates, author and number of players
  • deck list format conversion
  • retrieving a decklist from an Amaranth share URL
  • card name completions

Check the online documentation for more.

Hosting the web API

To host the web API, you can use uv or pip to install it:

uv pip install "krcg-api"
# or
pip install "krcg-api"

krcg-api is an ASGI application served by uvicorn (installed as a dependency). The ASGI entrypoint is krcg_api:application:

uvicorn krcg_api:application --host 127.0.0.1 --port 8000

For production you can run several uvicorn workers behind a reverse proxy (see Deployment below).

The API loads all card and deck data in memory at startup (no database). It needs no configuration nor environment variables.

Development

The development version uses uv for package management. Requires Python 3.12+.

$ just install
$ just serve
...
Uvicorn running on http://127.0.0.1:8000

You can check the API is running by using your browser on the provided address http://127.0.0.1:8000.

just test runs the quality checks (ruff, ty) and the test suite. The tests load the bundled card/deck snapshot, so they run offline; the deck-provider tests (Amaranth, VDB, VTES Decks) reach external sites and skip when offline.

Deployment

The API is deployed to a server with Ansible, reusing the shared roles from server-setup. A systemd service runs uvicorn on a local port and the nginx_site role fronts it with nginx + Let's Encrypt. See deploy/README.md for details.

Deployment runs from GitHub Actions via workflow_dispatch and automatically on every published release. The workflow ships in deploy/ci/deploy.yml and must be moved under .github/workflows/ by a maintainer (see deploy/ci/README.md).

Metadata

Release files for krcg-api 4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for krcg-api 4.3
File Size Uploaded
krcg_api-4.3.tar.gz 55.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for krcg-api 4.3
File Interpreter ABI Platform
krcg_api-4.3-py3-none-any.whl Python 3 none any Details

Total release size: 70.4 kB

Release files / krcg_api-4.3.tar.gz

Download URL krcg_api-4.3.tar.gz
Size 55.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ac6cc1a24d62e9a505658eb9cdb341bdd49b54e57409e4bb3eeb29da435f5263
BLAKE2b-256 checksum
How to use checksums
5b25a861cd9bd4d16dfbcc9432a4a1b787edfcf5c0f0ecdbfedffe34297807aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release files / krcg_api-4.3-py3-none-any.whl

Download URL krcg_api-4.3-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
248577d5cb2bba3d6fac6fd8abad716fc57d946242492d63408c2138ab013922
BLAKE2b-256 checksum
How to use checksums
62529d3f89573e8ffdb608bd24e45956f0e908199f2526fe8d1218d01c16796d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

4.3 This release

2 release files

4.2

2 release files

4.1

2 release files

4.0

2 release files

3.4

2 release files

3.3

2 release files

3.2

2 release files

3.1

2 release files

3.0

2 release files

2.22

2 release files

2.21

2 release files

2.20

2 release files

2.19

2 release files

2.18

2 release files

2.17

2 release files

2.16

2 release files

2.15

2 release files

2.14

2 release files

2.13

2 release files

2.12

2 release files

2.11

2 release files

2.10

2 release files

2.9

2 release files

2.8

2 release files

2.7

2 release files

2.6

2 release files

2.5

2 release files

2.4

2 release files

2.3

2 release files

2.2

2 release files

2.1

2 release files

2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page