> ## 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.

# Batch Concepts

## Overview

Efficiently retrieve information for multiple concepts at once. This endpoint is optimized for bulk operations and reduces the number of API calls needed.

## Request Body

**concept\_ids** `integer[]` *required*

Array of concept IDs to retrieve (max: 100)

**include\_relationships** `boolean` (default: false)

Include relationships for all concepts

**include\_synonyms** `boolean` (default: false)

Include synonyms for all concepts

**include\_mappings** `boolean` (default: false)

Include cross-vocabulary mappings for all concepts

**vocabulary\_filter** `string[]`

Filter results to specific vocabularies

**standard\_only** `boolean` (default: false)

Only return standard concepts

```bash cURL theme={null}
curl -X POST "https://api.omophub.com/v1/concepts/batch" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "concept_ids": [320128, 201826, 4329847],
    "include_relationships": true,
    "include_synonyms": true
  }'
```

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

payload = {
    "concept_ids": [320128, 201826, 4329847],
    "include_relationships": True,
    "include_synonyms": True,
    "include_mappings": False
}

response = requests.post(
    "https://api.omophub.com/v1/concepts/batch",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json=payload
)

concepts = response.json()
for concept in concepts['data']['concepts']:
    print(f"{concept['concept_name']} ({concept['vocabulary_id']})")
```

```ts TypeScript theme={null}
import { OMOPHub } from '@omophub/omophub-node';

const client = new OMOPHub();
const { data } = await client.concepts.batch({
  conceptIds: [320128, 201826, 4329847],
  includeRelationships: true,
  includeSynonyms: true,
});
console.log(`Retrieved ${data?.concepts.length} concepts`);
```

```bash cURL (with filtering) theme={null}
curl -X POST "https://api.omophub.com/v1/concepts/batch" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "concept_ids": [320128, 201826, 4329847, 313217],
    "vocabulary_filter": ["SNOMED", "ICD10CM"],
    "include_mappings": true,
    "standard_only": true
  }'
```

```python Python (comprehensive) theme={null}
import requests

# Large batch request with comprehensive data
concept_ids = [320128, 201826, 4329847, 313217, 435216]
payload = {
    "concept_ids": concept_ids,
    "include_relationships": True,
    "include_synonyms": True,
    "include_mappings": True,
    "standard_only": True
}

response = requests.post(
    "https://api.omophub.com/v1/concepts/batch",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json=payload
)

data = response.json()
print(f"Successfully retrieved {len(data['data']['concepts'])} concepts")
print(f"Failed to retrieve {len(data['data']['failed_concepts'])} concepts")

# Process successful concepts
for concept in data['data']['concepts']:
    print(f"\n{concept['concept_name']}")
    print(f"  ID: {concept['concept_id']}")
    print(f"  Vocabulary: {concept['vocabulary_id']}")
    print(f"  Domain: {concept['domain_id']}")

    if concept.get('synonyms'):
        print(f"  Synonyms: {len(concept['synonyms'])} found")

    if concept.get('relationships'):
        print(f"  Relationships: {len(concept['relationships'])} found")
