Get a device emission given a device ID
curl --request GET \
--url https://api.gocrex.com/api/device-model-emissions/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.gocrex.com/api/device-model-emissions/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.gocrex.com/api/device-model-emissions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gocrex.com/api/device-model-emissions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gocrex.com/api/device-model-emissions/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gocrex.com/api/device-model-emissions/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gocrex.com/api/device-model-emissions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"brand": "Apple",
"footprint_breakdown": {
"cradle_to_gate": 109.35,
"end_of_life_processing": 1.35,
"product_use": 25.65,
"production": 101.25,
"transportation": 8.1
},
"id": "lap-app-lap-app-m3mba138c8g16c8g",
"name": "Apple MacBook Air 13 M3 (8C CPU + 8C GPU + 16C NE + 8GB)",
"product_footprint": 135,
"product_footprint_unit": "kgCO2e",
"type": "laptop"
}{
"code": "unauthorized",
"detail": "Invalid API key"
}{
"error": "Not found"
}Endpoints
Get a device emission given a device ID
Device emission based on the device model ID
Get a device emission given a device ID
curl --request GET \
--url https://api.gocrex.com/api/device-model-emissions/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.gocrex.com/api/device-model-emissions/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.gocrex.com/api/device-model-emissions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gocrex.com/api/device-model-emissions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gocrex.com/api/device-model-emissions/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gocrex.com/api/device-model-emissions/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gocrex.com/api/device-model-emissions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"brand": "Apple",
"footprint_breakdown": {
"cradle_to_gate": 109.35,
"end_of_life_processing": 1.35,
"product_use": 25.65,
"production": 101.25,
"transportation": 8.1
},
"id": "lap-app-lap-app-m3mba138c8g16c8g",
"name": "Apple MacBook Air 13 M3 (8C CPU + 8C GPU + 16C NE + 8GB)",
"product_footprint": 135,
"product_footprint_unit": "kgCO2e",
"type": "laptop"
}{
"code": "unauthorized",
"detail": "Invalid API key"
}{
"error": "Not found"
}Authorizations
Path Parameters
Device Model ID
Response
Device Model
Device model with emission
Device model brand
Show child attributes
Show child attributes
Your device model ID
Device model name
Product footprint
Example:
135
Product footprint unit
Example:
"kgCO2e"
Device model type
Available options:
laptop, mobile, tablet, monitor, gaming_console, headphone ⌘I