Skip to content

jsdelivr/api

Repository files navigation

DEPRECATED

The v1 API has been deprecated. All endpoints will continue to work, but will use a dataset created on June 8, 2017 and won't receive any future updates. See https://github.com/jsdelivr/data.jsdelivr.com for a new API.

Public CDNs API

Root: /v1/<cdn>/libraries

Supports jsdelivr, google, cdnjs, bootstrap, and jquery.

Only GET requests are allowed. No limits are set.

Get all hosted libraries in JSON format

https://api.jsdelivr.com/v1/jsdelivr/libraries
https://api.jsdelivr.com/v1/google/libraries
https://api.jsdelivr.com/v1/cdnjs/libraries
https://api.jsdelivr.com/v1/bootstrap/libraries
https://api.jsdelivr.com/v1/jquery/libraries

Get full information for a single library based on name parameter.

https://api.jsdelivr.com/v1/jsdelivr/libraries?name=jquery
https://api.jsdelivr.com/v1/jsdelivr/libraries/jquery - alias

Get full information for any library starting with jq that has lastversion ending with 0.1. minimatch syntax is supported.

https://api.jsdelivr.com/v1/jsdelivr/libraries?name=jq*&lastversion=*.0.1

You can use any of the following parameters to search for libraries. A search will be performed for projects matching your input. You can use multiple parameters at the same time. If multiple projects match they all will be outputed.

  • name - name of library. Example: jquery
  • mainfile - mainfile parameter in info.ini. Example: jquery.min.js
  • lastversion- lastversion of the project. Example: 2.0.3 (will match multiple projects)
  • versions - all hosted versions for selected project. (read only)
  • description - description of the project
  • homepage- webpage of project. Example: https://jquery.com/
  • github- github page of project. Example: https://github.com/jquery/jquery
  • author - the author of project. Example: jQuery Foundation
  • assets - files hosted per versions. (read only)

You can combine the above parameters with the parameter fields. This way you can control the output. For example to get the mainfile for jQuery you would run the following request.

https://api.jsdelivr.com/v1/jsdelivr/libraries?name=jquery&fields=mainfile

It's possible to set multiple fields using a comma for separation.

https://api.jsdelivr.com/v1/jsdelivr/libraries?name=jquery&fields=mainfile,name

Get hosted files per version for jQuery

https://api.jsdelivr.com/v1/jsdelivr/libraries?name=jquery&fields=assets

Get hosted files for a selected version

https://api.jsdelivr.com/v1/jsdelivr/libraries/jquery/2.0.3

Get libraries matching to any part of query (defaults to and)

https://api.jsdelivr.com/v1/jsdelivr/libraries?name=jquery&op=or