# npm, PyPI & crates.io Metadata API

Get npm, PyPI or crates.io package metadata via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Treg, pass parameters such as ecosystem, name, and retrieve structured data including registry package name, returned version metadata, repository link, when provided, and publication timestamp to maintain a package inventory, prepare dependency research, and track release metadata.

Documentation: https://openany.si/package-registries/get-npm-pypi-or-crates-io-package-metadata/
API ID: 3f2f652e-08c8-44df-8bd3-028ccbd6795d
Provider: treg
Contract revision: 4
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/treg/call/crawl4ai.packages.package.info
Page update time: 2026-12-03T01:54:37.424Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: application/json
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.00015 / call
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T01:54:37.424Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "150",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## npm, PyPI & crates.io Metadata API

Send a package name with ecosystem set to npm, pypi or crates. The response contains one metadata row with version, publication, license and repository fields; downloads are available for crates.io.

## What You Can Build with the npm, PyPI & crates.io Metadata API

- **Maintain a package inventory**: Resolve registry names to versions and source links.
- **Prepare dependency research**: Compare metadata before opening the full repository or registry page.
- **Track release metadata**: Save dated snapshots and compare the returned version and publication fields.

Pass returned records to a downstream Agent for organization, comparison or reporting; additional data retrieval is a separate operation.

## npm, PyPI & crates.io Metadata API Returned Data Fields & Response Coverage

The result is a package metadata row, not a dependency tree, vulnerability scan or license-compliance decision. downloads is documented for crates.io only; other fields may be null.

| Field | Meaning |
| --- | --- |
| `rows[].name` | Registry package name |
| `rows[].version` | Returned version metadata |
| `rows[].license` | License metadata, not a compliance verdict |
| `rows[].repository` | Repository link, when provided |
| `rows[].published` | Publication timestamp |
| `rows[].dependencies` | Dependency count, not dependency details |

## Quick Start: Call the npm, PyPI & crates.io Metadata API via REST

1. Configure OPENANY\_API\_KEY securely in your local environment and select TREG.
2. The example looks up requests in the pypi ecosystem; set ecosystem explicitly for another registry.
3. Check Selected price before running the command; execution sends a real request under the current contract.

```
curl --request POST \
  "https://api.openany.si/v1/agent-apis/treg/call/crawl4ai.packages.package.info" \
  --header "Authorization: Bearer ${OPENANY_API_KEY}" \
  --header 'Content-Type: application/json' \
  --data '{"ecosystem":"pypi","name":"requests"}'
```

## Understanding Response Examples

| Example | Provenance and scope |
| --- | --- |
| Third-party reference · Testnet excerpt | Excerpt of a historical third-party testnet response, showing fields and structure. |

