# Packagist API
> The Packagist.org registry — the package ecosystem of PHP and Composer — as an API. Look up any package (vendor/package, e.g. monolog/monolog, laravel/framework, symfony/console) for its description, type, total/monthly/daily download counts, GitHub stars, forks and open issues, number of dependents, latest stable version and its PHP requirement; search the registry by keyword and tag; and list a package's full version history (newest stable first). Live from the official Packagist API. Ideal for package dashboards, dependency and supply-chain tooling, developer portals and PHP ecosystem analytics. Open data from Packagist.org.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/packagist-api/..."
```

## Pricing
- **Free** (Free) — 3,600 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 48,600 calls/Mo, 8 req/s
- **Pro** ($12/Mo) — 238,800 calls/Mo, 20 req/s
- **Mega** ($34/Mo) — 1,197,000 calls/Mo, 50 req/s

## Endpoints

### Packagist

#### `GET /v1/package` — Full metadata for a package

**Parameters:**
- `name` (query, required, string) — vendor/package, e.g. monolog/monolog Example: `monolog/monolog`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/packagist-api/v1/package?name=monolog%2Fmonolog"
```

**Response:**
```json
{
    "data": {
        "package": {
            "name": "monolog/monolog",
            "type": "library",
            "language": "PHP",
            "downloads": {
                "daily": 326529,
                "total": 997413442,
                "monthly": 15209900
            },
            "dependents": 8335,
            "repository": "https://github.com/Seldaek/monolog",
            "suggesters": 615,
            "description": "Sends your logs to files, sockets, inboxes, databases and various web services",
            "github_forks": 1905,
            "github_stars": 21388,
            "packagist_url": "https://packagist.org/packages/monolog/monolog",
            "version_count": 99,
            "latest_license": [
                "MIT"
            ],
            "latest_version": "3.10.0",
            "github_open_issues": 29,
            "latest_requires_php": ">=8.1"
        }
    },
    "meta": {
        "timestamp": "2026-05-31T10:58:19.052Z",
        "request_id": "6d47c776-302e-45ee-af82-c39bb0795dda"
    },
    "status": "ok",
    "message": "Package retrieved",
    "success": true
}
```

#### `GET /v1/search` — Search the registry

**Parameters:**
- `q` (query, required, string) — Search term Example: `http`
- `tags` (query, optional, string) — Filter by a Composer tag
- `limit` (query, optional, string) — Results per page (1-100, default 20) Example: `20`
- `page` (query, optional, string) — Page number Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/packagist-api/v1/search?q=http&limit=20&page=1"
```

**Response:**
```json
{
    "data": {
        "page": 1,
        "count": 20,
        "limit": 20,
        "query": "http",
        "total": 11311,
        "results": [
            {
                "url": "https://packagist.org/packages/guzzlehttp/guzzle",
                "name": "guzzlehttp/guzzle",
                "favers": 24297,
                "downloads": 1026009839,
                "repository": "https://github.com/guzzle/guzzle",
                "description": "Guzzle is a PHP HTTP client library"
            },
            {
                "url": "https://packagist.org/packages/psr/http-message",
                "name": "psr/http-message",
                "favers": 7131,
                "downloads": 1063161505,
                "repository": "https://github.com/php-fig/http-message",
                "description": "Common interface for HTTP messages"
            },
            {
                "url": "https://packagist.org/packages/symfony/http-kernel",
                "name": "symfony/http-kernel",
                "favers": 8141,
                "downloads": 852919438,
                "repository": "https://github.com/symfony/http-kernel",
                "description": "Provides a structured process for converting a Request into a Response"
            },
            {
                "url": "https://packagist.org/packages/symfony/http-foundation",
                "name": "symfony/http-foundation",
                "favers": 8709,
                "downloads": 909811841,
               
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/versions` — Version history of a package

**Parameters:**
- `name` (query, required, string) — vendor/package, e.g. monolog/monolog Example: `monolog/monolog`
- `limit` (query, optional, string) — Max versions (1-300, default 50) Example: `50`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/packagist-api/v1/versions?name=monolog%2Fmonolog&limit=50"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "total": 99,
        "package": "monolog/monolog",
        "versions": [
            {
                "php": ">=8.1",
                "license": [
                    "MIT"
                ],
                "version": "3.10.0",
                "released": "2026-01-02T08:56:05+00:00",
                "normalized": "3.10.0.0"
            },
            {
                "php": ">=8.1",
                "license": [
                    "MIT"
                ],
                "version": "3.9.0",
                "released": "2025-03-24T10:02:05+00:00",
                "normalized": "3.9.0.0"
            },
            {
                "php": ">=8.1",
                "license": [
                    "MIT"
                ],
                "version": "3.8.1",
                "released": "2024-12-05T17:15:07+00:00",
                "normalized": "3.8.1.0"
            },
            {
                "php": ">=8.1",
                "license": [
                    "MIT"
                ],
                "version": "3.8.0",
                "released": "2024-11-12T13:57:08+00:00",
                "normalized": "3.8.0.0"
            },
            {
                "php": ">=8.1",
                "license": [
                    "MIT"
                ],
                "version": "3.7.0",
                "released": "2024-06-28T09:40:51+00:00",
                "normalized": "3.7.0.0"
            },
            {
                "php": ">=
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Source & endpoints

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/packagist-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Live Packagist registry data. /v1/package = full metadata (description, type, downloads, GitHub stars/forks, dependents, latest version + PHP requirement) for a vendor/package; /v1/search = search the registry; /v1/versions = the version list of a package (newest first). Package names are vendor/package, e.g. monolog/monolog.",
        "source": "Packagist.org (the PHP / Composer package registry)",
        "endpoints": [
            "/v1/package",
            "/v1/search",
            "/v1/versions",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-05-31T10:58:21.331Z",
        "request_id": "20af58ba-0f3f-4982-b543-a00f71aebb1c"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/packagist-api
OpenAPI spec: https://www.oanor.com/api/packagist-api/openapi.json
