curl --request GET \
--url https://idle.api.datacircle.dev/credits/ \
--header 'Authorization: <api-key>'import requests
url = "https://idle.api.datacircle.dev/credits/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://idle.api.datacircle.dev/credits/', 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://idle.api.datacircle.dev/credits/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <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://idle.api.datacircle.dev/credits/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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://idle.api.datacircle.dev/credits/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://idle.api.datacircle.dev/credits/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"balance_usd": 123,
"signup_usd": 123,
"bought_usd": 123,
"manual_usd": 123,
"temporary": [
{
"campaign": "<string>",
"remaining_usd": 123,
"expires_at": "2023-11-07T05:31:56Z"
}
],
"coop_file_unlocked": true
}Read the balance
curl --request GET \
--url https://idle.api.datacircle.dev/credits/ \
--header 'Authorization: <api-key>'import requests
url = "https://idle.api.datacircle.dev/credits/"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://idle.api.datacircle.dev/credits/', 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://idle.api.datacircle.dev/credits/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <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://idle.api.datacircle.dev/credits/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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://idle.api.datacircle.dev/credits/")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://idle.api.datacircle.dev/credits/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"balance_usd": 123,
"signup_usd": 123,
"bought_usd": 123,
"manual_usd": 123,
"temporary": [
{
"campaign": "<string>",
"remaining_usd": 123,
"expires_at": "2023-11-07T05:31:56Z"
}
],
"coop_file_unlocked": true
}Authorizations
Token <your API key>
Response
Balance split by kind
Everything you can spend right now, in USD: signup_usd + bought_usd + manual_usd (permanent) + every temporary[].remaining_usd (temporary). datacircle_meta.credits_remaining on a provider call is this number after the call.
Permanent: what is left of the 5 USD signup credit every workspace gets once. Never expires. Spent after temporary credit, before bought and manual credit.
Permanent: what is left of the credit you bought through Stripe Checkout (POST /checkout/). Never expires. Spent after temporary and signup credit, together with manual credit, oldest first.
Permanent: what is left of credit Datacircle added to your workspace by hand (a refund, a gift, a deal). Never expires. Spent after temporary and signup credit, together with bought credit, oldest first. 0 for most workspaces.
Temporary credit: one entry per campaign grant that has not expired yet, soonest to expire first; empty when you have none. Spent before any permanent credit. At expires_at the entry leaves this list and whatever is left of it is gone.
Show child attributes
Show child attributes
true once this workspace may download the co-op file (coop): it spent 50 USD on credit in total (for the foreseeable future), or 3 people you invited signed up (GET /me/invites/). GET /files/ then shows it allowed. It says nothing about the 50M US dataset (us_50m), which only invites unlock.