```

## Response Fields

**success** `boolean`

Whether the batch request completed.

**data** `object`

Batch result.

**data.concepts** `array`

Successfully retrieved concepts.

**data.concepts\[].concept\_id** `integer`

OMOP concept identifier.

**data.concepts\[].concept\_name** `string`

Primary concept name.

**data.concepts\[].concept\_code** `string`

Vocabulary code.

**data.concepts\[].vocabulary\_id** `string`

Vocabulary identifier.

**data.concepts\[].domain\_id** `string`

OMOP domain.

**data.concepts\[].concept\_class\_id** `string`

Concept class.

**data.concepts\[].standard\_concept** `string | null`

`S`, `C`, or null.

**data.concepts\[].valid\_start\_date** `string`

Validity start date.

**data.concepts\[].valid\_end\_date** `string`

Validity end date.

**data.concepts\[].invalid\_reason** `string | null`

Invalidity marker, or null.

**data.concepts\[].synonyms** `array`

Synonym strings when requested.

**data.concepts\[].relationships** `object`

Parent and child hierarchy relationships when requested.

**data.failed\_concepts** `array`

Requested IDs that could not be returned.

**data.summary** `object`

Requested/success/failed counts and represented vocabularies/domains.

**meta** `object`

Request metadata.

**meta.request\_id** `string`

Request correlation ID.

**meta.timestamp** `string`

Response timestamp.

**meta.vocab\_release** `string`

Vocabulary release used.

**meta.query\_time\_ms** `number`

Server query duration.

```json theme={null}
{
  "success": true,
  "data": {
    "concepts": [
      {
        "concept_id": 320128,
        "concept_name": "Essential hypertension",
        "concept_code": "59621000",
        "vocabulary_id": "SNOMED",
        "domain_id": "Condition",
        "concept_class_id": "Clinical Finding",
        "standard_concept": "S",
        "valid_start_date": "1970-01-01",
        "valid_end_date": "2099-12-31",
        "invalid_reason": null,
        "synonyms": ["High blood pressure"],
        "relationships": {
          "parents": [
            {
              "relationship_id": "Is a",
              "concept_id": 4182210,
              "concept_name": "Hypertensive disorder"
            }
          ],
          "children": []
        }
      },
      {
        "concept_id": 201826,
        "concept_name": "Type 2 diabetes mellitus",
        "concept_code": "44054006",
        "vocabulary_id": "SNOMED",
        "domain_id": "Condition",
        "concept_class_id": "Clinical Finding",
        "standard_concept": "S",
        "valid_start_date": "1970-01-01",
        "valid_end_date": "2099-12-31",
        "invalid_reason": null,
        "synonyms": [
          {
            "concept_synonym_name": "Type II diabetes mellitus",
            "language_concept_id": 4180186,
            "language_concept_name": "English"
          },
          {
            "concept_synonym_name": "Adult-onset diabetes",
            "language_concept_id": 4180186,
            "language_concept_name": "English"
          }
        ],
        "relationships": [
          {
            "relationship_id": "Is a",
            "target_concept_id": 73211009,
            "target_concept_name": "Diabetes mellitus",
            "target_vocabulary_id": "SNOMED",
            "relationship_direction": "outbound"
          }
        ]
      },
      {
        "concept_id": 4329847,
        "concept_name": "Myocardial infarction",
        "concept_code": "22298006",
        "vocabulary_id": "SNOMED",
        "domain_id": "Condition",
        "concept_class_id": "Clinical Finding",
        "standard_concept": "S",
        "valid_start_date": "1970-01-01",
        "valid_end_date": "2099-12-31",
        "invalid_reason": null,
        "synonyms": [
          {
            "concept_synonym_name": "Heart attack",
            "language_concept_id": 4180186,
            "language_concept_name": "English"
          },
          {
            "concept_synonym_name": "MI - Myocardial infarction",
            "language_concept_id": 4180186,
            "language_concept_name": "English"
          }
        ],
        "relationships": [
          {
            "relationship_id": "Is a",
            "target_concept_id": 134057,
            "target_concept_name": "Acute myocardial infarction",
            "target_vocabulary_id": "SNOMED",
            "relationship_direction": "inbound"
          }
        ]
      }
    ],
    "failed_concepts": [],
    "summary": {
      "total_requested": 3,
      "successful_retrievals": 3,
      "failed_retrievals": 0,
      "vocabularies_represented": ["SNOMED"],
      "domains_represented": ["Condition"]
    }
  },
  "meta": {
    "request_id": "req_batch_123",
    "timestamp": "2024-12-22T10:00:00Z",
    "vocab_release": "2025.2",
    "query_time_ms": 45.2
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.