Python
from gcore import Gcore
client = Gcore()
public_ip_list = client.cdn.ips.list()
print(public_ip_list.addresses)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cdn"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
publicIPList, err := client.CDN.IPs.List(context.TODO(), cdn.IPListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", publicIPList.Addresses)
}
curl --request GET \
--url https://api.gcore.com/cdn/public-ip-listconst options = {method: 'GET'};
fetch('https://api.gcore.com/cdn/public-ip-list', 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/public-ip-list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cdn/public-ip-list")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/public-ip-list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"addresses": [
"92.223.74.19/32"
],
"addresses_v6": [
"2a03:90c0:191:2801::8/128"
]
}IP addresses list
Get CDN servers IP addresses
Get all IP addresses of CDN servers that can be used to pull content from your origin.
This list is updated periodically. If you want to use IP from this list to configure IP ACL in your origin, you need to independently monitor its relevance. We recommend using a script to automatically update IP ACL.
This request does not require authorization.
GET
/
cdn
/
public-ip-list
Python
from gcore import Gcore
client = Gcore()
public_ip_list = client.cdn.ips.list()
print(public_ip_list.addresses)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cdn"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
publicIPList, err := client.CDN.IPs.List(context.TODO(), cdn.IPListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", publicIPList.Addresses)
}
curl --request GET \
--url https://api.gcore.com/cdn/public-ip-listconst options = {method: 'GET'};
fetch('https://api.gcore.com/cdn/public-ip-list', 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/public-ip-list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cdn/public-ip-list")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/public-ip-list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"addresses": [
"92.223.74.19/32"
],
"addresses_v6": [
"2a03:90c0:191:2801::8/128"
]
}Headers
Content negotiation header.
Defaults to application/json if not provided.
Available options:
application/json, text/plain Query Parameters
Optional format override.
When set, this takes precedence over the Accept header.
Available options:
json, plain Was this page helpful?