Relationships
Get Addresses Subgraph
POST
/
v0
/
relationships
/
subgraph
Get Subgraph Relationships
curl --request POST \
--url https://api.bubblemaps.io/v0/relationships/subgraph \
--header 'Content-Type: application/json' \
--header 'X-ApiKey: <api-key>' \
--data '
{
"addresses": [
"<string>"
],
"context_token_key": {
"address": "<string>"
}
}
'import requests
url = "https://api.bubblemaps.io/v0/relationships/subgraph"
payload = {
"addresses": ["<string>"],
"context_token_key": { "address": "<string>" }
}
headers = {
"X-ApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-ApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({addresses: ['<string>'], context_token_key: {address: '<string>'}})
};
fetch('https://api.bubblemaps.io/v0/relationships/subgraph', 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.bubblemaps.io/v0/relationships/subgraph",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'addresses' => [
'<string>'
],
'context_token_key' => [
'address' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-ApiKey: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bubblemaps.io/v0/relationships/subgraph"
payload := strings.NewReader("{\n \"addresses\": [\n \"<string>\"\n ],\n \"context_token_key\": {\n \"address\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-ApiKey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bubblemaps.io/v0/relationships/subgraph")
.header("X-ApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"addresses\": [\n \"<string>\"\n ],\n \"context_token_key\": {\n \"address\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bubblemaps.io/v0/relationships/subgraph")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-ApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"addresses\": [\n \"<string>\"\n ],\n \"context_token_key\": {\n \"address\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body[
{
"from_address": "<string>",
"to_address": "<string>",
"data": {
"total_value": 123,
"total_transfers": 123,
"first_date": 123,
"last_date": 123,
"token_key": {
"address": "<string>"
}
},
"rel_type": "GROUPED_TRANSFER"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Credit cost: 10 per request + 1 per requested address.
context_token_key body parameter to force the inclusion of transfers of a specific token.
Transfers are grouped based on the
(from_address, to_address, token_ref)
key. Meaning that if A sends some BMT to B multiple times, these
transfers will be grouped as a unique GROUPED_TRANSFER relationship object.Other types of relationships with different
data schemas will be supported
in the future, make sure this doesn’t break your typing.Relationships between two supernodes (addresses with high volume of transfers)
are ignored. Rrelationships between a supernode and a non-supernode are
included though.
Authorizations
Body
application/json
⌘I
Get Subgraph Relationships
curl --request POST \
--url https://api.bubblemaps.io/v0/relationships/subgraph \
--header 'Content-Type: application/json' \
--header 'X-ApiKey: <api-key>' \
--data '
{
"addresses": [
"<string>"
],
"context_token_key": {
"address": "<string>"
}
}
'import requests
url = "https://api.bubblemaps.io/v0/relationships/subgraph"
payload = {
"addresses": ["<string>"],
"context_token_key": { "address": "<string>" }
}
headers = {
"X-ApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-ApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({addresses: ['<string>'], context_token_key: {address: '<string>'}})
};
fetch('https://api.bubblemaps.io/v0/relationships/subgraph', 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.bubblemaps.io/v0/relationships/subgraph",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'addresses' => [
'<string>'
],
'context_token_key' => [
'address' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-ApiKey: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bubblemaps.io/v0/relationships/subgraph"
payload := strings.NewReader("{\n \"addresses\": [\n \"<string>\"\n ],\n \"context_token_key\": {\n \"address\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-ApiKey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bubblemaps.io/v0/relationships/subgraph")
.header("X-ApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"addresses\": [\n \"<string>\"\n ],\n \"context_token_key\": {\n \"address\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bubblemaps.io/v0/relationships/subgraph")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-ApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"addresses\": [\n \"<string>\"\n ],\n \"context_token_key\": {\n \"address\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body[
{
"from_address": "<string>",
"to_address": "<string>",
"data": {
"total_value": 123,
"total_transfers": 123,
"first_date": 123,
"last_date": 123,
"token_key": {
"address": "<string>"
}
},
"rel_type": "GROUPED_TRANSFER"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}