---
title: "Get a package from npm"
url: https://docs.corefinity.com/api/reference/runtime/get-node-package
type: endpoint
last_updated: 2026-11-13
feature: node-runtime
related:
  - https://docs.corefinity.com/guides/sites/software-and-services/node-js.md
  - https://docs.corefinity.com/mcp/tools/corestack_node_package_lookup.md
---
# Get a package from npm

Answers whether a package exists on the public npm registry, the version a selector resolves to, its licence,
whether it has an install script and whether it is deprecated. `exists` is null when the registry could not be
asked.

```http
GET /api/corestack/node/packages/lookup
```

- Scope: `read`
- Two-factor: required on your account (all)
- Rate limit: 60 a minute
- Try it in the console: on

## Query parameters

- `name` (string, required): The package's name on the npm registry, with its `@scope/` when it has one. Lower case, at most 214 characters; not a URL, a git address, a file or a tarball.
- `selector` (string): A version, a range written without spaces or a tag, such as `0.34`, `^1.90` or `latest`, at most 64 characters. Left out, the newest version is looked up.

## Request

### curl

```bash
curl 'https://manage.corefinity.com/api/corestack/node/packages/lookup?name=sharp' \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->get('https://manage.corefinity.com/api/corestack/node/packages/lookup?name=sharp');

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/node/packages/lookup?name=sharp', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
  },
});

// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);
```

### Python

```python
import os
import requests

res = requests.get(
    "https://manage.corefinity.com/api/corestack/node/packages/lookup?name=sharp",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
)

data = res.json() if res.content else None
```

## Responses

### 200 What the registry says about the package.

```json
{
  "deprecated": null,
  "description": "High performance image processing",
  "exists": true,
  "has_install_script": true,
  "latest": "0.34.4",
  "licence": "Apache-2.0",
  "resolved_version": "0.34.4"
}
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the scope (`scope_required`, with the `scope` to use), or your company requires two-factor authentication and you have not set it up. For routes outside Managed Clusters.

```json
{
  "code": "company_unavailable",
  "message": "Your company is unavailable.",
  "reason": "company_unavailable"
}
```

### 404 The feature is not on for your company.

```json
{
  "code": "feature_off",
  "message": "Not found.",
  "reason": "feature_off"
}
```

### 422 `name` is missing (`invalid_arguments`), or the name or selector cannot be installed from the registry (`package_spec_invalid`). For the second, `code` is not the same as `reason`: it says what is wrong, such as `spec_not_registry`, and `package` repeats what was asked.

```json
{
  "code": "invalid_arguments",
  "errors": {
    "name": [
      "Name the package to look up."
    ]
  },
  "field": "name",
  "message": "Name the package to look up.",
  "reason": "invalid_arguments"
}
```

### 429 Too many requests (`rate_limited`). Wait for the number of seconds in `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many requests. Try again in 60 seconds.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | Send a valid token as `Authorization: Bearer <token>`. |
| 403 | `company_unavailable` | Your company is unavailable. |
| 403 | `scope_required` | Use a token with the scope named in `scope`. |
| 403 | `two_factor_required` | Turn on two-factor on your account, then send again. |
| 404 | `feature_off` | This feature is not on for your organisation yet. |
| 422 | `invalid_arguments` | The arguments do not match the tool's input schema, or the Control Panel refused a field. Fix the fields named in the answer and call again. |
| 422 | `package_spec_invalid` | A package comes from the npm registry by name: no URL, git, GitHub, file, link, npm alias or workspace spec. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |

## The same task elsewhere

- Guide: [Node.js configuration](https://docs.corefinity.com/guides/sites/software-and-services/node-js.md)
- MCP tool: [`corestack_node_package_lookup`](https://docs.corefinity.com/mcp/tools/corestack_node_package_lookup.md)
