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

# Quickstart

> Get your first sustainability data from the Hey Chocolate API in under 5 minutes.

## Prerequisites

* A Hey Chocolate account with an API key ([sign up here](https://dashboard.heychocolate.com))
* A tool to make GraphQL requests (cURL, Postman, or any GraphQL client)

## Step 1: Get your API key

Navigate to the [Dashboard](https://dashboard.heychocolate.com) and create a new API key under **Settings > API Keys**.

<Warning>
  Keep your API key secret. Never expose it in client-side code. Use server-side requests or a backend proxy.
</Warning>

## Step 2: Make your first query

Send a GraphQL request to the Hey Chocolate API endpoint:

```bash theme={null}
curl -X POST https://api.heychocolate.com/graphql \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{
    "query": "{ products(first: 5) { edges { node { id name sectorTag impactScore { co2Equivalent mkiScore unit } } } } }"
  }'
```

**Response:**

```json theme={null}
{
  "data": {
    "products": {
      "edges": [
        {
          "node": {
            "id": "prod_abc123",
            "name": "Bio-based Window Frame",
            "sectorTag": "HIGHTECH_MANUFACTURING",
            "impactScore": {
              "co2Equivalent": 12.4,
              "mkiScore": 0.87,
              "unit": "kg_co2e"
            }
          }
        }
      ]
    }
  }
}
```

## Step 3: Calculate an impact score

Use the `calculateImpact` mutation to compute a real-time sustainability score:

```graphql theme={null}
mutation {
  calculateImpact(input: {
    productId: "prod_abc123"
    quantity: 100
    transportMethod: TRUCK
    distance: 250
    distanceUnit: KM
  }) {
    totalCo2Equivalent
    mkiScore
    equivalency {
      description
      value
      icon
    }
  }
}
```

**Response:**

```json theme={null}
{
  "data": {
    "calculateImpact": {
      "totalCo2Equivalent": 1240.0,
      "mkiScore": 87.0,
      "equivalency": {
        "description": "Equivalent to driving a car",
        "value": "4,800 km",
        "icon": "car"
      }
    }
  }
}
```

## Step 4: Explore further

<CardGroup cols={2}>
  <Card title="Core Concepts" icon="lightbulb" href="/core-concepts/overview">
    Learn about calculators, scenarios, and the equivalency engine.
  </Card>

  <Card title="SDKs & Widgets" icon="puzzle-piece" href="/apps/overview">
    Drop in pre-built components for instant sustainability features.
  </Card>

  <Card title="Compliance" icon="shield-check" href="/compliance/dpp">
    Generate Digital Product Passports and EPD reports.
  </Card>

  <Card title="Full API Reference" icon="code" href="/api-reference/introduction">
    Explore every query, mutation, and type in the GraphQL schema.
  </Card>
</CardGroup>
