---
title: "Get one country by ISO 3166-1 alpha-2 code"
canonical_url: "https://twominutebilling.com/help/developers/api-reference/reference/get-one-country-by-iso-3166-1-alpha-2-code"
---
# Get one country by ISO 3166-1 alpha-2 code

<api-operation method="GET" path="/v1/countries/{code}">
<template v-slot:docs="">

## Path parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        code
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      ISO 3166-1 alpha-2 country code, case-insensitive
    </td>
  </tr>
</tbody>
</table>

## Response

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The object type; always <code>
        country
      </code>
      
      . One of <code>
        country
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        code
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The country's ISO-3166 alpha-2 code.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The country's name.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        dial_code
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Identifies a numbering PLAN, not a country — +1 is the whole NANP.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        phone_pattern
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Pattern for the national number (no dial code, no trunk 0). Anchor it as ^(?:…)$; null means there is no format to check.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        phone_lengths
      </code>
    </td>
    
    <td>
      <code>
        array of integer
      </code>
    </td>
    
    <td>
      Allowed national-number lengths in digits; null means any.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        region_label
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Local name for the region field — "State", "Province", "Prefecture".
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        postal_label
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Local name for the postal field.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        has_postal_code
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      False for the ~60 countries with no postal system — hide the field entirely.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        postal_regex
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Anchor it as ^(?:…)$; null means there is no format to check.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        postal_redundant
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Characters to strip before matching (usually " -").
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        postal_hint
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      An example postal code for the country.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        subdivision_strict
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      True when a non-empty subdivision outside the list is rejected.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        has_subdivisions
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Whether a list exists at all — some territories have none.
    </td>
  </tr>
</tbody>
</table>

## Status codes

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        200
      </code>
    </td>
    
    <td>
      Success
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        404
      </code>
    </td>
    
    <td>
      No such country
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl "$TMBILLING_URL/v1/countries/US"
```

</template>

<template v-slot:response="">
<code-group>

```json [200 OK]
{
  "object": "country",
  "code": "IN",
  "name": "United States",
  "dial_code": "+91",
  "phone_pattern": "+1 415 555 0100",
  "phone_lengths": [
    10
  ],
  "region_label": "State",
  "postal_label": "PIN code",
  "has_postal_code": false,
  "postal_regex": "[0-9]{5}(-[0-9]{4})?",
  "postal_redundant": " -",
  "postal_hint": "94105",
  "subdivision_strict": false,
  "has_subdivisions": false
}
```

```json [404 Not Found]
{
  "error": {
    "type": "invalid_request_error",
    "message": "No such country"
  }
}
```

</code-group>
</template>
</api-operation>


## Sitemap

See the full [sitemap](https://twominutebilling.com/sitemap.md) for all pages.
