---
title: Admin Unit Details API Reference
version: 1.0.0
description: Get detailed information about a specific administrative unit identified by its country code and admin unit code. Returns the unit name, admin code, ISO 3166-2 code, admin level type, country ISO code, and country name. Both the `country` and `admin_unit` parameters are required; invalid or unmatched combinations return a 400 or 404 error respectively.
openapi: 3.1.1
servers:
  - https://api.apifreaks.com/v1.0
paths: 1
operations: 1
schemas: 2
---

## Table of Contents

- [Admin Unit Details API Reference v1.0.0](#admin-unit-details-api-reference-v100)
  - [Authentication](#authentication)
  - [GeoDB APIs](#geodb-apis)
    - [getAdminUnitDetails](#getadminunitdetails)
      - [Parameters](#parameters)
      - [Responses](#responses)
  - [Schemas](#schemas)
    - [AdminUnitDetailsResponse](#adminunitdetailsresponse)
    - [ErrorResponse](#errorresponse)



# Admin Unit Details API Reference v1.0.0

Get detailed information about a specific administrative unit identified by its country code and admin unit code. Returns the unit name, admin code, ISO 3166-2 code, admin level type, country ISO code, and country name. Both the `country` and `admin_unit` parameters are required; invalid or unmatched combinations return a 400 or 404 error respectively.

Base URLs:

* [https://api.apifreaks.com/v1.0](https://api.apifreaks.com/v1.0)

## Authentication

* API Key (ApiKeyAuthHeader)
    - Parameter Name: **X-apiKey**, in: header. Pass your API key via the X-apiKey request header.

* API Key (ApiKeyAuthQuery)
    - Parameter Name: **apiKey**, in: query. Pass your API key via the apiKey query parameter.

## GeoDB APIs

### getAdminUnitDetails

`GET /geo/admin-unit/details`

*Retrieve detailed information about a specific administrative unit*

Returns comprehensive details for a single administrative unit identified by country code and admin code.

#### Parameters

|Name|In|Type|Required|Description|
|---|---|---|---|---|
|format|query|string|false|Format of the response. Possible values: json, xml.|
|country|query|string|true|Country code in ISO 3166-1 alpha-2 format (e.g., US, PK).|
|admin_unit|query|string|true|Admin code of the administrative unit being requested.|

##### Enumerated Values

|Parameter|Value|
|---|---|
|format|json|
|format|xml|

> Example responses

> Successful response with admin unit details

```json
{
  "name": "California",
  "admin_code": "CA",
  "admin_iso3166_2": "US-CA",
  "admin_level": "state",
  "country_iso3166_2": "US",
  "country_name": "United States"
}
```

```json
{
  "name": "Armed Forces of the Americas",
  "admin_code": "AA",
  "admin_level": "military postal region",
  "country_iso3166_2": "US",
  "country_name": "United States"
}
```

> Bad Request — Missing country/admin_unit parameter, invalid country code, or invalid admin code

```json
{
  "error": "Invalid Param Exception",
  "message": "please pass correct parameters",
  "path": "/v1.0/geo/admin-unit/details",
  "status": 400,
  "timestamp": "2026-07-24T10:46:22.210Z"
}
```

```json
{
  "timestamp": "2026-07-24T10:46:23.231Z",
  "path": "/v1/admin-unit/details",
  "status": 400,
  "error": "Invalid Country Code provided",
  "message": "Only ISO 3166-1 alpha-2 codes country codes are supported."
}
```

```json
{
  "timestamp": "2026-07-24T10:46:23.768Z",
  "path": "/v1/admin-unit/details",
  "status": 400,
  "error": "Invalid Admin Code provided",
  "message": "Please provide a valid admin code."
}
```

> Not Found — Country is a recognized ISO 3166-1 alpha-2 code but has no published admin units (e.g. Vatican City)

```json
{
  "timestamp": "2026-07-24T10:46:24.259Z",
  "path": "/v1/admin-unit/details",
  "status": 404,
  "error": "No Admin Unit present in country",
  "message": "This Country does not have any admin units associated with it."
}
```

#### Responses

|Status|Meaning|Description|Schema|
|---|---|---|---|
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful response with admin unit details|[AdminUnitDetailsResponse](#adminunitdetailsresponse)|
|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad Request — Missing country/admin_unit parameter, invalid country code, or invalid admin code|[ErrorResponse](#errorresponse)|
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found — Country is a recognized ISO 3166-1 alpha-2 code but has no published admin units (e.g. Vatican City)|[ErrorResponse](#errorresponse)|

#### Response Headers

|Status|Header|Type|Format|Description|
|---|---|---|---|---|
|200|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|400|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|
|404|X-AF-Credits-Cost|integer||Specifies the number of credits consumed by the current request.|

To perform this operation, you must be authenticated by means of one of the following methods:
ApiKeyAuthHeader, ApiKeyAuthQuery

## Schemas

### AdminUnitDetailsResponse

Detailed information for a single administrative unit resolved from a country code and admin unit code.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|name|string|true|none|Name of the administrative unit.|
|admin_code|string|true|none|Administrative code of the unit.|
|admin_iso3166_2|string|false|none|The unit's full ISO 3166-2 code, formed as {country}-{admin_code} (e.g., US-CA, PK-BA, TV-FUN).|
|admin_level|string|true|none|Level or type of the administrative unit (e.g., province, region, state).|
|country_iso3166_2|string|true|none|Country code in ISO 3166-1 alpha-2 format.|
|country_name|string|true|none|Name of the country.|

### ErrorResponse

Standard error envelope returned by the API on failed requests.

#### Properties

|Name|Type|Required|Restrictions|Description|
|---|---|---|---|---|
|error|string|false|none|Short error category or exception type.|
|message|string|true|none|Human-readable error message describing the failure.|
|path|string|false|none|API endpoint path that produced the error.|
|status|integer|false|none|HTTP status code returned with the error.|
|timestamp|string(date-time)|false|none|Timestamp when the error occurred (ISO 8601).|