Use the documented request as a calling template; consult the [public API contract](https://openany.si/api/v1/agent-apis/3f2f652e-08c8-44df-8bd3-028ccbd6795d) and the actual response for fields and status.

## Connect AI Agents via OpenAny MCP

Connect to https://mcp.openany.si, discover with search\_apis, then read the current contract and api\_version with get\_api. Use run\_api only after approval of inputs, price and call count; keep the key in secure client configuration.

**Agent prompt:** Look up the requests package in the pypi ecosystem. Inspect the TREG contract and current cost and request execution approval, then return version, source link, license metadata, repository and dependency count while preserving null values.

## Pricing & Billing Rules

- No subscription; check the selected implementation’s contract and Selected price for the current amount and unit.
- Browsing, preparing inputs and viewing examples do not execute the API; curl and run\_api do.
- Extra pages, retries and chained requests are separate executions; review their billing and spending limit first.

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "npm, PyPI & crates.io Metadata API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {}
    },
    "headers": {
      "type": "object",
      "properties": {}
    },
    "body": {
      "additionalProperties": false,
      "properties": {
        "ecosystem": {
          "description": "default npm",
          "enum": [
            "npm",
            "pypi",
            "crates"
          ],
          "type": "string"
        },
        "name": {
          "description": "",
          "example": "requests",
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object",
      "description": "One row of facts about a package from its registry's public JSON: latest version and when it was published, description, license, homepage, repository, downloads (crates.io only) and the number of dependencies. `ecosystem` is npm, pypi or crates; `name` is the package.\nUsage limits: Supports npm, pypi and crates. Downloads are available for crates.io only. License metadata is not a license-compliance assessment.\nDraft retail price: USD 0.000150/successful call, equal to the TREG catalog rate; no markup."
    }
  },
  "required": [
    "path",
    "query",
    "headers",
    "body"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "meta": {
      "type": "object",
      "properties": {
        "blocked": {
          "type": "array",
          "items": {}
        },
        "elapsed_ms": {
          "type": "integer"
        },
        "from_cache": {
          "type": "boolean"
        },
        "llm_calls": {
          "type": "integer"
        },
        "pages_fetched": {
          "type": "integer"
        },
        "partial": {
          "type": "boolean"
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "recipe": {
      "type": "string"
    },
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "dependencies": {
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "downloads": {
            "type": "null"
          },
          "ecosystem": {
            "type": "string"
          },
          "homepage": {
            "type": "null"
          },
          "license": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "published": {
            "type": "string"
          },
          "repository": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      }
    },
    "usage": {
      "type": "object",
      "properties": {
        "boxes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "cache": {
          "type": "string"
        },
        "engine": {
          "type": "string"
        },
        "lines": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "about": {
                "type": "string"
              },
              "boxes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "cache": {
                "type": "string"
              },
              "call": {
                "type": "string"
              },
              "engine": {
                "type": "string"
              },
              "units": {
                "type": "integer"
              }
            }
          }
        },
        "units": {
          "type": "integer"
        }
      }
    },
    "version": {
      "type": "integer"
    }
  }
}
```

## Request example
Scenario: Third-party reference · Testnet 2026-11-04: success (abridged)
```bash
curl \
  'https://api.openany.si/v1/agent-apis/treg/call/crawl4ai.packages.package.info' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "ecosystem": "pypi",
  "name": "requests"
}'
```

## Response example
Historical third-party reference. It may differ from the current provider response; verify the original contract before use.
Third-party response reference · Documented HTTP 200
```json
{
  "meta": {
    "blocked": [],
    "elapsed_ms": 0,
    "from_cache": true,
    "llm_calls": 0,
    "pages_fetched": 0,
    "partial": false,
    "warnings": [
      "module: package-info: pypi requests → \"2.34.2\""
    ]
  },
  "recipe": "package-info",
  "rows": [
    {
      "dependencies": 6,
      "description": "Python HTTP for Humans.",
      "downloads": null,
      "ecosystem": "pypi",
      "homepage": null,
      "license": "Apache-2.0",
      "name": "requests",
      "published": "2026-05-14T19:25:26.443000Z",
      "repository": "https://github.com/psf/requests",
      "url": "https://pypi.org/project/requests/",
      "version": "2.34.2"
    }
  ],
  "usage": {
    "boxes": [
      "gate"
    ],
    "cache": "hit",
    "engine": "recipe",
    "lines": [
      {
        "about": "the call",
        "boxes": [
          "gate"
        ],
        "cache": "miss",
        "call": "recipes",
        "engine": "gate",
        "units": 1
      }
    ],
    "units": 1
  },
  "version": 1
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Do I need registry credentials or a subscription?
The published input requires no npm, PyPI or crates.io credentials. Use your OpenAny key with per-call billing and no subscription.

### Which ecosystem values are accepted?
npm, pypi and crates. The API uses crates as its input value even though the source service is named crates.io.

### Can I retrieve download counts for npm and PyPI too?
Not under this contract. Download coverage is documented for crates.io only, and the PyPI sample has downloads: null.

### Is license a legal compatibility decision?
No. It is source metadata. Review the actual license and your intended use separately rather than treating a string as a compliance decision.

### Does dependencies contain a complete dependency graph?
No. The documented value is a count, not dependency names, versions or a transitive graph.

### Can I ask for an arbitrary historical version?
No version selector is exposed by this wrapper. Do not add native registry version parameters unless a separately published contract supports them.

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
