Stable

Workforce Counting API

Automated headcount and attendance tracking using AI-powered computer vision.

Headcount tracking Zone analytics Attendance reports Safety compliance

Authentication

All API requests require authentication using your API key. Include it in the Authorization header:

Authorization: Bearer your_api_key_here

Base URL

All endpoints are relative to the following base URL:

https://api.fitechco.com/api/v1/workforce

Get Current Headcount

GET /headcount

Retrieve real-time worker count across all zones or for a specific zone.

Parameters

Name Type Description
project_id required string Project identifier
zone_id string Filter by zone

Response

200 Current headcount
{
  "project_id": "proj_abc123",
  "timestamp": "2024-03-15T10:45:00Z",
  "total_workers": 145,
  "by_zone": [
    {
      "zone_id": "zone_a",
      "name": "Foundation",
      "count": 45
    },
    {
      "zone_id": "zone_b",
      "name": "Structure",
      "count": 68
    },
    {
      "zone_id": "zone_c",
      "name": "Finishing",
      "count": 32
    }
  ],
  "peak_today": 162,
  "peak_time": "2024-03-15T09:30:00Z"
}

Get Attendance Report

GET /attendance/report

Generate attendance report for a date range with check-in/out times.

Parameters

Name Type Description
project_id required string Project identifier
from_date required string Start date
to_date required string End date

Response

200 Attendance report
{
  "project_id": "proj_abc123",
  "period": {
    "from": "2024-03-01",
    "to": "2024-03-15"
  },
  "summary": {
    "total_man_days": 1850,
    "avg_daily_workers": 123,
    "avg_hours_per_day": 9.2,
    "attendance_rate": 94.5
  },
  "daily_breakdown": [
    {
      "date": "2024-03-15",
      "workers": 145,
      "total_hours": 1305
    }
  ]
}

Error Handling

The API uses standard HTTP status codes to indicate success or failure:

200 Request succeeded
201 Resource created
400 Bad request - invalid parameters
401 Unauthorized - invalid or missing API key
403 Forbidden - insufficient permissions
404 Resource not found
429 Rate limit exceeded
500 Internal server error

Rate Limits

API requests are rate limited to ensure fair usage:

Standard
1,000 requests/min
Enterprise
10,000 requests/min

Rate limit information is included in response headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1609459200
Get Current Headcount
import fi_sdk

client = fi_sdk.Client(api_key="your_api_key")

# Get current headcount
headcount = client.workforce.headcount.get(
    project_id="proj_abc123"
)

print(f"Total Workers: {headcount.total_workers}")
print(f"Peak Today: {headcount.peak_today} at {headcount.peak_time}")

for zone in headcount.by_zone:
    print(f"  {zone.name}: {zone.count} workers")
Try It Now
export const prerender = true;