From 2cc0a12b3e52f164d192185757ea5d6904685231 Mon Sep 17 00:00:00 2001
From: Vladimir Tsykun Working example: Working example: Working example: Working example: Working example: Working example: Search results are paginated and you can change the pagination step by using the per_page parameter. For example Working example: Working example: Working example: {{ 'api_doc.listing_names'|trans }}
{{ 'api_doc.all_packages'|trans }}
-GET https://{{ packagist_host }}/packages/list.json
+GET https://{{ packagist_host }}/packages/list.json?token={{ apiToken }}
-
{
"packageNames": [
@@ -35,11 +35,11 @@ GET https://{{ packagist_host }}/packages/list.json
]
}
https://{{ packagist_host }}/packages/list.json
https://{{ packagist_host }}/packages/list.json?token={{ apiToken }}
{{ 'api_doc.list_by_organization'|trans }}
-GET https://{{ packagist_host }}/packages/list.json?vendor=[vendor]
+GET https://{{ packagist_host }}/packages/list.json?vendor=[vendor]&token={{ apiToken }}
-
{
"packageNames": [
@@ -48,11 +48,11 @@ GET https://{{ packagist_host }}/packages/list.json?vendor=[vendor]
]
}
https://{{ packagist_host }}/packages/list.json?vendor=composer
https://{{ packagist_host }}/packages/list.json?vendor=composer&token={{ apiToken }}
{{ 'api_doc.list_by_type'|trans }}
-GET https://{{ packagist_host }}/packages/list.json?type=[type]
+GET https://{{ packagist_host }}/packages/list.json?type=[type]&token={{ apiToken }}
-
{
"packageNames": [
@@ -61,83 +61,11 @@ GET https://{{ packagist_host }}/packages/list.json?type=[type]
]
}
https://{{ packagist_host }}/packages/list.json?type=composer-plugin
https://{{ packagist_host }}/packages/list.json?type=composer-plugin&token={{ apiToken }}
{{ 'api_doc.searching'|trans }}
-
-https://{{ packagist_host }}/search.json?q=[query]&per_page=5
{{ 'api_doc.search_by_name'|trans }}
-
-GET https://{{ packagist_host }}/search.json?q=[query]
-
-
-{
- "results" : [
- {
- "name": "[vendor]/[package]",
- "description": "[description]",
- "url": "https://{{ packagist_host }}/packages/[vendor]/[package]",
- "repository": [repository url],
- "downloads": [number of downloads],
- "favers": [number of favers]
- },
- ...
- ],
- "total": [number of results],
- "next": "https://{{ packagist_host }}/search.json?q=[query]&page=[next page number]"
-}
-
https://{{ packagist_host }}/search.json?q=monolog
{{ 'api_doc.search_by_tag'|trans }}
-
-GET https://{{ packagist_host }}/search.json?tags=[tag]
-
-
-{
- "results": [
- {
- "name": "[vendor]/[package]",
- "description": "[description]",
- "url": "https://{{ packagist_host }}/packages/[vendor]/[package]",
- "repository": "[repository url]",
- "downloads": [number of downloads],
- "favers": [number of favers]
- }
- ...
- ],
- "total": [numbers of results]
-}
-
https://{{ packagist_host }}/search.json?q=monolog&tags=psr-3
{{ 'api_doc.search_by_type'|trans }}
-
-GET https://{{ packagist_host }}/search.json?q=[query]&type=symfony-bundle
-
-
-{
- "results" : [
- {
- "name": "[vendor]/[package]",
- "description": "[description]",
- "url": "https://{{ packagist_host }}/packages/[vendor]/[package]",
- "repository": [repository url],
- "downloads": [number of downloads],
- "favers": [number of favers]
- },
- ...
- ],
- "total": [number of results],
- "next": "https://{{ packagist_host }}/search.json?q=[query]&page=[next page number]"
-}
-
https://{{ packagist_host }}/search.json?q=monolog&type=symfony-bundle
{{ 'api_doc.get_package_data'|trans }}
@@ -156,7 +84,7 @@ GET https://{{ packagist_host }}/search.json?q=[query]&type=symfony-bundle
-GET https://{{ packagist_host }}/p/[vendor]/[package].json
+GET https://{{ packagist_host }}/p/[vendor]/[package].json?token={{ apiToken }}
{
"packages": {
@@ -174,14 +102,14 @@ GET https://{{ packagist_host }}/p/[vendor]/[package].json
}
}
-Working example: https://{{ packagist_host }}/p/monolog/monolog.json
Working example: https://{{ packagist_host }}/p/{{ examplePackage }}.json?token={{ apiToken }}
The JSON API for packages gives you all the infos we have including downloads, dependents count, github info, etc. However it is generated dynamically so for performance reason we cache the responses for twelve hours. As such if the static file endpoint described above is enough please use it instead.
-GET https://{{ packagist_host }}/packages/[vendor]/[package].json
+GET https://{{ packagist_host }}/packages/[vendor]/[package].json?token={{ apiToken }}
{
"package": {
@@ -201,9 +129,8 @@ GET https://{{ packagist_host }}/packages/[vendor]/[package].json
}
}
-Working example: https://{{ packagist_host }}/packages/monolog/monolog.json
Working example: https://{{ packagist_host }}/packages/{{ examplePackage }}.json?token={{ apiToken }}