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

# Working with state standards

> Learn how to query Knowledge Graph standards frameworks and individual standards, with optional embedding generation for vector search.

export const EarlyAccessCallout = ({children}) => <div className="eyebrow-callout not-prose rounded-xl border border-gray-200/80 p-5 dark:border-white/10" style={{
  marginBottom: "1rem",
  borderRadius: "4px"
}}>
    <div className="mb-3">
      <Badge color="green" size="md" icon="flask">
        Early access
      </Badge>
    </div>
    <div className="callout-body text-[15px] leading-relaxed text-gray-700 dark:text-gray-300">{children}</div>
    <style>{`.callout-body a { text-decoration: underline; text-decoration-color: #178251; }`}</style>
  </div>;

<EarlyAccessCallout>
  The API is in early access and is actively evolving. We will continue expanding it, and breaking changes may occur as we improve accuracy and reliability. Email [support@learningcommons.org](mailto:support@learningcommons.org) ↗ with your feedback or issues.
</EarlyAccessCallout>

This tutorial shows you how to use Knowledge Graph to access state standards and apply them to common content-tagging and content-creation workflows.

State standards are modeled in Knowledge Graph as two core entities: `StandardsFramework `and `StandardsFrameworkItem`. Learn more about these entities in the Academic Standards data reference.

Here is how the standards data is modeled.

<Frame>
  <img src="https://mintcdn.com/czi-60a2a443/bb-F2r75Gz83PPsi/images/kg/standards-dataset_data-model-diagram_high-level-v2.svg?fit=max&auto=format&n=bb-F2r75Gz83PPsi&q=85&s=63579fc19f128f4553057ae2ccf4f73d" alt="Data model diagram: StandardsFramework and StandardsFrameworkItem entities linked by hasChild, supports, and hasEducationalAlignment to LearningComponent and Course" width="920" height="1200" data-path="images/kg/standards-dataset_data-model-diagram_high-level-v2.svg" />
</Frame>

<Accordion title="Diagram description">
  The diagram shows only the **standards** dataset. Other entity types (`LearningComponent`, `Course`) appear as connection targets; their models are in [Learning components](/knowledge-graph/entity-and-relationship-reference/learning-components) and [Curriculum](/knowledge-graph/entity-and-relationship-reference/curriculum).

  **Example (New York):** A **StandardsFramework** is the root document for a jurisdiction’s standards—e.g. *New York State Mathematics Learning Standards*. That framework is one node. A **domain** is an organizational grouping within that framework (a type of `StandardsFrameworkItem` with `statementType` such as "Domain" or "Cluster"), e.g. *Operations and Algebraic Thinking* or *Number & Operations—Fractions*. **Standards** are the individual learning expectations (also `StandardsFrameworkItem`), often with codes like `3.NF.A.1`; they may sit under domains or under other groupings. The graph is a tree: framework → top-level items (e.g. domains) → … → leaf items (the actual standards).

  **Edge list (source → relationship → target):**

  * `StandardsFramework` → `hasChild` → `StandardsFrameworkItem` (e.g. New York Math framework → its top-level domains or groupings)
  * `StandardsFrameworkItem` → `hasChild` → `StandardsFrameworkItem` (e.g. domain → cluster, or cluster → standard)
  * `LearningComponent` → `supports` → `StandardsFrameworkItem` (granular skill supports a standard)
  * `Course` → `hasEducationalAlignment` → `StandardsFrameworkItem` (curriculum aligns to a standard)

  So: one framework roots a tree of items via `hasChild`; items can also be linked from learning components (`supports`) and from curriculum (`hasEducationalAlignment`). The diagram does not show learning-progression edges (`buildsTowards`, `relatesTo`); see [Learning progressions](/knowledge-graph/entity-and-relationship-reference/learning-progressions).
</Accordion>

## What you'll do

* Using standards identifiers to find deeper-level relationships

## What you'll need

