> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drain.lat/llms.txt
> Use this file to discover all available pages before exploring further.

# NPM

> Fetch NPM package information and metadata from the Node.js package registry.

# NPM

**Base URL:** `https://drain.lat/api/v1/npm`

<AccordionGroup>
  <Accordion title="GET /package/:name" icon="box">
    Fetch NPM package information and metadata.

    ```
    GET /api/v1/npm/package/:name
    ```

    <ParamField path="name" type="string" required>
      The NPM package name to look up.
    </ParamField>

    <CodeGroup>
      ```bash cURL theme={null}
      curl "https://drain.lat/api/v1/npm/package/express" \
        -H "x-api-key: YOUR_API_KEY"
      ```

      ```javascript JavaScript theme={null}
      const res = await fetch("https://drain.lat/api/v1/npm/package/express", {
        headers: { "x-api-key": "YOUR_API_KEY" }
      });
      const data = await res.json();
      ```

      ```python Python theme={null}
      import requests

      res = requests.get(
          "https://drain.lat/api/v1/npm/package/express",
          headers={"x-api-key": "YOUR_API_KEY"}
      )
      print(res.json())
      ```
    </CodeGroup>

    <ResponseField name="name" type="string">Package name.</ResponseField>
    <ResponseField name="version" type="string">Latest version.</ResponseField>
    <ResponseField name="description" type="string">Package description.</ResponseField>
    <ResponseField name="author" type="string">Package author.</ResponseField>
    <ResponseField name="license" type="string">License type.</ResponseField>
    <ResponseField name="homepage" type="string">Package homepage URL.</ResponseField>
    <ResponseField name="repository" type="string">Repository URL.</ResponseField>
    <ResponseField name="keywords" type="array">Package keywords.</ResponseField>
    <ResponseField name="dependencies" type="number">Number of dependencies.</ResponseField>
    <ResponseField name="createdAt" type="string">Package creation date (ISO 8601).</ResponseField>
    <ResponseField name="modifiedAt" type="string">Last modification date.</ResponseField>
    <ResponseField name="lastPublish" type="string">Last publish date.</ResponseField>
    <ResponseField name="versions" type="number">Total number of versions.</ResponseField>
    <ResponseField name="npmUrl" type="string">Link to the NPM package page.</ResponseField>

    ```json Response theme={null}
    {
      "name": "express",
      "version": "4.18.2",
      "description": "Fast, unopinionated, minimalist web framework",
      "author": "TJ Holowaychuk",
      "license": "MIT",
      "homepage": "http://expressjs.com/",
      "repository": "https://github.com/expressjs/express",
      "keywords": ["express", "framework", "web", "rest", "api"],
      "dependencies": 30,
      "createdAt": "2010-01-03T00:00:00Z",
      "modifiedAt": "2023-12-01T00:00:00Z",
      "lastPublish": "2023-12-01T00:00:00Z",
      "versions": 278,
      "npmUrl": "https://www.npmjs.com/package/express",
      "scrapedAt": "2026-05-31T00:00:00Z"
    }
    ```
  </Accordion>
</AccordionGroup>
