# Package Name Validator & Normalizer

> Package Name Validator & Normalizer is a paid API for AI agents from fittings.sh, paid per call via x402, $0.004/call, status unknown (last checked 2026-10-11).

Checks a proposed package name against npm, PyPI, or crates.io naming rules and returns the canonical normalized form used by that registry.

## Facts

- Endpoint: GET https://fittings.sh/v1/pkg/name-check?utm_source=zero.xyz
- Price: $0.004/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/package-name-validator-normalizer-32199db4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XHDa5yuEjK1Sr55NIrt22

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability package-name-validator-normalizer-32199db4
```

Example prompt: Before I publish my new library, can you check whether the name 'my-awesome-lib' is valid for npm and tell me its normalized form?

## When to prefer this

Use this endpoint when you need to programmatically verify package names before publishing or registering packages on npm, PyPI, or crates.io — especially in CI pipelines, publishing automation, or when building tooling that needs to know the canonical comparison key a registry uses. Prefer this over manual regex checks because it encodes each registry's exact current rules (npm scoping and URL-safety, PEP 503 normalization, cargo grammar) in one call.

## Known failure modes

- Name exceeds 300 characters — request rejected
- Invalid registry value provided — defaults to npm or returns error
- Name contains characters that cannot be normalized — validation fails with reason
- Missing required 'name' query parameter — returns 400 error

## How this service works

Checks a proposed package name against a registry’s own naming rules (npm scoping and URL-safety, PEP 503 normalization for PyPI, cargo’s crate name grammar) and returns the normalized form the registry compares by.

## Output

Returns whether the proposed package name is valid under the selected registry's naming rules, along with the normalized/canonical form that the registry compares by (e.g. lowercased, hyphen-normalized per PEP 503 for PyPI; scoped and URL-safe for npm; identifier-grammar-compliant for crates.io).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "name"
     ],
     "properties": {
      "name": {
       "type": "string",
       "description": "Proposed package name, at most 300 characters"
      },
      "registry": {
       "type": "string",
       "description": "One of npm, pypi, crates, default npm"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/package-name-validator-normalizer-32199db4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fittings.sh](https://www.zero.xyz/host/fittings.sh/llms.txt)
