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.
| Parameter | Type | Required | Allowed values |
|---|---|---|---|
query | string | Required | Up to 200 characters Words to match in the package name or description. |
type | string | Optional | Up to 60 characters Package type, for example library, symfony-bundle or wordpress-plugin. |
page | integer | Optional | Any Results page, from 1. |
per_page | integer | Optional | Any 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.
| Field | Type |
|---|---|
name | string |
description | string |
downloads | integer |
favers | integer |
repository | url |
abandoned | boolean |
url | url |