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

# Countries

> This endpoint retrieves all the headquarter countries identified in the given market.<br /><br />
This is commonly used with the `/markets/{marketId}/companies` endpoint to ensure that the filter is acting on an available country.

<Warning>
  This endpoint is deprecated and will be removed in the future. Please use [Attributes](./attributes) instead.
</Warning>

### Path

<ParamField path="marketId" type="string" initialValue="2">
  The ID of the market which you want to retrieve countries of. This can be retrieved by searching for markets.
</ParamField>

### Response

<ResponseField name="meta" type="object">
  Metadata summarizing the `data` returned.

  <Expandable title="meta">
    <ResponseField name="totalItems" type="number">
      The number of unique country names found in the study.
    </ResponseField>

    <ResponseField name="totalUniqueCompanies" type="number">
      The number of unique companies headquartered in any of the above countries.

      This does not count companies in the market for which the headquarter country
      could not be determined.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="data" type="object">
  A mapping of all countries to their number of occurrences, sorted by - descending number of occurrences, and then -
  alphabetical order of the countries.
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "meta": {
      "totalItems": 26,
      "totalUniqueCompanies": 164
    },
    "currentQuery": {
      "marketId": 2
    },
    "data": {
      "United States": 94,
      "United Kingdom": 18,
      "Canada": 8,
      "Germany": 5,
      "Australia": 4,
      "France": 4,
      "Netherlands": 4,
      "Spain": 4,
      "Israel": 3,
      "India": 2,
      "Italy": 2,
      "South Africa": 2,
      "Austria": 1,
      "Bangladesh": 1,
      "Colombia": 1,
      "Cyprus": 1,
      "Czech Republic": 1,
      "Finland": 1,
      "Hong Kong": 1,
      "Hungary": 1,
      "People's Republic of China": 1,
      "Poland": 1,
      "Republic of Ireland": 1,
      "Russia": 1,
      "Switzerland": 1,
      "Turkey": 1
    }
  }
  ```
</ResponseExample>
