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

# Browse Departments

> Browse all federal departments ranked by procurement record count.

## Overview

Returns all distinct federal department strings ranked by contract record count. Use to find the exact department name before calling [Department Profile](/api-reference/departments/profile).

## Query Parameters

<ParamField query="q" type="string">
  Partial match on department name. Example: `Palantir`.
</ParamField>

<ParamField query="sort_by" type="string">
  Only `record_count`. Default: `record_count`. Example: `date`.
</ParamField>

<ParamField query="sort_order" type="string">
  `asc` or `desc`. Default: `desc`. Example: `desc`.
</ParamField>

<ParamField query="limit" type="integer">
  Max results. Default: `100`. Max: `200`. Example: `25`.
</ParamField>

<ParamField query="offset" type="integer">
  Result offset. Default: `0`. Example: `50`.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -H "X-API-Key: your_api_key_here" \
    "https://api.northaxiumdata.ca/api/v1/departments?q=Defence"
  ```

  ```python Python theme={null}
  import requests

  headers = {"X-API-Key": "your_api_key_here"}
  response = requests.get(
      "https://api.northaxiumdata.ca/api/v1/departments",
      headers=headers,
      params={"q": "Defence"}
  )
  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": [
      {
        "department": "National Defence | Défense nationale",
        "record_count": 18432,
        "total_value": 4821034521.00
      }
    ],
    "meta": {
      "total": 1,
      "limit": 100,
      "offset": 0
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": "UNAUTHORIZED",
      "message": "Missing API key. Pass your key in the X-API-Key header."
    }
  }
  ```

  ```json 429 theme={null}
  {
    "error": {
      "code": "RATE_LIMITED",
      "message": "Monthly request limit exceeded. Upgrade your plan for higher limits."
    }
  }
  ```
</ResponseExample>
