CDNJS API

⭐ Beginner's Pick Development / No Auth Required Beginner HTTPS
Free to Use Varies (check documentation)

Overview

The CDNJS API provides metadata about JavaScript and CSS libraries hosted on cdnjs.com, one of the largest open source CDN networks. You can search for libraries, retrieve version lists, and get CDN URLs for any file in a library—no authentication required. It is ideal for tools that help developers discover and link to front-end dependencies via a fast global CDN.

💡

Beginner Tip

No API key or sign-up is needed. Try fetching info about a specific library using its exact npm package name, e.g., /libraries/jquery. Use the fields query parameter to limit which fields are returned and speed up responses.

Available Data

Use case: Integrate library info on cdnjs data into web and mobile applications
CDNJS data via REST API
JSON-formatted response data
Freely accessible without authentication

Example Response

JSON Response
{
  "title": "The Great Gatsby",
  "authors": [
    "F. Scott Fitzgerald"
  ],
  "publishedDate": "1925-04-10",
  "pageCount": 218,
  "categories": [
    "Fiction"
  ],
  "imageLinks": {
    "thumbnail": "https://books.google.com/..."
  },
  "averageRating": 4
}

Field Reference

name The package name as registered on CDNJS, e.g., jquery.
version The latest stable version number available on the CDN.
description Short description of what the library does.
homepage URL of the library's official website or repository.
filename The main file name for the library, e.g., jquery.min.js.
latest Full CDN URL to the latest minified version of the library.

Implementation Example

const url = "https://api.cdnjs.com/libraries/jquery";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

404 Not Found The library name does not exist on CDNJS or is misspelled.
Search for the library first using /libraries?search=YOUR_QUERY to find the correct name before fetching details.
Large response payload Requesting /libraries without a search query returns all ~4,000 libraries.
Always use the search parameter (e.g., ?search=react) and the fields parameter (e.g., &fields=name,version) to get a focused, smaller response.
Outdated version in response The API may briefly cache data, so very recently published versions might not appear immediately.
Wait a few minutes after a library version is published to npm/GitHub before querying for it on CDNJS.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 20/20
🔒 Security 15/15
🛠 Developer XP 20/20
✓ Reliability 15/15
Response Time 138ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Development
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →