> ## 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.

# Packagist

> Fetch PHP package information from Packagist, the Composer package registry.

# Packagist

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

<AccordionGroup>
  <Accordion title="GET /package/:vendor/:name" icon="box">
    Fetch PHP package information from Packagist/Composer.

    ```
    GET /api/v1/packagist/package/:vendor/:name
    ```

    <ParamField path="vendor" type="string" required>
      The package vendor name.
    </ParamField>

    <ParamField path="name" type="string" required>
      The package name.
    </ParamField>

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

      ```javascript JavaScript theme={null}
      const res = await fetch("https://drain.lat/api/v1/packagist/package/symfony/console", {
        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/packagist/package/symfony/console",
          headers={"x-api-key": "YOUR_API_KEY"}
      )
      print(res.json())
      ```
    </CodeGroup>

    <ResponseField name="name" type="string">Package name (vendor/package).</ResponseField>
    <ResponseField name="description" type="string">Package description.</ResponseField>
    <ResponseField name="type" type="string">Package type (e.g. `library`).</ResponseField>
    <ResponseField name="repository" type="string">Repository URL.</ResponseField>
    <ResponseField name="homepage" type="string">Homepage URL.</ResponseField>
    <ResponseField name="keywords" type="array">Package keywords.</ResponseField>
    <ResponseField name="license" type="array">License types.</ResponseField>

    <ResponseField name="authors" type="array">
      <Expandable title="author object">
        <ResponseField name="name" type="string">Author name.</ResponseField>
        <ResponseField name="email" type="string">Author email.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="downloads" type="number">Total downloads.</ResponseField>
    <ResponseField name="monthlyDownloads" type="number">Downloads in the last month.</ResponseField>
    <ResponseField name="dailyDownloads" type="number">Downloads in the last day.</ResponseField>
    <ResponseField name="favers" type="number">Number of users who favorited the package.</ResponseField>
    <ResponseField name="versions" type="number">Total number of versions.</ResponseField>
    <ResponseField name="time" type="string">Last update time (ISO 8601).</ResponseField>
    <ResponseField name="packagistUrl" type="string">Link to the Packagist page.</ResponseField>

    ```json Response theme={null}
    {
      "name": "symfony/console",
      "description": "Eases the creation of beautiful and testable command line interfaces",
      "type": "library",
      "repository": "https://github.com/symfony/console",
      "homepage": "https://symfony.com",
      "keywords": ["console", "cli", "command"],
      "license": ["MIT"],
      "authors": [
        {
          "name": "Fabien Potencier",
          "email": "fabien@symfony.com"
        }
      ],
      "downloads": 1500000000,
      "monthlyDownloads": 50000000,
      "dailyDownloads": 2000000,
      "favers": 12000,
      "versions": 250,
      "time": "2024-01-15T00:00:00Z",
      "packagistUrl": "https://packagist.org/packages/symfony/console",
      "scrapedAt": "2026-05-31T00:00:00Z"
    }
    ```
  </Accordion>
</AccordionGroup>
