Skip to main content

Endpoint

GET https://theslow.net/api/slowstats/get-metrics?projectId=YOUR_PROJECT_ID

Overview

This endpoint retrieves aggregate metrics (like counts or summaries) for the specified project.
Use it to power dashboards, summaries, or quick overviews of project activity.

Authentication

This endpoint requires an API key. You can retrieve an API key from your dashboard. Include it in the X-API-KEY header:
X-API-KEY: YOUR_API_KEY_HERE
For more details, see the Authentication Guide.

Query Parameters

ParameterTypeRequiredDescription
projectIdstringYesThe ID of the project to fetch metrics for.

Responses

βœ… 200 OK

Returns a JSON object with your metrics:
{
  "metrics": {
    "total_events": 123,
    "unique_visitors": 45,
    "last_7_days": [
      { "date": "2025-07-10", "events": 10 },
      { "date": "2025-07-11", "events": 15 }
    ]
  }
}

⚠️ 400 Bad Request

If projectId is missing:
{
  "error": "Project ID is required."
}

πŸ”’ 401 Unauthorized

If authentication fails (invalid or missing API key):
{
  "error": "Unauthorized: You must provide a valid API Key."
}

🚫 403 Forbidden

If the project does not belong to the authenticated user:
{
  "error": "Forbidden: You do not have access to this project."
}

πŸ’₯ 500 Internal Server Error

For unexpected server errors:
{
  "error": "An internal server error occurred."
}

Examples

CURL

curl -X GET "https://theslow.net/api/slowstats/get-metrics?projectId=abc123"      -H "X-API-KEY: YOUR_API_KEY_HERE"

Python (requests)

import requests

headers = {"X-API-KEY": "YOUR_API_KEY_HERE"}
params = {"projectId": "abc123"}
response = requests.get("https://theslow.net/api/slowstats/get-metrics", headers=headers, params=params)
print(response.json())

JavaScript (fetch)

fetch("https://theslow.net/api/slowstats/get-metrics?projectId=abc123", {
  headers: { "X-API-KEY": "YOUR_API_KEY_HERE" }
})
  .then(res => res.json())
  .then(data => console.log(data.metrics));

Notes

  • This endpoint enforces ownership checks, meaning you can only retrieve metrics for projects tied to your API key.
  • The metrics object may be expanded over time with more fields.

Need Further Assistance?

If you have any questions or encounter issues, please don’t hesitate to reach out to our support team.