---
title: "Returns a paged list of all Locations"
method: GET
path: "/api/v1/locations"
tags: ["Locations"]
---

# Returns a paged list of all Locations

`GET /api/v1/locations`

## Request

- Base URL: `https://population.un.org/dataportalapi`
- URL: `https://population.un.org/dataportalapi/api/v1/locations`
- Auth: none declared
- TypeScript: <https://skmtc.dev/united-nations/apis/data-portal-api/docs/api/v1/locations/get.ts> (a function with typed inputs; its response is checked against the schema)

<br>Paging options: \
            \
            <br>* To return paged subset of data, provide PageNumber and PageSize \
            <br>* To return paging info in the body od the response, set 'pagingInHeader' to FALSE (default). Data is returned in 'response.data' field \
            <br>* To return paging info in the 'x-pagination' response header, set 'pagingInHeader' to TRUE. Data is returned as the response object

## Query parameters

- `pageNumber` integer
- `pageSize` integer
- `pagingInHeader` boolean
- `sort` string
- `format` string

## Response `200`

Returns list of all Locations.

- LocationFlatDto[]
  - `id` integer
  - `name` string, nullable
  - `iso3` string, nullable
  - `iso2` string, nullable
  - `longitude` number, double, nullable
  - `latitude` number, double, nullable

## Other responses

- `400`: Returns Status 400 BadRequest if passed 'sort' parameter is not a property of the Model class returned.
- `401`: Unauthorized
- `404`: Returns Status 404 NotFound if no locations are returned.
- `406`: Not Acceptable
- `500`: Returns Status 500 Internal Server Error if an exception is thrown by the server.

---

[API](https://skmtc.dev/united-nations/apis/data-portal-api.md) - [All operations](https://skmtc.dev/united-nations/apis/data-portal-api/llms.txt) - [OpenAPI document](https://skmtc.dev/united-nations/apis/data-portal-api/revisions/2f5f5b77ad0d?raw)
