Developer Portal / List Available Times
Developer Portal

List Available Times

Querying time slot availability is one of the most common operations when integrating with the eAgenda API. This tutorial covers all query scenarios.

Main endpoint

GET /api/v3/available-date-times/

Required parameters

ParameterTypeDescription
calendar_keyUUIDCalendar key
daydateDate in YYYY-MM-DD format

Optional parameters

ParameterTypeDescription
service_keysUUID[]Filter by specific services
action_new_appointmentstringAction type (see table below)
min_vacancies_availablenumberMinimum available vacancies (default: 1)
is_manualbooleanInclude only manually created time slots

action_new_appointment values

ValueDescription
newAvailable times without restrictions
clientTimes considering client restrictions
waitingTimes with waiting list
forceBooking in already occupied slots

Basic query

curl -X GET "https://eagenda.com.br/api/v3/available-date-times/?calendar_key=abc12345-...&day=2026-06-10" \
  -H "Authorization: Basic YOUR_TOKEN"

Response:

{
  "count": 10,
  "results": [
    {
      "start_date": "2026-06-10T08:00:00-03:00",
      "end_date": "2026-06-10T08:30:00-03:00",
      "vacancies_available": 3
    },
    {
      "start_date": "2026-06-10T08:30:00-03:00",
      "end_date": "2026-06-10T09:00:00-03:00",
      "vacancies_available": 2
    }
  ]
}

Filter by service

To see time slots compatible with specific services:

curl -X GET "https://eagenda.com.br/api/v3/available-date-times/?calendar_key=abc12345-...&day=2026-06-10&service_keys=srv12345-..." \
  -H "Authorization: Basic YOUR_TOKEN"

You can filter by multiple services by repeating the parameter:

?service_keys=srv-1&service_keys=srv-2

Query multiple days

The API returns time slots for one day at a time. To query a week, make multiple requests:

import requests
from datetime import date, timedelta

BASE_URL = "https://eagenda.com.br/api/v3"
AUTH = ("my@email.com", "my_password")
CALENDAR_KEY = "abc12345-1234-5678-9abc-def012345678"

start = date(2026, 6, 10)
available_slots = []

for i in range(7):
    day = start + timedelta(days=i)
    response = requests.get(
        f"{BASE_URL}/available-date-times/",
        auth=AUTH,
        params={
            "calendar_key": CALENDAR_KEY,
            "day": day.isoformat(),
        }
    ).json()

    for slot in response["results"]:
        available_slots.append(slot)
        print(f"{slot['start_date']}{slot['vacancies_available']} vacancy(ies)")

Random time slots

For scenarios where the client accepts any available time (e.g., next available slot):

GET /api/v3/available-date-times/random/
curl -X GET "https://eagenda.com.br/api/v3/available-date-times/random/?calendar_key=abc12345-...&quantity=3" \
  -H "Authorization: Basic YOUR_TOKEN"

Specific parameters

ParameterTypeDescription
quantitynumberNumber of time slots to return (default: 1)
start_datedatetimeMinimum date/time
end_datedatetimeMaximum date/time

Query days with availability

To find out which days of the month have available time slots:

GET /api/v3/days/
curl -X GET "https://eagenda.com.br/api/v3/days/?calendar_key=abc12345-...&start_date=2026-06-01&end_date=2026-06-30" \
  -H "Authorization: Basic YOUR_TOKEN"

Use this endpoint to build a visual calendar showing the user which days are available before querying specific time slots.

Implementation tips

  1. Moderate caching — Time slots change frequently. Don’t cache for more than 1-2 minutes
  2. Verify before booking — Always confirm availability just before creating the appointment, as another client may have booked the slot
  3. Use action_new_appointment=client — To respect scheduling rules set by the administrator
  4. Pagination — For calendars with many time slots, use page and page_size to paginate results