# Deck of Cards API

> Creates new or shuffled playing card decks, optionally with jokers, and draws cards from a shuffled deck.

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

Shuffles a new 52-card deck and draws cards from it.

Scope: `social:read` · Units: 1

| Parameter | Type | Required | Description |
|---|---|---|---|
| `cardCount` | integer | no | Cards to draw, from 1 to 52. (default 5; e.g. 2) |
| `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: `cards` (Card[]), `cards[].code` (string), `cards[].image` (string), `cards[].suit` (string), `cards[].value` (string), `deckId` (string), `remaining` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/deckofcards/draw?cardCount=2" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/deckofcards/newDeck

Creates an unshuffled 52-card deck and returns its id.

Scope: `social:read` · Units: 1

| Parameter | Type | Required | Description |
|---|---|---|---|
| `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: `deckId` (string), `remaining` (integer (int64)), `shuffled` (boolean)

```bash
curl "https://api.hoshime.com/v1/deckofcards/newDeck" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/deckofcards/shuffledDeck

Creates one or more shuffled decks, optionally with the jokers, and returns the id.

Scope: `social:read` · Units: 1

| Parameter | Type | Required | Description |
|---|---|---|---|
| `decks` | integer | no | Number of 52-card decks in the shoe, from 1 to 5. (default 1; e.g. 1) |
| `jokers` | boolean | no | Add the two jokers to each deck. |
| `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: `deckId` (string), `remaining` (integer (int64)), `shuffled` (boolean)

```bash
curl "https://api.hoshime.com/v1/deckofcards/shuffledDeck?decks=1" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
