curl --request POST \
--url https://app.chainpatrol.io/api/v2/public/getOrganizationMetrics \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"organizationSlug": "<string>",
"brandSlug": "<string>",
"startDate": "<string>",
"endDate": "<string>"
}
'{
"metrics": {
"reports": 123,
"newThreats": 123,
"threatsWatchlisted": 123,
"takedownsFiled": 123,
"takedownsCompleted": 123,
"domainThreats": 123,
"twitterThreats": 123,
"telegramThreats": 123,
"otherThreats": 123
},
"blockedByType": [
{
"type": "<string>",
"count": 123
}
],
"blockedByDay": [
{
"date": "<string>",
"count": 123
}
]
}Get public metrics for one or more organizations
curl --request POST \
--url https://app.chainpatrol.io/api/v2/public/getOrganizationMetrics \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"organizationSlug": "<string>",
"brandSlug": "<string>",
"startDate": "<string>",
"endDate": "<string>"
}
'{
"metrics": {
"reports": 123,
"newThreats": 123,
"threatsWatchlisted": 123,
"takedownsFiled": 123,
"takedownsCompleted": 123,
"domainThreats": 123,
"twitterThreats": 123,
"telegramThreats": 123,
"otherThreats": 123
},
"blockedByType": [
{
"type": "<string>",
"count": 123
}
],
"blockedByDay": [
{
"date": "<string>",
"count": 123
}
]
}Authorization header:
Authorization: Bearer your_api_key
curl -X POST 'https://api.chainpatrol.io/public/getOrganizationMetrics' \
-H 'Authorization: Bearer your_api_key' \
-H 'Content-Type: application/json' \
-d '{
"organizationSlug": "your-org",
"startDate": "2024-01-01T00:00:00Z",
"endDate": "2024-03-01T00:00:00Z"
}'
organizationSlug exactlyasync function fetchOrganizationMetrics(organizationSlug, startDate, endDate) {
const response = await fetch(
"https://api.chainpatrol.io/public/getOrganizationMetrics",
{
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer YOUR_API_KEY_HERE",
},
body: JSON.stringify({
organizationSlug,
startDate,
endDate,
}),
}
);
return response.json();
}
// Example usage
fetchOrganizationMetrics(
"your-org",
"2024-01-01T00:00:00Z",
"2024-03-01T00:00:00Z"
)
.then((data) => console.log("Metrics:", data))
.catch((error) => console.error("Error fetching metrics:", error));
| Parameter | Type | Required | Description |
|---|---|---|---|
| organizationSlug | string | Yes | Organization slug to query |
| startDate | Date | No | Start date for metrics (default: all time) |
| endDate | Date | No | End date for metrics (default: current date) |
{
metrics: {
reportsCount: number; // Total number of reports
threatsBlockedCount: number; // Total number of threats blocked
threatsBlockedByAssetType: Array<{
// Threats blocked grouped by asset type
assetType: string;
count: number;
}>;
domainsBlockedCount: number; // Number of domains blocked
totalTakedownsFiledCount: number; // Total number of takedowns filed
totalTakedownsCompletedCount: number; // Total number of completed takedowns
totalDetections: number; // Total number of threat detections
}
}
| Status Code | Description |
|---|---|
| 401 Unauthorized | Invalid or missing API key |
| 403 Forbidden | API key does not have permission to query the requested organization |
| 500 Internal Server Error | Server error occurred while processing the request |
Your API key. This is required by most endpoints to access our API programatically. Reach out to us at support@chainpatrol.io to get an API key for your use.
Was this page helpful?