Graph
Graf powiązań
Buduje graf powiązań do określonej głębokości (1–3) wokół wskazanej spółki lub osoby. Identyfikator może być KRS, NIP, PESEL, UUID albo prefiksowanym ID grafu (krs:0000123456 / person:<uuid>). Wynik jest ograniczony do 200 węzłów; węzły huba (powyżej 100 krawędzi) nie są dalej rozwijane. Każde wywołanie = 1 jednostka wspólnej puli zapytań.
GET
/
v1
/
graph
/
{identifier}
Graf powiązań
curl --request GET \
--url https://api.krdata.pl/v1/graph/{identifier} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.krdata.pl/v1/graph/{identifier}"
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.krdata.pl/v1/graph/{identifier}', 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.krdata.pl/v1/graph/{identifier}",
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.krdata.pl/v1/graph/{identifier}"
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.krdata.pl/v1/graph/{identifier}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.krdata.pl/v1/graph/{identifier}")
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{
"root_id": "<string>",
"depth": 123,
"truncated": true,
"max_nodes": 123,
"nodes": [
{
"id": "<string>",
"kind": "<string>",
"name": "<string>",
"identifiers": {
"krs": "<string>",
"nip": "<string>",
"regon": "<string>",
"registry_type": "<string>"
},
"datasets": [
"<string>"
],
"is_root": false,
"is_hub": true,
"edge_count": 123
}
],
"edges": [
{
"source": "<string>",
"target": "<string>",
"roles": [
{
"source": "<string>",
"relation": "<string>",
"role_type": "<string>",
"position": "<string>"
}
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Query Parameters
Required range:
1 <= x <= 3⌘I
Graf powiązań
curl --request GET \
--url https://api.krdata.pl/v1/graph/{identifier} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.krdata.pl/v1/graph/{identifier}"
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.krdata.pl/v1/graph/{identifier}', 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.krdata.pl/v1/graph/{identifier}",
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.krdata.pl/v1/graph/{identifier}"
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.krdata.pl/v1/graph/{identifier}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.krdata.pl/v1/graph/{identifier}")
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{
"root_id": "<string>",
"depth": 123,
"truncated": true,
"max_nodes": 123,
"nodes": [
{
"id": "<string>",
"kind": "<string>",
"name": "<string>",
"identifiers": {
"krs": "<string>",
"nip": "<string>",
"regon": "<string>",
"registry_type": "<string>"
},
"datasets": [
"<string>"
],
"is_root": false,
"is_hub": true,
"edge_count": 123
}
],
"edges": [
{
"source": "<string>",
"target": "<string>",
"roles": [
{
"source": "<string>",
"relation": "<string>",
"role_type": "<string>",
"position": "<string>"
}
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}
