# Registry

Reference for the Registry operations of the Spice Cloud Management API: list published packages and get the contents of a published package.

OpenAPI: [api.spice.ai/openapi.json](https://api.spice.ai/openapi.json)

- [`GET /v1/registry/packages`: List published packages](https://spice.ai/docs/cloud/api/management/registry/get-v1-registry-packages)
- [`GET /v1/registry/packages/{orgName}/{packageName}/contents`: Get the contents of a published package](https://spice.ai/docs/cloud/api/management/registry/get-v1-registry-packages-orgname-packagename-contents)

## List published packages

`GET /v1/registry/packages`

Returns every published package: a public project connected to a public GitHub repository. Needs no authentication. spicerack.org renders this data. Responses can be up to 5 minutes old.

### Example request

```bash
curl "https://api.spice.ai/v1/registry/packages"
```

```http
GET /v1/registry/packages HTTP/1.1
Host: api.spice.ai
```

### Responses

**200 OK**

Every published package

Content type: `application/json`

- `packages` (array of object, required)
  - `id` (integer, required)
  - `org` (string, required): Name of the org that publishes the package
  - `name` (string, required)
  - `description` (string | null, required)
  - `likes` (integer, required): Minimum: `0`.
  - `created_at` (string (date-time) | null, required)
  - `repository` (object | null, required): The public GitHub repository. Null until GitHub confirms that it is public, for example while GitHub cannot be read.
    - `id` (string, required): Numeric GitHub repository id or `owner/repo` name
    - `path` (string | null, required): Directory that holds the spicepod. Null is the repository root.
    - `branch` (string | null, required)
    - `github` (object, required)
      - `owner` (string, required)
      - `repo` (string, required)

**503 Service Unavailable**

The registry could not be loaded. Try again later.

## Get the contents of a published package

`GET /v1/registry/packages/{orgName}/{packageName}/contents`

Returns the manifest, README, and GitHub facts of a published package, read from its public repository. Needs no authentication. The org and name match without regard to case. A part that GitHub cannot return is null, and the manifest then carries an error.

### Path parameters

- `orgName` (string, required)
- `packageName` (string, required)

### Example request

```bash
curl "https://api.spice.ai/v1/registry/packages/<orgName>/<packageName>/contents"
```

```http
GET /v1/registry/packages/<orgName>/<packageName>/contents HTTP/1.1
Host: api.spice.ai
```

### Responses

**200 OK**

The package contents

Content type: `application/json`

- `manifest` (object, required)
  - `yaml` (string | null, required): The raw spicepod.yaml
  - `path` (string | null, required): Repository-relative path of the manifest
  - `error` (string | null, required): Why the manifest is missing
- `readme` (string | null, required): The README as Markdown
- `repository` (object | null, required)
  - `html_url` (string, required)
  - `description` (string | null, required)
  - `homepage` (string | null, required)
  - `stars` (integer, required)
  - `forks` (integer, required)
  - `open_issues` (integer, required)
  - `topics` (array of string, required)
  - `license` (object | null, required)
    - `key` (string, required)
    - `name` (string, required)
    - `url` (string | null, required)
  - `default_branch` (string, required)
  - `pushed_at` (string (date-time) | null, required)
  - `updated_at` (string (date-time) | null, required)

**404 Not Found**

No published package has this org and name.

**503 Service Unavailable**

The registry could not be loaded. Try again later.
