# Themes

> The public theme directory, open to anyone with no token.

Source: https://storeware.ai/docs/api-reference/rest/themes

## Search the public theme directory

`GET /api/v1/public/themes`

Listed themes only, with no token. `best`, the default, ranks by a Bayesian rating score and then by the shops wearing a theme; nothing in the order is paid for.

Open to anyone: it needs no token and no permission.

**Parameters**

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `q` | query | string | Words to search names, taglines, authors and descriptions. |
| `design` | query | string | Only themes written over this Storeware design. |
| `sort` | query | string | One of `best`, `relevance`, `popular`, `newest`, `name`. |
| `limit` | query | integer | From 1 to 60. |
| `offset` | query | integer | At least 0. |

**Answers** `200`

| Field | Type | Description |
| --- | --- | --- |
| `data` | object |  |
| `data.themes` | array of [PublicThemeCard](https://storeware.ai/docs/api-reference/rest/objects#publicthemecard) |  |
| `data.total` | integer |  |

```bash
curl "https://api.storeware.ai/api/v1/public/themes" \
  -H "Authorization: Bearer $TOKEN"
```

## Count the listed themes over each design

`GET /api/v1/public/themes/designs`

Open to anyone: it needs no token and no permission.

**Answers** `200`

| Field | Type | Description |
| --- | --- | --- |
| `data` | array of object |  |
| `data[].design` | string |  |
| `data[].themes` | integer |  |

```bash
curl "https://api.storeware.ai/api/v1/public/themes/designs" \
  -H "Authorization: Bearer $TOKEN"
```

## Get a listed theme

`GET /api/v1/public/themes/{slug}`

What the listing shows, every preview, its price in each currency, what its ratings add up to and the newest ten.

Open to anyone: it needs no token and no permission.

**Parameters**

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `slug` | path | string | The slug. |

**Answers** `200`

| Field | Type | Description |
| --- | --- | --- |
| `data` | object |  |
| `data.slug` | string |  |
| `data.name` | string |  |
| `data.tagline` | string or null |  |
| `data.authorName` | string |  |
| `data.design` | string | The Storeware design the theme is written over, `base` for the plain one. |
| `data.version` | integer | The newest version, which an install takes. |
| `data.listedAt` | string (date-time) or null |  |
| `data.updatedAt` | string (date-time) or null |  |
| `data.shopsUsing` | integer | Merchant shops wearing it live now. |
| `data.rating` | object |  |
| `data.rating.average` | number or null | Average stars to one decimal, or null with none. |
| `data.rating.count` | integer | Published ratings from shops still open. |
| `data.prices` | object or null | What one shop pays, once, in minor units of each currency, every later version included. Null is free. |
| `data.prices.usd` | integer |  |
| `data.prices.gbp` | integer |  |
| `data.prices.eur` | integer |  |
| `data.prices.inr` | integer |  |
| `data.previews` | array of object |  |
| `data.previews[].url` | string |  |
| `data.previews[].width` | integer |  |
| `data.previews[].height` | integer |  |
| `data.previews[].alt` | string or null |  |
| `data.description` | string or null |  |
| `data.homepageUrl` | string or null |  |
| `data.releaseNote` | string or null | What changed in the newest version. |
| `data.ratings` | object |  |
| `data.ratings.summary` | object |  |
| `data.ratings.summary.average` | number or null |  |
| `data.ratings.summary.count` | integer |  |
| `data.ratings.summary.distribution` | array of integer | How many ratings gave 5, 4, 3, 2 and 1 stars, in that order. Up to 5 items. At least 5 items. |
| `data.ratings.recent` | array of [PublicAppRating](https://storeware.ai/docs/api-reference/rest/objects#publicapprating) |  |

```bash
curl "https://api.storeware.ai/api/v1/public/themes/$SLUG" \
  -H "Authorization: Bearer $TOKEN"
```

## List a listed theme’s ratings

`GET /api/v1/public/themes/{slug}/ratings`

Newest first. Only ratings that count: published, from merchant shops that installed the theme at least three days before and are still open.

Open to anyone: it needs no token and no permission.

**Parameters**

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `slug` | path | string | The slug. |
| `limit` | query | integer | From 1 to 50. |
| `offset` | query | integer | At least 0. |

**Answers** `200`

| Field | Type | Description |
| --- | --- | --- |
| `data` | object |  |
| `data.summary` | object |  |
| `data.summary.average` | number or null |  |
| `data.summary.count` | integer |  |
| `data.summary.distribution` | array of integer | How many ratings gave 5, 4, 3, 2 and 1 stars, in that order. Up to 5 items. At least 5 items. |
| `data.ratings` | array of [PublicAppRating](https://storeware.ai/docs/api-reference/rest/objects#publicapprating) |  |

```bash
curl "https://api.storeware.ai/api/v1/public/themes/$SLUG/ratings" \
  -H "Authorization: Bearer $TOKEN"
```
