Limited time discount Book Smarter This Christmas
Up to 50%Off

How do I retrieve statistics with the Amelia API

Use the stats endpoints to add statistical records and retrieve dashboard statistics for employees, services, locations, customers, and appointments within a selected period.

You can review all endpoints and ready-made examples in the Amelia API Postman collection.

Info Note
API endpoints are available only in Elite license plans. Using the API requires coding skills and is not covered by standard plugin support.

How do I add stats with the Amelia API?

Use this endpoint to add a stats record for a specific service and employee, optionally tied to a location.

  • Method: POST
  • Path: /stats

Base path

  • {{your_site_URL}}/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1

Authorization

  • All Amelia endpoints use API key authorization via a request header named Amelia.

Required properties

  • serviceId (integer); service ID
  • providerId (integer); employee ID

Optional properties

  • locationId (integer); location ID

Example

				
					curl --location 'https://example-site.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/stats' \
--header 'Content-Type: application/json' \
--header 'Amelia: YOUR_API_KEY' \
--data '{
  "serviceId": 1,
  "providerId": 3,
  "locationId": 2
}'

				
			
				
					{
  "message": "Successfully added stats.",
  "data": null
}

				
			

How do I retrieve stats with the Amelia API?

Use this endpoint to retrieve statistics used on the employee Dashboard page. You can limit results to a specific date range by using the dates query parameter.

  • Method: GET
  • Path: /stats

Base path

  • {{your_site_URL}}/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1

Authorization

  • All Amelia endpoints use API key authorization via a request header named Amelia.

Optional query parameters

  • dates (string); start and end date in startDate,endDate format, for example 2026-05-18,2026-05-19

Example

				
					curl --location 'https://example-site.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/stats&dates=2026-05-18%2C2026-05-19' \
--header 'Amelia: YOUR_API_KEY'

				
			
				
					{
  "message": "Successfully retrieved appointments.",
  "data": {
    "count": {
      "approved": 0,
      "pending": 0
    },
    "selectedPeriodStats": {
      "2026-05-18": {
        "providers": {
          "14": {
            "count": 1,
            "occupied": 30,
            "revenue": 46.2,
            "intervals": [
              {
                "time": [41400, 79800],
                "services": []
              }
            ]
          }
        },
        "services": {
          "1": {
            "count": 1,
            "occupied": 30,
            "revenue": 46.2
          }
        }
      }
    },
    "employeesStats": [
      {
        "id": 14,
        "name": "Ana Jovanović",
        "appointments": 1
      }
    ],
    "servicesStats": [
      {
        "id": 1,
        "name": "Initial consultation",
        "appointments": 1
      }
    ],
    "locationsStats": [
      {
        "id": 4,
        "name": "Uptown studio",
        "appointments": 1
      }
    ],
    "customersStats": {
      "newCustomersCount": 0,
      "returningCustomersCount": 1,
      "totalPastPeriodCustomers": 2
    },
    "appointments": [
      {
        "id": 841,
        "status": "approved",
        "serviceId": 1,
        "providerId": 14,
        "locationId": 4,
        "bookingStart": "2026-05-18 12:00:00",
        "bookingEnd": "2026-05-18 12:30:00"
      }
    ],
    "appointmentsCount": 10
  }
}