Account Info

Used to retrieve information and status of your account.

curl https://api.cloverly.com/2019-03-beta/account \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.get do |req|
  req.url '/2019-03-beta/account'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    url: 'https://api.cloverly.com/2019-03-beta/account',
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"

func main() {
  client := &http.Client{}

  req, _ := http.NewRequest("GET", "https://api.cloverly.com/2019-03-beta/account", nil)
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/account'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
r = requests.get(url, headers=headers)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/account");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes

None

Response
{
  "name": "string",
  "owner": {
    "name": "string",
    "email": "string"
  },
  "balance_in_usd_cents": "number",
  "production_enabled?": "boolean",
  "environment": "string"
}
List offsets

Get a list of all currently available offsets. Any purchase or estimate call below accepts targeting specific offset via a offset_slug value.

curl https://api.cloverly.com/2019-03-beta/offsets \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.get do |req|
  req.url '/2019-03-beta/offsets'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    url: 'https://api.cloverly.com/2019-03-beta/offsets',
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"

func main() {
  client := &http.Client{}

  req, _ := http.NewRequest("GET", "https://api.cloverly.com/2019-03-beta/offsets", nil)
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/offsets'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
r = requests.get(url, headers=headers)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/offsets");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes

None

Response
[
  {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  }
]
Show the details of a specific offset

Get the details of a specific offset.

curl https://api.cloverly.com/2019-03-beta/offsets/:offset_slug \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.get do |req|
  req.url '/2019-03-beta/offsets/:offset_slug'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    url: 'https://api.cloverly.com/2019-03-beta/offsets/:offset_slug',
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"

func main() {
  client := &http.Client{}

  req, _ := http.NewRequest("GET", "https://api.cloverly.com/2019-03-beta/offsets/:offset_slug", nil)
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/offsets/:offset_slug'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
r = requests.get(url, headers=headers)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/offsets/:offset_slug");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
Required
`offset_slug`The slug for the offset
Message Body Attributes

None

Response
{
  "slug": "string",
  "name": "string",
  "city": "string",
  "province": "string",
  "country": "string",
  "offset_type": "string",
  "offset_type_slug": "string",
  "total_capacity": "string",
  "latlng": "string",
  "technical_details": "string",
  "available_carbon_in_kg": "string",
  "pretty_url": "string"
}

How to match offsets

Use this matching functionality when creating an estimate or purchase to match offsets by type, location, or exact slug.

By default, Cloverly API matches based on low-cost. The Cloverly API will match anywhere in the world with low cost. Using offset matching changes that behavior. By including a `type`, then the Cloverly API will require a particular offset type, and then sort by low cost. If a location is included, then the API will sort by closest offset to that location first.

Examples

Matching solar closest to Mountain View, CA

"offset_match": {"type": "solar", "location":{"postal_code":"94043","country":"US"} 

Example matching wind to a latitutde / longitude in New Hampshire

"offset_match": {"type": "solar", "location":{"latlng": [41.1609216,-76.6826642]} 

Matching offset to an airport

"offset_match": {"location": {"airport": "sfo"}} 

Example matching biomass. (For a full list of available offset types, see offset types below.)

"offset_match": {"type": "biomass"} 

Example matching specific offset

"offset_match": {"slug": "arcata-city-forest-barnum-tract-f07113"} 
Full Example

Matching solar closest to Mountain View, CA for 200 kwh of electricity

curl https://api.cloverly.com/2019-03-beta/purchases/electricity \
-X POST \
-d '{"energy":{"value":200,"units":"kwh"},"offset_match":{"type":"solar","location":{"postal_code":"94043","country":"US"}}}' \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.post do |req|
  req.url '/2019-03-beta/purchases/electricity'
  req.body = '{"energy":{"value":200,"units":"kwh"},"offset_match":{"type":"solar","location":{"postal_code":"94043","country":"US"}}}'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'post',
    url: 'https://api.cloverly.com/2019-03-beta/purchases/electricity',
    body: JSON.stringify({"energy":{"value":200,"units":"kwh"},"offset_match":{"type":"solar","location":{"postal_code":"94043","country":"US"}}}),
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"
import "bytes"

func main() {
  client := &http.Client{}

  var requestData = []byte(`{"energy":{"value":200,"units":"kwh"},"offset_match":{"type":"solar","location":{"postal_code":"94043","country":"US"}}}`)
  req, _ := http.NewRequest("POST", "https://api.cloverly.com/2019-03-beta/purchases/electricity", bytes.NewBuffer(requestData))
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/purchases/electricity'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
data = '{"energy":{"value":200,"units":"kwh"},"offset_match":{"type":"solar","location":{"postal_code":"94043","country":"US"}}}'
r = requests.post(url, headers=headers, data=data)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/purchases/electricity");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"energy":{"value":200,"units":"kwh"},"offset_match":{"type":"solar","location":{"postal_code":"94043","country":"US"}}}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
List the offset types which can be used for filtering

Get a full list of offset types that can be used for filtering offsets. Use the `slug` returned here in the `offset_match` syntax above.

curl https://api.cloverly.com/2019-03-beta/offset-types \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.get do |req|
  req.url '/2019-03-beta/offset-types'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    url: 'https://api.cloverly.com/2019-03-beta/offset-types',
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"

func main() {
  client := &http.Client{}

  req, _ := http.NewRequest("GET", "https://api.cloverly.com/2019-03-beta/offset-types", nil)
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/offset-types'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
r = requests.get(url, headers=headers)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/offset-types");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
None
Response
[
  {
    "slug": "string",
    "name": "string",
    "description": "string"
  }
]
List all purchases for your account

Get the full list of purchases for account.

curl https://api.cloverly.com/2019-03-beta/purchases \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.get do |req|
  req.url '/2019-03-beta/purchases'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    url: 'https://api.cloverly.com/2019-03-beta/purchases',
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"

func main() {
  client := &http.Client{}

  req, _ := http.NewRequest("GET", "https://api.cloverly.com/2019-03-beta/purchases", nil)
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/purchases'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
r = requests.get(url, headers=headers)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/purchases");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
Optional
`offset_slug`Filter to a specific offset
`before`epoch to choose the latest before a certain time (used for pagination)
Response
[
  {
    "slug": "string",
    "environment": "string",
    "state": "string",
    "renewable_energy_certificate": {
      "slug": "string",
      "name": "string",
      "city": "string",
      "province": "string",
      "country": "string",
      "renewable_type": "string",
      "total_capacity": "string",
      "latlng": "string",
      "technical_details": "string",
      "deprecated": "string"
    },
    "micro_rec_count": "number",
    "micro_units": "number",
    "offset": {
      "slug": "string",
      "name": "string",
      "city": "string",
      "province": "string",
      "country": "string",
      "offset_type": "string",
      "offset_type_slug": "string",
      "total_capacity": "string",
      "latlng": "string",
      "technical_details": "string",
      "available_carbon_in_kg": "string",
      "pretty_url": "string"
    },
    "total_cost_in_usd_cents": "number",
    "estimated_at": "string",
    "purchased_at": "string",
    "equivalent_carbon_in_kg": "number",
    "electricity_in_kwh": "string",
    "rec_cost_in_usd_cents": "number",
    "transaction_cost_in_usd_cents": "number",
    "pretty_url": "string"
  }
]
Show the details for a specific purchase

Get the details of a specific purchase

curl https://api.cloverly.com/2019-03-beta/purchases/:purchase_slug \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.get do |req|
  req.url '/2019-03-beta/purchases/:purchase_slug'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    url: 'https://api.cloverly.com/2019-03-beta/purchases/:purchase_slug',
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"

func main() {
  client := &http.Client{}

  req, _ := http.NewRequest("GET", "https://api.cloverly.com/2019-03-beta/purchases/:purchase_slug", nil)
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/purchases/:purchase_slug'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
r = requests.get(url, headers=headers)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/purchases/:purchase_slug");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
Required
`purchase_slug`The slug for the purchase
Message Body Attributes
None
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "purchased_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
Convert an estimate into a purchase

After creating an estimate, use this endpoint to convert that estimate to a purchase.

curl https://api.cloverly.com/2019-03-beta/purchases \
-X POST \
-d '{"estimate_slug":"{estimate_slug}"}' \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.post do |req|
  req.url '/2019-03-beta/purchases'
  req.body = '{"estimate_slug":"{estimate_slug}"}'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'post',
    url: 'https://api.cloverly.com/2019-03-beta/purchases',
    body: JSON.stringify({"estimate_slug":"{estimate_slug}"}),
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"
import "bytes"

func main() {
  client := &http.Client{}

  var requestData = []byte(`{"estimate_slug":"{estimate_slug}"}`)
  req, _ := http.NewRequest("POST", "https://api.cloverly.com/2019-03-beta/purchases", bytes.NewBuffer(requestData))
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/purchases'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
data = '{"estimate_slug":"{estimate_slug}"}'
r = requests.post(url, headers=headers, data=data)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/purchases");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"estimate_slug":"{estimate_slug}"}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
Required
`estimate_slug`The slug for a previously created estimate to be converted to a purchase
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "purchased_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
Purchase an offset with a fixed price

Set the price you would like to pay, then, we calculate the amount of an offset available at that price.

curl https://api.cloverly.com/2019-03-beta/purchases/currency \
-X POST \
-d '{"currency":{"value":357,"units":"usd cents"}}' \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.post do |req|
  req.url '/2019-03-beta/purchases/currency'
  req.body = '{"currency":{"value":357,"units":"usd cents"}}'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'post',
    url: 'https://api.cloverly.com/2019-03-beta/purchases/currency',
    body: JSON.stringify({"currency":{"value":357,"units":"usd cents"}}),
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"
import "bytes"

func main() {
  client := &http.Client{}

  var requestData = []byte(`{"currency":{"value":357,"units":"usd cents"}}`)
  req, _ := http.NewRequest("POST", "https://api.cloverly.com/2019-03-beta/purchases/currency", bytes.NewBuffer(requestData))
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/purchases/currency'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
data = '{"currency":{"value":357,"units":"usd cents"}}'
r = requests.post(url, headers=headers, data=data)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/purchases/currency");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"currency":{"value":357,"units":"usd cents"}}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
Required
`currency: {value: INTEGER, units: STRING}`The fixed amount to be spent on this purchase, where "units" can be one of `usd` or `usd cents`.
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "purchased_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
Purchase an offset for carbon

Used to purchase offset for carbon

curl https://api.cloverly.com/2019-03-beta/purchases/carbon \
-X POST \
-d '{"weight":{"value":35,"units":"kg"}}' \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.post do |req|
  req.url '/2019-03-beta/purchases/carbon'
  req.body = '{"weight":{"value":35,"units":"kg"}}'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'post',
    url: 'https://api.cloverly.com/2019-03-beta/purchases/carbon',
    body: JSON.stringify({"weight":{"value":35,"units":"kg"}}),
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"
import "bytes"

func main() {
  client := &http.Client{}

  var requestData = []byte(`{"weight":{"value":35,"units":"kg"}}`)
  req, _ := http.NewRequest("POST", "https://api.cloverly.com/2019-03-beta/purchases/carbon", bytes.NewBuffer(requestData))
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/purchases/carbon'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
data = '{"weight":{"value":35,"units":"kg"}}'
r = requests.post(url, headers=headers, data=data)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/purchases/carbon");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"weight":{"value":35,"units":"kg"}}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
Required
`weight: {value: INTEGER, units: STRING}`The amount of carbon to offset where "units" can be `kg`, `grams`, or `pounds`.
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "purchased_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
Purchase a shipping offset

Used to offset shipping emissions

curl https://api.cloverly.com/2019-03-beta/purchases/shipping \
-X POST \
-d '{"from":{"zip":"35209"},"to":{"zip":"94043"},"weight":{"value":94,"units":"kg"}}' \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.post do |req|
  req.url '/2019-03-beta/purchases/shipping'
  req.body = '{"from":{"zip":"35209"},"to":{"zip":"94043"},"weight":{"value":94,"units":"kg"}}'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'post',
    url: 'https://api.cloverly.com/2019-03-beta/purchases/shipping',
    body: JSON.stringify({"from":{"zip":"35209"},"to":{"zip":"94043"},"weight":{"value":94,"units":"kg"}}),
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"
import "bytes"

func main() {
  client := &http.Client{}

  var requestData = []byte(`{"from":{"zip":"35209"},"to":{"zip":"94043"},"weight":{"value":94,"units":"kg"}}`)
  req, _ := http.NewRequest("POST", "https://api.cloverly.com/2019-03-beta/purchases/shipping", bytes.NewBuffer(requestData))
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/purchases/shipping'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
data = '{"from":{"zip":"35209"},"to":{"zip":"94043"},"weight":{"value":94,"units":"kg"}}'
r = requests.post(url, headers=headers, data=data)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/purchases/shipping");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"from":{"zip":"35209"},"to":{"zip":"94043"},"weight":{"value":94,"units":"kg"}}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
Required
`weight: {value: INTEGER, units: STRING}`The amount of carbon to offset

Choose 1 of the following methods for calculating distance:

Using ZIP Codes
`from: {zip: STRING}`The origin zip code
`to: {zip: STRING}`The destination zip code
Using UK Postal Codes Codes
`from: {uk_postal_code: STRING}`The origin UK postal code
`to: {uk_postal_code: STRING}`The destination UK postal code
Using Latitude-longitude
`from: {latlng: [FLOAT, FLOAT]}`The origin latitude and longitude
`to: {latlng: [FLOAT, FLOAT]}`The destination latitude and longitude
Using Distance
`distance: {value: INTEGER, units: STRING}`The distance where units can be "km" or "miles"
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "purchased_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
Purchase vehicle offset

Offset emissions of vechicle transportation using gasoline or diesel.

curl https://api.cloverly.com/2019-03-beta/purchases/vehicle \
-X POST \
-d '{"distance":{"value":55,"units":"km"},"fuel_efficiency":{"value":25,"units":"mpg","of":"gasoline"}}' \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.post do |req|
  req.url '/2019-03-beta/purchases/vehicle'
  req.body = '{"distance":{"value":55,"units":"km"},"fuel_efficiency":{"value":25,"units":"mpg","of":"gasoline"}}'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'post',
    url: 'https://api.cloverly.com/2019-03-beta/purchases/vehicle',
    body: JSON.stringify({"distance":{"value":55,"units":"km"},"fuel_efficiency":{"value":25,"units":"mpg","of":"gasoline"}}),
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"
import "bytes"

func main() {
  client := &http.Client{}

  var requestData = []byte(`{"distance":{"value":55,"units":"km"},"fuel_efficiency":{"value":25,"units":"mpg","of":"gasoline"}}`)
  req, _ := http.NewRequest("POST", "https://api.cloverly.com/2019-03-beta/purchases/vehicle", bytes.NewBuffer(requestData))
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/purchases/vehicle'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
data = '{"distance":{"value":55,"units":"km"},"fuel_efficiency":{"value":25,"units":"mpg","of":"gasoline"}}'
r = requests.post(url, headers=headers, data=data)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/purchases/vehicle");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"distance":{"value":55,"units":"km"},"fuel_efficiency":{"value":25,"units":"mpg","of":"gasoline"}}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
Required
`fuel_efficiency: {value: INTEGER, units: STRING, of: STRING}`The fuel efficiency of the vehicle, where "units" is one of 'mpg' or 'km/l' and "of" is one of "gasoline" or "diesel".
`distance: {value: INTEGER, units: STRING}`The distance to offset, where "units" is one of "miles" or "km".
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "purchased_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
Purchase flight offset

Offset emissions of airline travel

curl https://api.cloverly.com/2019-03-beta/purchases/flight \
-X POST \
-d '{"airports":["sfo","atl","fra"]}' \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.post do |req|
  req.url '/2019-03-beta/purchases/flight'
  req.body = '{"airports":["sfo","atl","fra"]}'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'post',
    url: 'https://api.cloverly.com/2019-03-beta/purchases/flight',
    body: JSON.stringify({"airports":["sfo","atl","fra"]}),
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"
import "bytes"

func main() {
  client := &http.Client{}

  var requestData = []byte(`{"airports":["sfo","atl","fra"]}`)
  req, _ := http.NewRequest("POST", "https://api.cloverly.com/2019-03-beta/purchases/flight", bytes.NewBuffer(requestData))
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/purchases/flight'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
data = '{"airports":["sfo","atl","fra"]}'
r = requests.post(url, headers=headers, data=data)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/purchases/flight");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"airports":["sfo","atl","fra"]}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
Required
`airports: ["array", "of", "airport", "codes"]An array of airport codes for the trip. The first airport should be the starting airport followed by the sequence of airports in the order of travel.
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "purchased_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
Purchase electricity offset

Purchase a renewable energy certificate for electricity

curl https://api.cloverly.com/2019-03-beta/purchases/electricity \
-X POST \
-d '{"energy":{"value":200,"units":"kwh"}}' \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.post do |req|
  req.url '/2019-03-beta/purchases/electricity'
  req.body = '{"energy":{"value":200,"units":"kwh"}}'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'post',
    url: 'https://api.cloverly.com/2019-03-beta/purchases/electricity',
    body: JSON.stringify({"energy":{"value":200,"units":"kwh"}}),
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"
import "bytes"

func main() {
  client := &http.Client{}

  var requestData = []byte(`{"energy":{"value":200,"units":"kwh"}}`)
  req, _ := http.NewRequest("POST", "https://api.cloverly.com/2019-03-beta/purchases/electricity", bytes.NewBuffer(requestData))
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/purchases/electricity'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
data = '{"energy":{"value":200,"units":"kwh"}}'
r = requests.post(url, headers=headers, data=data)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/purchases/electricity");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"energy":{"value":200,"units":"kwh"}}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
Required
`energy: {value: INTEGER, units: STRING}`The energy used, where "units" is one of 'kwh' or 'wh' for "kilowatt hours" and "watt hours" perspectively.
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "purchased_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
Cancel an offset purchase

Cancel the purchase of an offset. It is not possible to cancel offsets once they have been retired.

curl https://api.cloverly.com/2019-03-beta/purchases/:purchase_slug \
-X DELETE \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.delete do |req|
  req.url '/2019-03-beta/purchases/:purchase_slug'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'delete',
    url: 'https://api.cloverly.com/2019-03-beta/purchases/:purchase_slug',
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"

func main() {
  client := &http.Client{}

  req, _ := http.NewRequest("DELETE", "https://api.cloverly.com/2019-03-beta/purchases/:purchase_slug", nil)
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/purchases/:purchase_slug'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
r = requests.delete(url, headers=headers)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/purchases/:purchase_slug");
curl_setopt($ch, CURLOPT_DELETE, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
Required
`purchase_slug`The slug for the purchase
Message Body Attributes
None
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "purchased_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
List all estimates for your account

Get the full list of estimates for account.

curl https://api.cloverly.com/2019-03-beta/estimates \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.get do |req|
  req.url '/2019-03-beta/estimates'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    url: 'https://api.cloverly.com/2019-03-beta/estimates',
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"

func main() {
  client := &http.Client{}

  req, _ := http.NewRequest("GET", "https://api.cloverly.com/2019-03-beta/estimates", nil)
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/estimates'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
r = requests.get(url, headers=headers)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/estimates");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
Optional
`offset_slug`Filter to a specific offset
`before`epoch to choose the latest before a certain time (used for pagination)
Response
[
  {
    "slug": "string",
    "environment": "string",
    "state": "string",
    "renewable_energy_certificate": {
      "slug": "string",
      "name": "string",
      "city": "string",
      "province": "string",
      "country": "string",
      "renewable_type": "string",
      "total_capacity": "string",
      "latlng": "string",
      "technical_details": "string",
      "deprecated": "string"
    },
    "micro_rec_count": "number",
    "micro_units": "number",
    "offset": {
      "slug": "string",
      "name": "string",
      "city": "string",
      "province": "string",
      "country": "string",
      "offset_type": "string",
      "offset_type_slug": "string",
      "total_capacity": "string",
      "latlng": "string",
      "technical_details": "string",
      "available_carbon_in_kg": "string",
      "pretty_url": "string"
    },
    "total_cost_in_usd_cents": "number",
    "estimated_at": "string",
    "equivalent_carbon_in_kg": "number",
    "electricity_in_kwh": "string",
    "rec_cost_in_usd_cents": "number",
    "transaction_cost_in_usd_cents": "number",
    "pretty_url": "string"
  }
]
Show details for a specific estimate

Get the details of a specific estimate

curl https://api.cloverly.com/2019-03-beta/estimates/:estimate_slug \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.get do |req|
  req.url '/2019-03-beta/estimates/:estimate_slug'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    url: 'https://api.cloverly.com/2019-03-beta/estimates/:estimate_slug',
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"

func main() {
  client := &http.Client{}

  req, _ := http.NewRequest("GET", "https://api.cloverly.com/2019-03-beta/estimates/:estimate_slug", nil)
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/estimates/:estimate_slug'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
r = requests.get(url, headers=headers)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/estimates/:estimate_slug");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
None
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
Estimate an offset with a fixed price

Set the price you would like to pay, then, we calculate the amount of offsets available at that price.

curl https://api.cloverly.com/2019-03-beta/estimates/currency \
-X POST \
-d '{"currency":{"value":357,"units":"usd cents"}}' \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.post do |req|
  req.url '/2019-03-beta/estimates/currency'
  req.body = '{"currency":{"value":357,"units":"usd cents"}}'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'post',
    url: 'https://api.cloverly.com/2019-03-beta/estimates/currency',
    body: JSON.stringify({"currency":{"value":357,"units":"usd cents"}}),
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"
import "bytes"

func main() {
  client := &http.Client{}

  var requestData = []byte(`{"currency":{"value":357,"units":"usd cents"}}`)
  req, _ := http.NewRequest("POST", "https://api.cloverly.com/2019-03-beta/estimates/currency", bytes.NewBuffer(requestData))
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/estimates/currency'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
data = '{"currency":{"value":357,"units":"usd cents"}}'
r = requests.post(url, headers=headers, data=data)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/estimates/currency");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"currency":{"value":357,"units":"usd cents"}}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
Required
`currency: {value: INTEGER, units: STRING}`The fixed amount to be estimated, where "units" can be one of `usd` or `usd cents`.
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
Estimate an offset

Estimate an offset

curl https://api.cloverly.com/2019-03-beta/estimates/carbon \
-X POST \
-d '{"weight":{"value":35,"units":"kg"}}' \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.post do |req|
  req.url '/2019-03-beta/estimates/carbon'
  req.body = '{"weight":{"value":35,"units":"kg"}}'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'post',
    url: 'https://api.cloverly.com/2019-03-beta/estimates/carbon',
    body: JSON.stringify({"weight":{"value":35,"units":"kg"}}),
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"
import "bytes"

func main() {
  client := &http.Client{}

  var requestData = []byte(`{"weight":{"value":35,"units":"kg"}}`)
  req, _ := http.NewRequest("POST", "https://api.cloverly.com/2019-03-beta/estimates/carbon", bytes.NewBuffer(requestData))
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/estimates/carbon'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
data = '{"weight":{"value":35,"units":"kg"}}'
r = requests.post(url, headers=headers, data=data)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/estimates/carbon");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"weight":{"value":35,"units":"kg"}}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
Required
`weight: {value: INTEGER, units: STRING}`The amount of carbon to offset where "units" can be `kg`, `grams`, or `pounds`.
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
Estimate a shipping offset

Estimate an offset for shipping emissions

curl https://api.cloverly.com/2019-03-beta/estimates/shipping \
-X POST \
-d '{"from":{"zip":"35209"},"to":{"zip":"94043"},"weight":{"value":94,"units":"kg"}}' \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.post do |req|
  req.url '/2019-03-beta/estimates/shipping'
  req.body = '{"from":{"zip":"35209"},"to":{"zip":"94043"},"weight":{"value":94,"units":"kg"}}'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'post',
    url: 'https://api.cloverly.com/2019-03-beta/estimates/shipping',
    body: JSON.stringify({"from":{"zip":"35209"},"to":{"zip":"94043"},"weight":{"value":94,"units":"kg"}}),
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"
import "bytes"

func main() {
  client := &http.Client{}

  var requestData = []byte(`{"from":{"zip":"35209"},"to":{"zip":"94043"},"weight":{"value":94,"units":"kg"}}`)
  req, _ := http.NewRequest("POST", "https://api.cloverly.com/2019-03-beta/estimates/shipping", bytes.NewBuffer(requestData))
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/estimates/shipping'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
data = '{"from":{"zip":"35209"},"to":{"zip":"94043"},"weight":{"value":94,"units":"kg"}}'
r = requests.post(url, headers=headers, data=data)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/estimates/shipping");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"from":{"zip":"35209"},"to":{"zip":"94043"},"weight":{"value":94,"units":"kg"}}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
Required
`weight: {value: INTEGER, units: STRING}`The amount of carbon to offset

Choose 1 of the following methods for calculating distance:

Using ZIP Codes
`from: {zip: STRING}`The origin zip code
`to: {zip: STRING}`The destination zip code
Using Latitude-longitude
`from: {latlng: [FLOAT, FLOAT]}`The origin latitude and longitude
`to: {latlng: [FLOAT, FLOAT]}`The destination latitude and longitude
Using Distance
`distance: {value: INTEGER, units: STRING}`The distance where units can be "km" or "miles"
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
Estimate vehicle offset

Estimate the offset emissions of vechicle transportation using gasoline or diesel.

curl https://api.cloverly.com/2019-03-beta/estimates/vehicle \
-X POST \
-d '{"distance":{"value":55,"units":"km"},"fuel_efficiency":{"value":25,"units":"mpg","of":"gasoline"}}' \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.post do |req|
  req.url '/2019-03-beta/estimates/vehicle'
  req.body = '{"distance":{"value":55,"units":"km"},"fuel_efficiency":{"value":25,"units":"mpg","of":"gasoline"}}'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'post',
    url: 'https://api.cloverly.com/2019-03-beta/estimates/vehicle',
    body: JSON.stringify({"distance":{"value":55,"units":"km"},"fuel_efficiency":{"value":25,"units":"mpg","of":"gasoline"}}),
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"
import "bytes"

func main() {
  client := &http.Client{}

  var requestData = []byte(`{"distance":{"value":55,"units":"km"},"fuel_efficiency":{"value":25,"units":"mpg","of":"gasoline"}}`)
  req, _ := http.NewRequest("POST", "https://api.cloverly.com/2019-03-beta/estimates/vehicle", bytes.NewBuffer(requestData))
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/estimates/vehicle'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
data = '{"distance":{"value":55,"units":"km"},"fuel_efficiency":{"value":25,"units":"mpg","of":"gasoline"}}'
r = requests.post(url, headers=headers, data=data)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/estimates/vehicle");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"distance":{"value":55,"units":"km"},"fuel_efficiency":{"value":25,"units":"mpg","of":"gasoline"}}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
Required
`fuel_efficiency: {value: INTEGER, units: STRING, of: STRING}`The fuel efficiency of the vehicle, where "units" is one of 'mpg' or 'km/l' and "of" is one of "gasoline" or "diesel".
`distance: {value: INTEGER, units: STRING}`The distance to offset, where "units" is one of "miles" or "km".
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
Estimate flight offset

Estimate the offset emissions of airline travel

curl https://api.cloverly.com/2019-03-beta/estimates/flight \
-X POST \
-d '{"airports":["sfo","atl","fra"]}' \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.post do |req|
  req.url '/2019-03-beta/estimates/flight'
  req.body = '{"airports":["sfo","atl","fra"]}'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'post',
    url: 'https://api.cloverly.com/2019-03-beta/estimates/flight',
    body: JSON.stringify({"airports":["sfo","atl","fra"]}),
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"
import "bytes"

func main() {
  client := &http.Client{}

  var requestData = []byte(`{"airports":["sfo","atl","fra"]}`)
  req, _ := http.NewRequest("POST", "https://api.cloverly.com/2019-03-beta/estimates/flight", bytes.NewBuffer(requestData))
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/estimates/flight'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
data = '{"airports":["sfo","atl","fra"]}'
r = requests.post(url, headers=headers, data=data)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/estimates/flight");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"airports":["sfo","atl","fra"]}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
Required
`airports: ["array", "of", "airport", "codes"]An array of airport codes for the trip. The first airport should be the starting airport followed by the sequence of airports in the order of travel.
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
Estimate electricity offset

Estimate a renewable energy certificate for electricity

curl https://api.cloverly.com/2019-03-beta/estimates/electricity \
-X POST \
-d '{"energy":{"value":200,"units":"kwh"}}' \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.post do |req|
  req.url '/2019-03-beta/estimates/electricity'
  req.body = '{"energy":{"value":200,"units":"kwh"}}'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'post',
    url: 'https://api.cloverly.com/2019-03-beta/estimates/electricity',
    body: JSON.stringify({"energy":{"value":200,"units":"kwh"}}),
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"
import "bytes"

func main() {
  client := &http.Client{}

  var requestData = []byte(`{"energy":{"value":200,"units":"kwh"}}`)
  req, _ := http.NewRequest("POST", "https://api.cloverly.com/2019-03-beta/estimates/electricity", bytes.NewBuffer(requestData))
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/estimates/electricity'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
data = '{"energy":{"value":200,"units":"kwh"}}'
r = requests.post(url, headers=headers, data=data)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/estimates/electricity");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"energy":{"value":200,"units":"kwh"}}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
None
Message Body Attributes
Required
`energy: {value: INTEGER, units: STRING}`The energy used, where "units" is one of 'kwh' or 'wh' for "kilowatt hours" and "watt hours" perspectively.
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}
Cancel an offset estimate

Cancel the estimate of an offset.

curl https://api.cloverly.com/2019-03-beta/estimates/:estimate_slug \
-X DELETE \
-H "Content-type: application/json" \
-H "Authorization: Bearer public_key:47800ea0ee541b4c"require 'faraday'
conn = Faraday.new(:url => 'https://api.cloverly.com')
conn.delete do |req|
  req.url '/2019-03-beta/estimates/:estimate_slug'
  req.headers['Content-Type'] = 'application/json'
  req.headers['Authorization'] = 'Bearer public_key:47800ea0ee541b4c'
endconst request = require('request');
const options = {
    method: 'delete',
    url: 'https://api.cloverly.com/2019-03-beta/estimates/:estimate_slug',
  headers: {
    'Content-type': 'application/json',
    'Authorization': 'Bearer public_key:47800ea0ee541b4c'
  }
};
request(options, function(error, response, body) {
  console.log(body);
});
package main

import "net/http"
import "io/ioutil"
import "fmt"

func main() {
  client := &http.Client{}

  req, _ := http.NewRequest("DELETE", "https://api.cloverly.com/2019-03-beta/estimates/:estimate_slug", nil)
  req.Header.Add("Content-type", "application/json")
  req.Header.Add("Authorization", "Bearer public_key:47800ea0ee541b4c")

  resp, _ := client.Do(req)

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)

  fmt.Printf(string(body[:]))
}
import requests
url = 'https://api.cloverly.com/2019-03-beta/estimates/:estimate_slug'
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer public_key:47800ea0ee541b4c'}
r = requests.delete(url, headers=headers)
print(r.text)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.cloverly.com/2019-03-beta/estimates/:estimate_slug");
curl_setopt($ch, CURLOPT_DELETE, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json', 'Authorization: Bearer public_key:47800ea0ee541b4c'));
$r = curl_exec($ch);
curl_close($ch);
echo $r;
Path Attributes
Required
`estimate_slug`The slug for the estimate
Message Body Attributes
None
Response
{
  "slug": "string",
  "environment": "string",
  "state": "string",
  "renewable_energy_certificate": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "renewable_type": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "deprecated": "string"
  },
  "micro_rec_count": "number",
  "micro_units": "number",
  "offset": {
    "slug": "string",
    "name": "string",
    "city": "string",
    "province": "string",
    "country": "string",
    "offset_type": "string",
    "offset_type_slug": "string",
    "total_capacity": "string",
    "latlng": "string",
    "technical_details": "string",
    "available_carbon_in_kg": "string",
    "pretty_url": "string"
  },
  "total_cost_in_usd_cents": "number",
  "estimated_at": "string",
  "equivalent_carbon_in_kg": "number",
  "electricity_in_kwh": "string",
  "rec_cost_in_usd_cents": "number",
  "transaction_cost_in_usd_cents": "number",
  "pretty_url": "string"
}