---
title: "Get script lib"
method: GET
path: "/api/scripts/{handle}/{host}/lib"
---

# Get script lib

`GET /api/scripts/{handle}/{host}/lib`

## Request

- Base URL: `https://reduck.ai`
- URL: `https://reduck.ai/api/scripts/{handle}/{host}/lib`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Read a host's lib: the JavaScript an owner's scripts import as `lib:<host>`, from any host. Returns its latest version (the one every import loads) with its code, and the owner's scripts that import it. Readable by whoever can read the owner's scripts on the host; an official owner's source is limited to its members.

## Path parameters

- `handle` string, required: The owner a resource is addressed under: "@username" for a personal scope, or a bare slug for a project.
- `host` string, required: The site whose lib it is; scripts import it as `lib:<host>`.

## Response `200`

OK

- ScriptLib
  - `host` string, required
  - `latest_version` ScriptLibVersion, required
    - `version_number` number, required
    - `note` string, nullable, required
    - `created_at` string, required
    - `latest` boolean, required
    - `content` string, required
  - `dependents` ScriptLibDependent[], required
    - `script` string, required
    - `version_id` string, required
    - `draft` boolean, required

## Other responses

- `401`: Not authenticated
- `403`: Forbidden
- `404`: Not found

---

[API](https://skmtc.dev/reduck/apis/reduck-api.md) · [All operations](https://skmtc.dev/reduck/apis/reduck-api/llms.txt) · [OpenAPI document](https://skmtc.dev/reduck/apis/reduck-api/revisions/a573b91206d6?raw)
