# Scryfall API

> Magic: The Gathering cards and search from Scryfall's public card and search pages.

Category: Sports & Gaming. Region: Global. 2 endpoints at `https://api.hoshime.com/v1/scryfall/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/scryfall
## GET /v1/scryfall/card

One Magic: The Gathering card print: mana cost, type, rules text, artist, set, rarity, prices and format legalities.

Scope: `social:read` · Units: 1 · Cached: 360 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Set code and collector number such as lea/161, or a scryfall.com/card URL. (e.g. lea/161) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `artist` (string), `id` (string), `imageUrl` (string), `legalities` (map), `manaCost` (string), `name` (string), `number` (string), `oracleText` (string), `prices` (Money[]), `prices[].amount` (string), `prices[].currency` (string), `rarity` (string), `setCode` (string), `setName` (string), `stats` (string), `typeLine` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/scryfall/card?id=lea%2F161" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/scryfall/search

Search Magic: The Gathering cards with Scryfall syntax (name, t:goblin, c:red cmc<=2, …); one card per name, 60 per page.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Scryfall search syntax, such as lightning bolt or t:goblin c:r. (e.g. lightning bolt) |
| `order` | string | no | Sort order. (one of name, released, cmc, usd; default name) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `imageUrl` (string), `name` (string), `number` (string), `setCode` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/scryfall/search?query=lightning+bolt" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
