Gcore CDN

Gcore CDN

Development

The Gcore CDN provides an API with predictable, resource-oriented URLs that utilize HTTP response codes to signal API errors. The API is designed to work seamlessly with HTTP clients and employs standard HTTP features, such as authentication and terminology. The API returns JSON data in all responses, including error messages. It offers a comprehensive set of features that developers can leverage to create customized content delivery network solutions.

Visit APIπŸ” Alternatives

πŸ“š Documentation & Examples

Everything you need to integrate with Gcore CDN

πŸš€ Quick Start Examples

Gcore CDN Javascript Examplejavascript
// Gcore CDN API Example
const response = await fetch('https://docs.gcore.com/cdn', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Exploring the GCore CDN API Docs

GCore CDN is a content delivery network offered by GCore Labs that provides enhanced performance and security for websites and mobile applications. GCore CDN offers a range of APIs to facilitate the integration of their services with your applications. In this article, we will explore its public API documentation and look at some example code in JavaScript.

Accessing the GCore CDN API Docs

To access the API documentation, simply navigate to https://docs.gcore.com/cdn in your web browser. The documentation is well-organized and makes it easy to explore the available API endpoints.

Example Code in JavaScript

GCore CDN offers APIs that allow you to manage and monitor your CDN resources programmatically. In this section, we will look at some example code in JavaScript that demonstrates how to use these APIs.

Fetching Information about CDN Resources

To fetch information about your CDN resources, you can use the GET /api/v1/http-caches endpoint. This endpoint returns a list of HTTP caches for your account. Here is an example code snippet that demonstrates how to fetch this data using JavaScript:

fetch('https://api.gcdn.co/v1/http-caches', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer ' + <your_access_token>
  }
})
.then(response => response.json())
.then(data => console.log(data));

Replace <your_access_token> with your actual access token.

Purging Cached Content

To purge a file from the CDN cache, you can use the DELETE /api/v1/http-caches endpoint. Here is an example code snippet that demonstrates how to purge a file using JavaScript:

fetch('https://api.gcdn.co/v1/http-caches', {
  method: 'DELETE',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer ' + <your_access_token>
  },
  body: JSON.stringify({
    url: 'https://example.com/path/to/file.jpg'
  })
})
.then(response => response.json())
.then(data => console.log(data));

Replace <your_access_token> with your actual access token, and replace the URL with the URL of the file you want to purge.

Conclusion

GCore CDN provides a robust and reliable API that makes it easy to manage and monitor your CDN resources. The API documentation is well-organized and easy to use, and the example code in JavaScript provided here should give you a good starting point for integrating GCore CDN with your applications.

πŸ“Š 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

Aug 5Aug 7Aug 9Aug 11Aug 13Aug 15Aug 17Aug 19Aug 21Aug 23Aug 25Aug 27Aug 29Aug 31Sep 304008001440Minutes
Online
Offline

Related APIs in Development