---
agentTools:
  projectIndex: https://toolscribe.readme.io/llms.txt
---

# Stats API

This API provides stats for the Machines

This API allows customers to query the machine data via API

[block:code]
{
  "codes": [
    {
      "code": "curl -X POST \\\n  https://api.toolscribe.co/machines/1YGTEER/stats \\\n  -H 'Authorization: Bearer API_KEY' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"start\": \"2021-09-09T00:00:00Z\",\n    \"end\": \"2021-11-09T00:00:00Z\",\n    \"data\": [{ \"metric\": \"timeInCycle\" }]\n}",
      "language": "curl",
      "name": null
    }
  ]
}
[/block]

Every query requires a time range (start and end date). Maximum data is for 90 Days.

In the above example, We are querying from September 9th 2021 to November 9th 2021.

On Data : We are requesting for in-cycle time. This is across the entire period of time that a machine was monitored with our product.

[block:parameters]
{
  "data": {
    "h-0": "Supported Data",
    "h-1": "API Name",
    "h-2": "Data Type",
    "0-0": "Time in Cycle",
    "0-1": "timeInCycle",
    "0-2": "metric",
    "1-0": "Downtime per Hour",
    "1-1": "downtime_hour",
    "1-2": "metric",
    "2-0": "Utilization per Hour",
    "2-1": "utilization_hour",
    "2-2": "metric",
    "3-0": "Anomalies per Hour",
    "3-1": "anomalies_hour",
    "3-2": "events",
    "4-0": "Alerts Triggered per Hour",
    "4-1": "alerts_hour",
    "4-2": "alerts"
  },
  "cols": 3,
  "rows": 5
}
[/block]