curl --request GET \
--url https://api.gcore.com/cdn/ip_ranges \
--header 'Authorization: <api-key>'import requests
url = "https://api.gcore.com/cdn/ip_ranges"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/cdn/ip_ranges', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cdn/ip_ranges",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/cdn/ip_ranges"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cdn/ip_ranges")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/ip_ranges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"cidr": "198.51.100.0/24",
"ip_version": 4
}
]{
"errors": {
"field_name": [
"Error description."
]
}
}Get CDN servers IP ranges
Get the networks of CDN servers that pull content from your origin, to allow them in your origin IP ACL.
By default, each entry is a whole CDN network, so the list is as short as possible without covering addresses outside the CDN networks.
To get narrower entries, set ipv4_prefix_length or ipv6_prefix_length: each entry is then reduced to that prefix length.
An entry never covers addresses outside the CDN networks, so entries in a CDN network narrower than the requested length keep the length of that network.
This list is updated periodically. If you use it to configure IP ACL on your origin, we recommend updating the ACL automatically with a script.
The X-Generated-At response header shows when the current list was generated.
curl --request GET \
--url https://api.gcore.com/cdn/ip_ranges \
--header 'Authorization: <api-key>'import requests
url = "https://api.gcore.com/cdn/ip_ranges"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/cdn/ip_ranges', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cdn/ip_ranges",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/cdn/ip_ranges"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cdn/ip_ranges")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/ip_ranges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"cidr": "198.51.100.0/24",
"ip_version": 4
}
]{
"errors": {
"field_name": [
"Error description."
]
}
}Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234_abcdef
Headers
Content negotiation header.
Defaults to application/json if not provided.
application/json, text/plain Query Parameters
Prefix length of IPv4 entries.
An entry is narrower when the CDN network it belongs to is narrower than this length.
If not set or 0, each entry is a whole CDN network.
0 <= x <= 32Prefix length of IPv6 entries.
An entry is narrower when the CDN network it belongs to is narrower than this length.
If not set or 0, each entry is a whole CDN network.
0 <= x <= 128Return only entries of this IP version. If not set, both IPv4 and IPv6 entries are returned.
4, 6 Optional format override.
When set, this takes precedence over the Accept header.
json, plain Was this page helpful?