CDNJS API

Beginner's Pick Development / No Auth Required Beginner HTTPS
Free to Use
78 B
Measured Score 0 50 100 Speed 27/30 Consistency 8/20 Security 20/20 Browser access 15/15 Transparency 8/15 TESTED 2026-08-10

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.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://api.cdnjs.com/api/
Result
HTTP 200 · application/json · 16,588 bytes · compressed
Response time
39 ms (median of 3) · fastest 28 ms
Transport
TLSv1.3 · TLS_AES_256_GCM_SHA384 · certificate issued by Google Trust Services
Browser CORS
Allowed — Access-Control-Allow-Origin: *
Served by
cloudflare
Recorded
2026-08-10

Fields Returned

Top-level fields present in the response we captured, with the type and value we actually received.

Field Type Value received
openapi string 3.0.0
info object {3 fields}
servers array [1 item]
components object {1 fields}
paths object {6 fields}

Captured Response

Captured from a real request to https://api.cdnjs.com/api/ on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
{
  "openapi": "3.0.0",
  "info": {
    "title": "cdnjs API",
    "description": "The cdnjs API allows for easy programmatic navigation of our libraries.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.cdnjs.com",
      "description": "Production"
    }
  ],
  "components": {
    "schemas": {
      "Error": {
        "…": "(4 more fields)"
      },
      "Library": {
        "…": "(3 more fields)"
      },
      "LibraryResult": {
        "…": "(2 more fields)"
      },
      "LibraryVersion": {
        "…": "(3 more fields)"
      }
    }
  },
  "paths": {
    "/libraries": {
      "get": {
        "…": "(5 more fields)"
      }
    },
    "/libraries/{library}": {
      "get": {
        "…": "(5 more fields)"
      }
    },
    "/libraries/{library}/{version}": {
      "get": {
        "…": "(5 more fields)"
      }
    },
    "/api": {
      "get": {
        "…": "(5 more fields)"
      }
    },
    "/stats": {
      "get": {
        "…": "(5 more fields)"
      }
    },
    "/whitelist": {
      "get": {
        "…": "(5 more fields)"
      }
    }
  }
}

Field Reference

version The latest stable version number available on the CDN.
description Short description of what the library does.

Implementation Example

Request skeleton. The URL below is this API's documentation page, not a live endpoint — swap in the path you need from the provider's docs before running it.

Request
const url = "https://api.cdnjs.com/libraries/jquery?fields=name,version,description?fields=name,version,description";
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.

How This API Fails

We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.

HTTP 404 Requesting a path that does not exist application/json
{
  "error": true,
  "status": 404,
  "message": "Endpoint not found"
}

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

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.

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 27/30
Consistency 8/20
Security 20/20
Browser access 15/15
Transparency 8/15
Endpoint Response Time 39ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Development
Difficulty Beginner
Endpoint last called: 2026-08-10

Related Tags

Similar APIs

View All →