> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gcore.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.



## OpenAPI

````yaml /api-reference/services_docs_mintlify_enriched/cdn_api.yaml get /cdn/ip_ranges
openapi: 3.1.0
info:
  title: Gcore OpenAPI – CDN API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: c5dc16c2da13
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: CDN service
    description: Information about the current state of the CDN service in your account.
  - name: CDN resources
  - name: Origins
  - name: Rules
    description: >-
      Rules allow to set up custom settings for certain file types or paths.

      By default, the rule inherits all options values from the related CDN
      resource.


      Each option in rule settings can be in one of the following states:

      - **Inherit** - Option is not added to the rule. Option inherits its value
      from the CDN resource settings. In this case, the option value is
      **null**.

      - **ON** - Option is added to the rule and enabled. Option values
      configured in the rule will override values from the CDN resource
      settings.

      - **OFF** - Option is added to the rule and disabled. Option will be
      turned off.
  - name: Rule templates
  - name: Presets
    description: >-
      A preset is a predefined set of CDN resource or rule settings that can be
      applied to an object in a single request.


      Once a preset is applied to an object, the options included in the preset
      cannot be edited on that object until the preset is unapplied.
  - name: SSL certificates
  - name: Let's Encrypt certificates
  - name: CA certificates
  - name: Aliases
    description: >-
      An alias is a hostname you own that is served with the settings of one of
      your CDN resources and with

      its own SSL certificate. Aliases must be enabled for your account.
  - name: CDN activity logs
    description: |-
      Get the history of users requests to CDN.
      It contains requests made both via the API and via the control panel.

      The following methods are not tracked in the activity logs:
      - HEAD
      - OPTIONS
  - name: Log viewer
    description: >-
      Log viewer provides you with general information about CDN operation. This
      information does not contain all possible

      sets of fields and restricted by time. To receive full data, use Logs
      Uploader.
  - name: Logs uploader
    description: >-
      Logs uploader allows you to upload logs with desired format to desired
      storages.


      Consists of three main parts:

      - **Policies** - rules that define which logs are uploaded and how they
      are uploaded.

      - **Targets** - destinations where logs are uploaded.

      - **Configs** - combinations of logs uploader policies, targets and
      resources to which they are applied.
  - name: Tools
  - name: Statistics
    description: >-
      Consumption statistics is updated in near real-time as a standard
      practice.

      However, the frequency of updates can vary, but they are typically
      available within a 24-hour period.

      Exceptions, such as maintenance periods, may delay data beyond 24 hours
      until servers resume and fill in the missing statistics.
  - name: Advanced analytics
    description: >-
      Advanced analytics allows to get statistics about unique visitors,
      traffic, and requests for countries, directories, browsers, devices, and
      operation systems for up to 90 days starting from today.


      Advanced analytics API is based on the [GraphQL
      framework](https://graphql.org/).


      Advanced analytics API has one single endpoint:

       https://api.gcore.com/cdn/advanced/v2/query

      You can pass the query parameters as a JSON object in the payload of a
      POST request to this endpoint.

      You can use curl to make requests to the Advanced analytics API.
      Alternatively, you can use a GraphQL client

      to construct queries and pass requests to the Advanced analytics API.


      You can write queries in GraphQL much like in SQL: specify the data set
      (CDN resource), the metrics

      to retrieve (such as unique visitors and traffic), and filter or group by
      dimensions (for example, a country).
  - name: Origin shielding
  - name: IP addresses list
  - name: Purge history
paths:
  /cdn/ip_ranges:
    get:
      tags:
        - IP addresses list
      summary: Get CDN servers IP ranges
      description: >-
        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.
      operationId: get-cdn-ip-ranges
      parameters:
        - $ref: '#/components/parameters/ipv4_prefix_length'
        - $ref: '#/components/parameters/ipv6_prefix_length'
        - $ref: '#/components/parameters/ip_version'
        - $ref: '#/components/parameters/format'
        - $ref: '#/components/parameters/accept'
      responses:
        '200':
          description: Successful.
          headers:
            X-Generated-At:
              description: Time when the current list was generated.
              schema:
                type: string
                format: date-time
                example: '2026-01-01T12:00:00+00:00'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/IpRange'
            text/plain:
              schema:
                type: string
                description: Plain text list of networks, one per line.
              example: |
                198.51.100.0/24
                203.0.113.8/29
                2001:db8:1::/64
        '400':
          description: Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommonValidationError'
        '429':
          description: Too many requests.
        '503':
          description: >-
            The service is temporarily unavailable, or the list has not been
            generated yet. Retry later; when the `Retry-After` header is
            present, wait that number of seconds.
          headers:
            Retry-After:
              description: >-
                Number of seconds to wait before retrying. Present when the list
                has not been generated yet.
              schema:
                type: integer
                example: 60
components:
  parameters:
    ipv4_prefix_length:
      name: ipv4_prefix_length
      in: query
      description: >-
        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.
      required: false
      schema:
        type: integer
        minimum: 0
        maximum: 32
        default: 0
    ipv6_prefix_length:
      name: ipv6_prefix_length
      in: query
      description: >-
        Prefix 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.
      required: false
      schema:
        type: integer
        minimum: 0
        maximum: 128
        default: 0
    ip_version:
      name: ip_version
      in: query
      description: |-
        Return only entries of this IP version.
        If not set, both IPv4 and IPv6 entries are returned.
      required: false
      schema:
        type: integer
        enum:
          - 4
          - 6
    format:
      name: format
      in: query
      description: |-
        Optional format override.
        When set, this takes precedence over the `Accept` header.
      required: false
      schema:
        type: string
        enum:
          - json
          - plain
    accept:
      name: Accept
      in: header
      description: |-
        Content negotiation header.
        Defaults to `application/json` if not provided.
      required: false
      schema:
        type: string
        enum:
          - application/json
          - text/plain
  schemas:
    IpRange:
      type: object
      properties:
        cidr:
          type: string
          description: Network in CIDR notation.
          example: 198.51.100.0/24
        ip_version:
          type: integer
          description: IP version of the network.
          enum:
            - 4
            - 6
          example: 4
    CommonValidationError:
      title: Other Errors
      type: object
      properties:
        errors:
          type: object
          description: This object contains error descriptions per field from your request.
          properties:
            field_name:
              type: array
              description: Error list for specific field.
              items:
                type: string
                description: Error description
              example:
                - Error description.
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234_abcdef`
      type: apiKey
      in: header
      name: Authorization

````