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

# Get Domain Statistics

> Get statistical overview for an OMOP domain including concept counts, standard concept coverage, and vocabulary distribution for capacity planning.

This endpoint provides statistical information about a domain, including concept counts, vocabulary distribution, and concept class breakdown.

## Path Parameters

<ParamField path="domain_id" type="string" required>
  The domain identifier to get statistics for.

  <br />

  **Example:** `Condition`, `Drug`, `Procedure`
</ParamField>

## Query Parameters

<ParamField query="vocab_release" type="string" optional>
  Specific vocabulary release version to query

  <br />

  **Example:** `2025.1`
</ParamField>

## Response

<ResponseField name="domain_id" type="string">
  Domain identifier.
</ResponseField>

<ResponseField name="statistics" type="object">
  Statistical overview of the domain.

  <Expandable title="Statistics Object">
    <ResponseField name="domain_id" type="string">
      Domain identifier.
    </ResponseField>

    <ResponseField name="domain_name" type="string">
      Human-readable domain name.
    </ResponseField>

    <ResponseField name="total_concepts" type="integer">
      Total number of concepts in the domain.
    </ResponseField>

    <ResponseField name="standard_concepts" type="integer">
      Number of standard concepts (standard\_concept = 'S').
    </ResponseField>

    <ResponseField name="non_standard_concepts" type="integer">
      Number of non-standard concepts.
    </ResponseField>

    <ResponseField name="invalid_concepts" type="integer">
      Number of invalid/deprecated concepts.
    </ResponseField>

    <ResponseField name="vocabulary_breakdown" type="array">
      Distribution of concepts by vocabulary.

      <Expandable title="Vocabulary Item">
        <ResponseField name="vocabulary_id" type="string">
          Vocabulary identifier.
        </ResponseField>

        <ResponseField name="vocabulary_name" type="string">
          Human-readable vocabulary name.
        </ResponseField>

        <ResponseField name="concept_count" type="integer">
          Number of concepts from this vocabulary.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="concept_class_breakdown" type="array">
      Distribution of concepts by concept class.

      <Expandable title="Concept Class Item">
        <ResponseField name="concept_class_id" type="string">
          Concept class identifier.
        </ResponseField>

        <ResponseField name="concept_class_name" type="string">
          Human-readable concept class name.
        </ResponseField>

        <ResponseField name="concept_count" type="integer">
          Number of concepts in this class.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="creation_date_range" type="object">
      Date range of concept validity dates.

      <Expandable title="Date Range Object">
        <ResponseField name="earliest" type="string">
          Earliest valid\_start\_date (ISO format).
        </ResponseField>

        <ResponseField name="latest" type="string">
          Latest valid\_start\_date (ISO format).
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="meta" type="object">
  Response metadata.

  <Expandable title="Metadata Object">
    <ResponseField name="request_id" type="string">
      Unique identifier for this request.
    </ResponseField>

    <ResponseField name="vocab_release" type="string">
      Vocabulary release version used.
    </ResponseField>

    <ResponseField name="timestamp" type="string">
      Response timestamp (ISO format).
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.omophub.com/v1/domains/Condition/statistics" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.omophub.com/v1/domains/Condition/statistics',
    {
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY'
      }
    }
  );

  const data = await response.json();
  console.log(`Total concepts: ${data.data.statistics.total_concepts}`);
  console.log(`Standard: ${data.data.statistics.standard_concepts}`);

  // Show vocabulary distribution
  data.data.statistics.vocabulary_breakdown.forEach(v => {
    console.log(`${v.vocabulary_id}: ${v.concept_count} concepts`);
  });
  ```

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

  response = requests.get(
      "https://api.omophub.com/v1/domains/Drug/statistics",
      headers={"Authorization": "Bearer YOUR_API_KEY"}
  )

  data = response.json()
  stats = data["data"]["statistics"]

  print(f"Total: {stats['total_concepts']}")
  print(f"Standard: {stats['standard_concepts']}")
  print(f"Non-standard: {stats['non_standard_concepts']}")

  # Vocabulary breakdown
  for v in stats["vocabulary_breakdown"]:
      print(f"  {v['vocabulary_id']}: {v['concept_count']}")
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": {
      "domain_id": "Condition",
      "statistics": {
        "domain_id": "Condition",
        "domain_name": "Condition",
        "total_concepts": 845672,
        "standard_concepts": 423891,
        "non_standard_concepts": 421781,
        "invalid_concepts": 12453,
        "vocabulary_breakdown": [
          {
            "vocabulary_id": "SNOMED",
            "vocabulary_name": "Systematized Nomenclature of Medicine Clinical Terms",
            "concept_count": 387421
          },
          {
            "vocabulary_id": "ICD10CM",
            "vocabulary_name": "International Classification of Diseases, Tenth Revision, Clinical Modification",
            "concept_count": 98234
          },
          {
            "vocabulary_id": "ICD10",
            "vocabulary_name": "International Classification of Diseases, Tenth Revision",
            "concept_count": 87456
          }
        ],
        "concept_class_breakdown": [
          {
            "concept_class_id": "Clinical Finding",
            "concept_class_name": "Clinical Finding",
            "concept_count": 312456
          },
          {
            "concept_class_id": "Disorder",
            "concept_class_name": "Disorder",
            "concept_count": 156789
          }
        ],
        "creation_date_range": {
          "earliest": "1970-01-01",
          "latest": "2024-12-01"
        }
      }
    },
    "meta": {
      "request_id": "req_abc123",
      "vocab_release": "2025.1",
      "timestamp": "2025-01-05T10:00:00Z"
    }
  }
  ```
</ResponseExample>

## Usage Examples

### Get Condition Domain Statistics

```bash theme={null}
GET /v1/domains/Condition/statistics
```

### Get Drug Domain Statistics

```bash theme={null}
GET /v1/domains/Drug/statistics
```

### Get Procedure Domain Statistics

```bash theme={null}
GET /v1/domains/Procedure/statistics
```

## Related Endpoints

* [Get Domains](/api-reference/domains/get-domains) - List all available domains
* [Get Domain Concepts](/api-reference/domains/get-domain-concepts) - Get concepts within a domain

## Notes

* Statistics are calculated from the current vocabulary release
* The vocabulary\_breakdown shows which source vocabularies contribute concepts to the domain
* The concept\_class\_breakdown shows the distribution of concept types within the domain
* Standard concepts are preferred for clinical applications
