---
title: "Get a list of ip ranges"
method: GET
path: "/ranges"
tags: ["ips"]
---

# Get a list of ip ranges

`GET /ranges`

## Request

- Base URL: `https://cyber-risk.upguard.com/api/public`
- URL: `https://cyber-risk.upguard.com/api/public/ranges`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/upguard/apis/upguard-cyberrisk-api/docs/ranges/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns a list of ip ranges for your account.

Required API key permissions: `BreachRisk` (select when creating API key in Account Settings)

## Query parameters

- `labels` string[]
- `page_token` string
- `page_size` integer
- `sort_by` 'start' | 'end' | 'num_ips' | 'owner' | 'country' | 'asn' | 'as_name'
- `sort_desc` boolean

## Response `200`

A list of ranges

- GetRangesV1RespBody
  - `next_page_token` string: The token to be used to retrieve the next page of results. Will not be returned if there are no more results.
  - `ranges` ApiRange[]: The list of ranges
    - `as_name` string: The name of the AS the range belongs to. If no AS is available for a range this field will be omitted.
    - `asn` integer: The ASN the range belongs to. If no ASN is available for a range this field will be omitted.
    - `country` string: The country the range belongs to. If no country is available for a range this field will be omitted.
    - `end` string: The range end.
    - `labels` string[]: The labels associated with the range.
    - `num_ips` integer: The number of IPs in this range
    - `owner` string: The owner of the range.
    - `sources` IPSource[]: The sources of the range.
    - `start` string: The range start.
  - `total_results` integer: The total number of ranges found.

## Other responses

- `403`: Your API key does not have permission to perform this action.
- `422`: An invalid parameter was supplied or a mandatory parameter was missing
- `429`: Too many requests have been made to this endpoint.
- `500`: An internal system error occurred

---

[API](https://skmtc.dev/upguard/apis/upguard-cyberrisk-api.md) - [All operations](https://skmtc.dev/upguard/apis/upguard-cyberrisk-api/llms.txt) - [OpenAPI document](https://skmtc.dev/upguard/apis/upguard-cyberrisk-api/revisions/d044bf6dc61e?raw)
