
PageCDN API
Cloud Storage & File SharingPublic CDN API for opensource javascript, CSS and fonts libraries.
📚 Documentation & Examples
Everything you need to integrate with PageCDN API
🚀 Quick Start Examples
// PageCDN API API Example
const response = await fetch('https://pagecdn.com/docs/introduction', {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
Introduction to PageCDN API
PageCDN is a content delivery network that allows developers to easily optimize website performance. In order to interact with PageCDN, we provide a public API. In this document, we'll cover the basics of the PageCDN API.
Getting Started
To use the PageCDN API, you'll need to create an account on our website. Once you have an account, you can generate your API key. This key will be used to authenticate your requests to the API.
API Methods
CDN
Purge
Purge all CDN cache for the specified zone
fetch('https://api.pagecdn.io/v1/cdn/purge', {
method: 'POST',
body: JSON.stringify({
zone: "{{zone}}",
type: "both"
}),
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${YOUR_API_KEY}`
}
}).then(resp => console.log(resp))
.catch(err => console.error(err));
Images
Optimize
Optimize the given image URL.
fetch('https://api.pagecdn.io/v1/images/optimize', {
method: 'POST',
body: JSON.stringify({
url: '{{url}}',
compressionType: 'lossless'
}),
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${YOUR_API_KEY}`
}
}).then(resp => console.log(resp))
.catch(err => console.error(err));
Resize
Resize the given image URL with the given width and height.
fetch('https://api.pagecdn.io/v1/images/resize', {
method: 'POST',
body: JSON.stringify({
url: '{{url}}',
width: 300,
height: 300,
compressionType: 'lossless'
}),
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${YOUR_API_KEY}`
}
}).then(resp => console.log(resp))
.catch(err => console.error(err));
Conclusion
The PageCDN API provides a simple interface for optimizing website performance. With this API, you can streamline your workflows and automate many common tasks. We hope this article has provided a useful overview of the PageCDN API.
📊 30-Day Uptime History
Daily uptime tracking showing online vs offline minutes