List, create, update and delete the websites on your account.
Send the key as a Bearer token in the Authorization header.
Requests without a valid key return 401 Unauthorized.
Plans without API access return 403 Forbidden.
curl --location --request GET 'https://www.dashboard.datablik.com/api/v1/websites' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
const response = await fetch('https://www.dashboard.datablik.com/api/v1/websites', {
method: 'GET',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer {api_key}'
}
});
const data = await response.json();
<?php
$curl = curl_init('https://www.dashboard.datablik.com/api/v1/websites');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Accept: application/json',
'Authorization: Bearer {api_key}',
],
]);
$data = json_decode(curl_exec($curl), true);
curl_close($curl);
| Name | Type | Description | Default |
|---|---|---|---|
search |
string |
Search query. | — |
search_by |
string |
Field to search. domain Domain.
Default: domain |
domain |
favorite |
boolean |
Only return favorited websites. | — |
sort_by |
string |
Sort by. id Date created, domain Domain.
Default: id |
id |
sort |
string |
Sort direction. desc Descending, asc Ascending.
Default: desc |
desc |
per_page |
integer |
Results per page. 10 25 50 100
Default: 10 |
10 |
curl --location --request GET 'https://www.dashboard.datablik.com/api/v1/websites/{id}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
const response = await fetch('https://www.dashboard.datablik.com/api/v1/websites/{id}', {
method: 'GET',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer {api_key}'
}
});
const data = await response.json();
<?php
$curl = curl_init('https://www.dashboard.datablik.com/api/v1/websites/{id}');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Accept: application/json',
'Authorization: Bearer {api_key}',
],
]);
$data = json_decode(curl_exec($curl), true);
curl_close($curl);
curl --location --request POST 'https://www.dashboard.datablik.com/api/v1/websites' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}' \
--data-urlencode 'domain={domain}'
const response = await fetch('https://www.dashboard.datablik.com/api/v1/websites', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'Bearer {api_key}'
},
body: new URLSearchParams({ domain: '{domain}' })
});
const data = await response.json();
<?php
$curl = curl_init('https://www.dashboard.datablik.com/api/v1/websites');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Bearer {api_key}',
],
CURLOPT_POSTFIELDS => http_build_query(['domain' => '{domain}']),
]);
$data = json_decode(curl_exec($curl), true);
curl_close($curl);
| Name | Type | Description | Default |
|---|---|---|---|
domainRequired |
string |
Domain name, without protocol or path. | — |
privacy |
integer |
Who can see the stats. 0 Public, 1 Private, 2 Password.
Default: 1 |
1 |
password |
string |
Password for the stats page. Only used when privacy is 2.
|
— |
email |
integer |
Periodic email reports. 0 Disabled, 1 Enabled.
Default: 0 |
0 |
exclude_bots |
integer |
Exclude common bots from being tracked. 0 Disabled, 1 Enabled.
Default: 1 |
1 |
exclude_params |
string |
URL query parameters to exclude from tracking. One per line. | — |
exclude_ips |
string |
IP addresses to exclude from tracking. One per line. | — |
favorited_at |
string |
Favorited date in Y-m-d\TH:i:s format.
|
— |
curl --location --request PUT 'https://www.dashboard.datablik.com/api/v1/websites/{id}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {api_key}'
const response = await fetch('https://www.dashboard.datablik.com/api/v1/websites/{id}', {
method: 'PUT',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'Bearer {api_key}'
}
});
const data = await response.json();
<?php
$curl = curl_init('https://www.dashboard.datablik.com/api/v1/websites/{id}');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Bearer {api_key}',
],
]);
$data = json_decode(curl_exec($curl), true);
curl_close($curl);
| Name | Type | Description | Default |
|---|---|---|---|
privacy |
integer |
Who can see the stats. 0 Public, 1 Private, 2 Password.
|
— |
password |
string |
Password for the stats page. Only used when privacy is 2.
|
— |
email |
integer |
Periodic email reports. 0 Disabled, 1 Enabled.
|
— |
exclude_bots |
integer |
Exclude common bots from being tracked. 0 Disabled, 1 Enabled.
|
— |
exclude_params |
string |
URL query parameters to exclude from tracking. One per line. | — |
exclude_ips |
string |
IP addresses to exclude from tracking. One per line. | — |
favorited_at |
string |
Favorited date in Y-m-d\TH:i:s format.
|
— |
curl --location --request DELETE 'https://www.dashboard.datablik.com/api/v1/websites/{id}' \
--header 'Authorization: Bearer {api_key}'
const response = await fetch('https://www.dashboard.datablik.com/api/v1/websites/{id}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer {api_key}'
}
});
const data = await response.json();
<?php
$curl = curl_init('https://www.dashboard.datablik.com/api/v1/websites/{id}');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer {api_key}',
],
]);
$data = json_decode(curl_exec($curl), true);
curl_close($curl);