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

# Tag content to 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>

Query the Knowledge Graph's [Academic Standards](/knowledge-graph/graph-reference/academic-standards) for middle school math standards in California.

## What you'll do

* Query the Knowledge Graph for the California math standards framework
* Narrow down to specific grades' standards groupings (i.e., middle school)
* List all individual middle school math standards in California
* Use your findings to tag your educational content accordingly

## What you'll need

* API key and base URL in the [Learning Commons Platform](https://platform.learningcommons.org/?utm_source=docs\&utm_medium=knowledge-graph) ↗
* [`curl`](https://github.com/curl/curl) ↗, Python, or Node

## Steps

<Steps>
  <Step title="Set up environment variables">
    ```text .env theme={null}
    API_KEY=your_api_key_here
    BASE_URL=https://api.learningcommons.org/knowledge-graph/v0
    ```
  </Step>

  <Step title="Get the California math standards framework">
    <Note>
      Reference the [Academic Standards](/knowledge-graph/graph-reference/academic-standards) docs for the underlying entities and relationships.
    </Note>

    Use the [`GET /standards-frameworks`](/api-reference/standards-frameworks/standards-frameworks) API endpoint with `jurisdiction` and `academicSubject` filters:

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

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

  <Step title="Narrow down to middle school standard groupings">
    <Note>
      States often group their standards by clusters, domains, etc. These sets of
      related standards are called standard groupings.
    </Note>

    Use the [`GET /academic-standards`](/api-reference/academic-standards/academic-standards-in-a-framework) API endpoint with `normalizedStatementType` and `gradeLevel` filters:

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

    ```json Response 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"]
      }
      //...
    ]
    ```

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

  <Step title="Get individual standards">
    Change the [`GET /academic-standards`](/api-reference/academic-standards/academic-standards-in-a-framework) request's `normalizedStatementType` filter from "Standard Grouping" to "Standard":

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

    Filter on a specific Standard Grouping for more specificity:

    ```json Response for standards within cluster 8.G.B 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"]
      }
      // ...
    ]
    ```
  </Step>

  <Step title="Apply your findings">
    Use these results to inform how you tag your educational math content for middle school students in CA.

    You can also continue exploring by:

    * Querying different grade levels, subjects, and states
    * Exploring other [API endpoints](/api-reference/platform-api/overview)
  </Step>
</Steps>
