Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23276

selecting colors on a Scryfall API call

$
0
0

I'm working on a simple project using python and PyQt6 that allows the user to select which colors they want for an MTG commander, and then using the Scryfall API, return a random commander that is in that color identity. I have read through the docs for both the API and regular scryfall, and have gotten to a point where I just don't understand what is happening anymore.Im using the https://api.scryfall.com/cards/random?q=is%3Acommander as a base link and adding extra on to it.

At first I thought I would just be able to do +c%3A{color} in a chain for all of the selected colors, but that just requires those colors to be on the card, and sometimes it gets a card with colors outside of the ones I had specified. Then I tried a chain of that with - instead of +, but that just breaks it.Eventually I wound up with this: '-id:wg%20+id:br%20-id:c' but it only gets black cards, not black and red cards. I also tried '-id:wgu%20+id:br%20-id:c' because I realized that I forgot blue, but then it just returns a 404.

Is there a page in the docs that I'm not finding that explains how to search for only specific colors, or how do I make a call for specific color identities and not include any of the other ones in the search?


Viewing all articles
Browse latest Browse all 23276

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>