> ## 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 Trending Concepts

> Retrieve trending OMOP concepts ranked by search frequency and usage patterns to surface popular medical terminology across OMOPHub clients.

## Overview

This endpoint provides insights into trending concepts by analyzing search frequency and usage patterns. It identifies concepts that are seeing increased activity over different time periods.

## Query Parameters

<ParamField query="period" type="string" default="week">
  Time period for trend analysis

  <br />

  **Options**: `day`, `week`, `month`
</ParamField>

<ParamField query="vocabulary_ids" type="string">
  Filter trends to specific vocabularies (comma-separated)

  <br />

  **Examples**: `SNOMED`, `SNOMED,ICD10CM`, `RXNORM,LOINC`
</ParamField>

<ParamField query="page_size" type="integer" default="20">
  Maximum number of trending concepts to return (1-1000)
</ParamField>

<ParamField query="vocab_release" type="string">
  Specific vocabulary release version (defaults to latest)
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="Trending Concepts Data">
    <ResponseField name="period" type="string">
      Time period analyzed (`day`, `week`, or `month`)
    </ResponseField>

    <ResponseField name="concepts" type="array">
      Array of trending concepts

      <Expandable title="Trending Concept">
        <ResponseField name="concept_id" type="integer">
          Unique concept identifier
        </ResponseField>

        <ResponseField name="concept_name" type="string">
          Primary concept name
        </ResponseField>

        <ResponseField name="vocabulary_id" type="string">
          Source vocabulary identifier
        </ResponseField>

        <ResponseField name="search_count" type="integer">
          Number of searches for this concept in the period
        </ResponseField>

        <ResponseField name="growth_rate" type="number">
          Percentage growth rate compared to the previous period
        </ResponseField>

        <ResponseField name="trend_score" type="number">
          Calculated trend score (higher = more trending). Weighted combination of search volume (60%) and growth rate (40%).
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="total_concepts" type="integer">
      Total number of trending concepts found
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Maximum results returned (from page\_size parameter)
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="meta" type="object">
  <Expandable title="Metadata">
    <ResponseField name="request_id" type="string">
      Unique identifier for the request
    </ResponseField>

    <ResponseField name="timestamp" type="string">
      Request timestamp (ISO 8601 UTC format)
    </ResponseField>

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

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.omophub.com/v1/concepts/trending?period=week&vocabulary_ids=SNOMED,ICD10CM&page_size=20" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.omophub.com/v1/concepts/trending?period=week&vocabulary_ids=SNOMED&page_size=50', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  });

  const data = await response.json();
  console.log(`Found ${data.data.total_concepts} trending concepts`);
  ```

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

  headers = {
      'Authorization': 'Bearer YOUR_API_KEY'
  }

  params = {
      'period': 'month',
      'vocabulary_ids': 'SNOMED,ICD10CM',
      'page_size': 50
  }

  response = requests.get(
      'https://api.omophub.com/v1/concepts/trending',
      headers=headers,
      params=params
  )

  data = response.json()
  for concept in data['data']['concepts']:
      print(f"{concept['concept_name']}: score {concept['trend_score']}")
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "period": "week",
      "concepts": [
        {
          "concept_id": 201826,
          "concept_name": "Type 2 diabetes mellitus",
          "vocabulary_id": "SNOMED",
          "search_count": 1547,
          "growth_rate": 23.5,
          "trend_score": 7.8
        },
        {
          "concept_id": 320128,
          "concept_name": "Essential hypertension",
          "vocabulary_id": "SNOMED",
          "search_count": 1234,
          "growth_rate": 18.2,
          "trend_score": 6.9
        },
        {
          "concept_id": 4329847,
          "concept_name": "Myocardial infarction",
          "vocabulary_id": "SNOMED",
          "search_count": 987,
          "growth_rate": 15.7,
          "trend_score": 5.4
        }
      ],
      "total_concepts": 156,
      "limit": 20
    },
    "meta": {
      "request_id": "req_trending_abc123",
      "timestamp": "2024-01-15T10:30:00Z",
      "vocab_release": "2025.2"
    }
  }
  ```
</ResponseExample>

## Usage Examples

### Weekly Trending Concepts

Get trending concepts from the past week:

```bash theme={null}
curl -X GET "https://api.omophub.com/v1/concepts/trending?period=week&page_size=50" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Vocabulary-Specific Trends

Focus on trends within specific vocabularies:

```bash theme={null}
curl -X GET "https://api.omophub.com/v1/concepts/trending?vocabulary_ids=SNOMED&period=month" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Daily Trending

Get the most recent daily trends:

```bash theme={null}
curl -X GET "https://api.omophub.com/v1/concepts/trending?period=day&page_size=100" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Trend Score Calculation

The `trend_score` is a composite metric calculated from:

* **Search volume (60% weight)**: Number of searches for the concept in the current period
* **Growth rate (40% weight)**: Percentage change compared to the previous period of equal length

Higher scores indicate concepts with both high search volume and significant growth.

## Related Endpoints

* [Search Concepts](/api-reference/search/basic-search) - Search for specific concepts
* [Get Concept](/api-reference/concepts/get-concept) - Detailed concept information
* [Suggest Concepts](/api-reference/concepts/suggest-concepts) - Concept suggestions
