> For the complete documentation index, see [llms.txt](https://carbonlink.gitbook.io/carbonlink-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://carbonlink.gitbook.io/carbonlink-api/installation.md).

# Installation

Get setup with our developer toolkits.

{% hint style="success" %}
**Receiving an Access Code:** Our API is currently in Beta. To gain Beta access, please [Book a Demo](https://www.carbonlink.io) to learn more about our API and receive your Access Code! Your Access Code will be required before you can generate your **API Key**.
{% endhint %}

## Get your API Keys

The Carbonlink API uses API Keys to authenticate requests. You can generate, view and manage your API Keys from within the [**Carbonlink** **Dashboard**](https://carbonlink.gitbook.io/carbonlink-api/www.carbonlink.app).

Your API Keys carry many privileges and should be kept secure at all times! Under no circumstances do we recommend you share your secret API Keys in publicly accessible areas such as GitHub, client-side code, and so forth.

Depending on your framework, you may use your API Key in the initial configuration of the **Carbonlink SDK** within your application code or in a **cURL request header**. Each request to the API that is configured with a valid API Key will be authenticated and sent through.

It's worth noting that all API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). API requests made over an unsecure HTTP channel or without a valid API Key will fail.

{% hint style="info" %}
**Development & Testing:** :hammer\_pick: We are working on a solution to provide API Keys for a testing environment for you to use while your application is still in development.
{% endhint %}

## Install the SDK

{% hint style="danger" %}
**SDK Unavailable:** While we work on bringing you the most accessible and safe-to-use Software Development Kit for your specific runtime, please continue using HTTPS requests with your command line tool or web API of choice.&#x20;
{% endhint %}

The best way to interact with our API is to use our official library and SDK. Open a command terminal and type the following expression according to your programming language of choice:

{% tabs %}
{% tab title="Node" %}

```
// Install via NPM (Not available)
// npm install --save carbonlink
```

{% endtab %}

{% tab title="Python" %}

```
# Install via pip (Not available)
# pip install carbonlink
```

{% endtab %}
{% endtabs %}

If you received an error on this step, please be sure to install the latest version of [NPM](https://docs.npmjs.com/cli/v9/configuring-npm/install) or your preferred language's default package manager. Otherwise, contact <hello@carbonlink.io> and we will be happy to answer any questions you may have.

## Make your first request

Now that you have your API Key, you can send an authenticated request to the `estimate` endpoint to generate an **Estimate**.

{% content-ref url="/pages/ynWn2NcKjjImNrGpXmoa" %}
[Estimate](/carbonlink-api/core/api-reference/estimate.md)
{% endcontent-ref %}

Take a look at how you might call this method using our official libraries, or via `curl`:

{% tabs %}
{% tab title="curl" %}

```
curl https://api.carbonlink.io/v1/estimates  
    -u {YOUR_API_KEY}:  
    -d kgCO2e=123.23    
    -d customerRef='CUSTOMER-EMAIL'
```

{% endtab %}

{% tab title="Node" %}

```typescript
// require the myapi module and set it up with your API key
const carbonlink = require('carbonlink')(YOUR_API_KEY);

const estimateObject = await carbonlink.estimate.create({
    kgCO2e: 123.12,
    customerRef: 'id_1AneEH19c42',
})

console.log('My first estimate!', estimateObject.estimateId);
```

{% endtab %}

{% tab title="Python" %}

<pre class="language-python"><code class="lang-python">from carbonlink import Carbonlink

// Set your API key before making the request
carbonlink = Carbonlink('YOUR_API_KEY')

estimate_object = carbonlink.estimate.create(
<strong>    kgCO2e: 123.12,
</strong>    customerRef: 'id_1AneEH19c42',
)

print(f'My first estimate! {estimate_object.estimateId}')
</code></pre>

{% endtab %}
{% endtabs %}
