Random Links and Buttons

You can create a link to a random Scryfall card using:

https://scryfall.com/random

This URL accepts a search parameter q, which is the same as anything you can
enter into the search system. This lets you
fetch a random card with a specific criteria. Examples:

Button

Scryfall provides a hosted button that you can use on your own websites or blogs:

Use the following HTML snippet. Replace {filter} with a URL-encoded version of your
search criteria.

<a href="https://scryfall.com/random?q={filter}">
  <img title="Random card" alt="Random card" src="https://img.scryfall.com/share/random.svg" width="192" height="42"/>
</a>

Produces:

Random card on Scryfall