Skip to content
MTGJSONv4 build scripts for Magic: the Gathering
Branch: master
Clone or download
ZeldaZach Add translations (#284)
Signed-off-by: Zach Halpern <>
Latest commit 78146d2 Mar 19, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
mtgjson4 Add translations (#284) Mar 19, 2019
tests Use (ScryfallId, Name) to identify the card face (#245) Feb 2, 2019
.pre-commit-config.yaml Configure travis and pre-commit to test, lint, and check. Oct 24, 2018
.travis.yml Use (ScryfallId, Name) to identify the card face (#245) Feb 2, 2019
mypy.ini mypy 3.7 Sep 20, 2018
setup.cfg Use (ScryfallId, Name) to identify the card face (#245) Feb 2, 2019
tox.ini added caching using requests-cache library (#282) Mar 19, 2019


changelog Current Release Date

MTGJSON is an open sourced database creation and distribution tool for Magic: The Gathering cards, specifically in JSON format.  

Connect With Us

Discord Discord

Gitter Gitter

About Us

This repo contains our newest release, version 4.x. This version relies upon a variety of sources, such as Scryfall and Gatherer for our data.

You can find our documentation with all properties here.

To provide feedback 💁 and/or bug reports 🐛, please open a ticket 🎫 as it is the best way for us to communicate with the public.

If you would like to join or assist the development of the project, you can join us on Discord to discuss things further.

Looking for a full digest of pre-built data? Click here.



  • Python 3.7
  • pip3
    • Installed with Python 3.7. For troubleshooting check here.



Install the MTGJSON4 package and dependencies via:

pip3 install -r requirements.txt


Output Flags

Flags Flag Descriptions
-h, --help Print the help menu and exits.
-a Build all sets. This overshadows the -s flag.
-c After building any/all sets, create the compiled outputs (ex: AllSets, AllCards).
-x Skips sets that have already been built (i.e. set files in the output folder), and build the remaining sets. Must be passed with -a or -s.
-s SET [SET ...] Build set code arguments, provided they exist.
--skip-sets SET [SET ...] Prevents set code arguments from being built, even if passed in via -a or -s.
--skip-tcgplayer If you don't have a TCGPlayer API key, you can disable building of TCGPlayer components.
--skip-prune If you'd rather keep null/false fields and not trim the output.

  Newcomer Note: Omitting either the -a and -s flag will yield empty outputted data.  



Run the program, with any flag(s) you'd like, via:

python3 -m mtgjson4 [-h] [-acx] [-s [SET [SET ...]]] [--skip-tcgplayer] [--skip-prune] [--skip-sets [SET [SET ...]]]


$ python3 -m mtgjson4 -ac

> all outputted json files


  These are the build directions to compile your own JSON files but If you are looking for pre-compiled JSON files, you can download them at  

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.