APIs / Packagist / Search packages

Packagist: Search packages

PHP packages on Packagist matching a query, with downloads and favourites.

GET /v1/packagist/search

Parameters

Send parameters in the query string.

ParameterTypeRequiredAllowed values
querystringRequiredUp to 200 characters
Words to match in the package name or description.
typestringOptionalUp to 60 characters
Package type, for example library, symfony-bundle or wordpress-plugin.
pageintegerOptionalAny
Results page, from 1.
per_pageintegerOptionalAny
Results per page, 1 to 100. Default 15.

Example request

Packagist
GET/v1/packagist/search?query=laravel&per_page=10
{
  "success": true,
  "data": {
    "total": 100277,
    "page": 1,
    "has_more": true,
    "count": 10,
    "items": [
      {
        "name": "laravel/framework",
        "description": "The Laravel Framework.",
        "downloads": 639185601,
        "favers": 35779,
        "repository": "https://github.com/laravel/framework",
        "abandoned": false,
        "url": "https://packagist.org/packages/laravel/framework"
      },
      {
        "name": "spatie/laravel-permission",
        "description": "Permission handling for Laravel 12 and up",
        "downloads": 140288066,
        "favers": 13165,
        "repository": "https://github.com/spatie/laravel-permission",
        "abandoned": false,
        "url": "https://packagist.org/packages/spatie/laravel-permission"
      },
      {
        "name": "spatie/laravel-activitylog",
        "description": "A very simple activity logger to monitor the users of your website or application",
        "downloads": 75371457,
        "favers": 5995,
        "repository": "https://github.com/spatie/laravel-activitylog",
        "abandoned": false,
        "url": "https://packagist.org/packages/spatie/laravel-activitylog"
      }
    ]
  },
  "meta": {
    "request_id": "req_b00d327c410a4217a909e6939dd2c221",
    "credits_charged": 1,
    "credits_remaining": 1995
  }
}
200 OKJSONX-Credits-Used: 1
Recorded from our API and shortened.

Run this endpoint in the playground with your own parameters. 1 credit per successful call; failed calls are free.

Response fields

Each item in data.items has these 7 fields, read from a recorded call. The recording leaves out fields that were empty, so a live call can return more.

FieldType
namestring
descriptionstring
downloadsinteger
faversinteger
repositoryurl
abandonedboolean
urlurl