* An API key generated in the [Learning Commons Platform](https://platform.learningcommons.org/) ↗
* Node or Python (optional, for running code examples)

## STEP 1: Set up environment variables

1. Set up your environment variables for your API key and base URL:

```shell theme={null}
# .env

# Knowledge Graph API credentials - get these from the Learning Commons Portal
API_KEY=your_api_key_here
BASE_URL=https://api.learningcommons.org/knowledge-graph/v0
```

## STEP 2: Query for standards data

1. Use the `/standards-frameworks` endpoint to get the California math standards framework:

<CodeGroup>
  ```shell cURL theme={null}
  curl -X GET \
    -H "x-api-key: YOUR_API_KEY" \
    "https://api.learningcommons.org/knowledge-graph/v0/standards-frameworks?jurisdiction=California&academicSubject=Mathematics"
  ```

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

  api_key = os.getenv("API_KEY")
  base_url = os.getenv("BASE_URL")

  headers = {"x-api-key": api_key}

  # Get California math standards framework
  response = requests.get(
      f"{base_url}/standards-frameworks",
      headers=headers,
      params={
          "jurisdiction": "California",
          "academicSubject": "Mathematics"
      }
  )

  result = response.json()
  california_framework = result["data"][0] if result["data"] else None
  print(f'✅ Retrieved California math standards framework:')
  print(california_framework)
  ```

  ```javascript JavaScript theme={null}
  const apiKey = process.env.API_KEY;
  const baseUrl = process.env.BASE_URL;

  // Get California math standards framework
  const response = await fetch(
    `${baseUrl}/standards-frameworks?jurisdiction=California&academicSubject=Mathematics`,
    {
      method: "GET",
      headers: { "x-api-key": apiKey },
    },
  );

  const result = await response.json();
  const californiaFramework = result.data[0] || null;
  console.log("✅ Retrieved California math standards framework:");
  console.log(californiaFramework);
  ```
</CodeGroup>

The returned data for California math standards framework should look like this:

```json theme={null}
{
  "caseIdentifierUUID": "c6487102-d7cb-11e8-824f-0242ac160002",
  "name": "California Common Core State Standards - Mathematics",
  "jurisdiction": "California",
  "academicSubject": "Mathematics"
}
```

2. Use the `/academic-standards` endpoint with filters to get middle school standard groupings within the California math standards framework, using the identifier returned by the previous code block. To show specificity, we're going to look for middle school standards groupings. The standards groupings are useful if you're looking to get a set of standards that states tend to group by names like clusters, domains, etc.

<CodeGroup>
  ```shell cURL theme={null}
  # Replace YOUR_FRAMEWORK_UUID with the caseIdentifierUUID from the previous step
  curl -X GET \
    -H "x-api-key: YOUR_API_KEY" \
    "https://api.learningcommons.org/knowledge-graph/v0/academic-standards?standardsFrameworkCaseIdentifierUUID=YOUR_FRAMEWORK_UUID&normalizedStatementType=Standard%20Grouping&gradeLevel=6&gradeLevel=7&gradeLevel=8"
  ```

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

  api_key = os.getenv("API_KEY")
  base_url = os.getenv("BASE_URL")
  framework_uuid = "c6487102-d7cb-11e8-824f-0242ac160002"  # California Math from Step 2

  headers = {"x-api-key": api_key}

  # Get middle school standard groupings
  response = requests.get(
      f"{base_url}/academic-standards",
      headers=headers,
      params={
          "standardsFrameworkCaseIdentifierUUID": framework_uuid,
          "normalizedStatementType": "Standard Grouping",
          "gradeLevel": ["6", "7", "8"]
      }
  )

  result = response.json()
  groupings = result["data"]
  print(f'✅ Retrieved {len(groupings)} standard groupings for middle school math in California')
  for grouping in groupings[:5]:
      print(f'  {grouping["statementCode"]}: {grouping["description"][:80]}...')
  ```

  ```javascript JavaScript theme={null}
  const apiKey = process.env.API_KEY;
  const baseUrl = process.env.BASE_URL;
  const frameworkUuid = "c6487102-d7cb-11e8-824f-0242ac160002"; // California Math from Step 2

  // Get middle school standard groupings
  const params = new URLSearchParams({
    standardsFrameworkCaseIdentifierUUID: frameworkUuid,
    normalizedStatementType: "Standard Grouping",
  });
  // Add multiple grade levels
  ["6", "7", "8"].forEach((grade) => params.append("gradeLevel", grade));

  const response = await fetch(`${baseUrl}/academic-standards?${params}`, {
    method: "GET",
    headers: { "x-api-key": apiKey },
  });

  const result = await response.json();
  const groupings = result.data;
  console.log(
    `✅ Retrieved ${groupings.length} standard groupings for middle school math in California`,
  );
  groupings.slice(0, 5).forEach((g) => {
    console.log(`  ${g.statementCode}: ${g.description.substring(0, 80)}...`);
  });
  ```
</CodeGroup>

The returned data for California middle school math standard clusters and domains should look like this:

<Note>
  Some `StandardsFrameworkItems` won't have a `statementCode`, depending on how a given state has published its standards framework.
</Note>

```json theme={null}
[
  {
    "caseIdentifierUUID": "5ebeb890-d7cc-11e8-824f-0242ac160002",
    "statementCode": "6.RP.A",
    "description": "Understand ratio concepts and use ratio reasoning to solve problems.",
    "normalizedStatementType": "Standard Grouping",
    "statementType": "Cluster",
    "gradeLevel": ["6"]
  }
  //...
]
```

3. Use the `/academic-standards` endpoint to get individual standards for all of middle school math in California:

<CodeGroup>
  ```shell cURL theme={null}
  # Replace YOUR_FRAMEWORK_UUID with the caseIdentifierUUID from Step 2
  curl -X GET \
    -H "x-api-key: YOUR_API_KEY" \
    "https://api.learningcommons.org/knowledge-graph/v0/academic-standards?standardsFrameworkCaseIdentifierUUID=YOUR_FRAMEWORK_UUID&normalizedStatementType=Standard&gradeLevel=6&gradeLevel=7&gradeLevel=8"
  ```

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

  api_key = os.getenv("API_KEY")
  base_url = os.getenv("BASE_URL")
  framework_uuid = "c6487102-d7cb-11e8-824f-0242ac160002"  # California Math

  headers = {"x-api-key": api_key}

  # Get middle school standards
  response = requests.get(
      f"{base_url}/academic-standards",
      headers=headers,
      params={
          "standardsFrameworkCaseIdentifierUUID": framework_uuid,
          "normalizedStatementType": "Standard",
          "gradeLevel": ["6", "7", "8"]
      }
  )

  result = response.json()
  standards = result["data"]
  print(f'✅ Retrieved {len(standards)} standards for California middle school mathematics')
  for standard in standards[:5]:
      print(f'  {standard["statementCode"]}: {standard["description"][:80]}...')
  ```

  ```javascript JavaScript theme={null}
  const apiKey = process.env.API_KEY;
  const baseUrl = process.env.BASE_URL;
  const frameworkUuid = "c6487102-d7cb-11e8-824f-0242ac160002"; // California Math

  // Get middle school standards
  const params = new URLSearchParams({
    standardsFrameworkCaseIdentifierUUID: frameworkUuid,
    normalizedStatementType: "Standard",
  });
  ["6", "7", "8"].forEach((grade) => params.append("gradeLevel", grade));

  const response = await fetch(`${baseUrl}/academic-standards?${params}`, {
    method: "GET",
    headers: { "x-api-key": apiKey },
  });

  const result = await response.json();
  const standards = result.data;
  console.log(
    `✅ Retrieved ${standards.length} standards for California middle school mathematics`,
  );
  standards.slice(0, 5).forEach((s) => {
    console.log(`  ${s.statementCode}: ${s.description.substring(0, 80)}...`);
  });
  ```
</CodeGroup>

<Note>
  If we wanted to, we could also filter on a specific Standard Grouping to specify even further.
</Note>

The returned data for the standards within cluster 8.G.B should look like this:

```json theme={null}
[
  {
    "caseIdentifierUUID": "5ec25ed1-d7cc-11e8-824f-0242ac160002",
    "statementCode": "8.EE.B.5",
    "description": "Graph proportional relationships, interpreting the unit rate...",
    "normalizedStatementType": "Standard",
    "gradeLevel": ["8"]
  }
  // ...
]
```

<Tip>
  Try querying additional grades or subjects, swapping in another state, or integrating this data into your content tagging workflow.
</Tip>
