Availability Button

Show live “new patient appointments available today/tomorrow” on your own website — or, if you want, right down to the exact next time — as a drop-in button, or via a simple data endpoint you can wire into your existing buttons.

Turn a plain “Book Now” link on your website into “Book Now — new patient appointments available tomorrow”, updated live from your real availability. Two ways to do it: a drop-in script, or the raw data endpoint for full control.

Turn on Allow availability under Setup > Email & Domains > New-Patient Availability first. Until then both options below simply leave your plain button as-is.

Before you start

The availability shown is for your first listed new-patient appointment type. It’s an indicative “soonest available” — not a held slot. By default it’s shown at day level (“tomorrow”, “Friday”); if you’d rather entice with the exact next time (“Friday at 9:40am”), the {time} placeholder below opts you in.

Option 1: Drop-in button (no coding)

Mark any link or button on your site with data-yb-button, then add the script once (replace yourpractice with your subdomain):

<a data-yb-button href="https://yourpractice.yourbooking.au/book">Book Now</a>

<script src="https://yourbooking.au/ybbutton.js"
        data-tenant="yourpractice" async></script>

The button becomes “Book Now — new patient appointments available tomorrow” and links to your booking page. Style the element however you like — it’s your markup; the script only updates the text and the link.

Customising the wording

Add data-template with any of these placeholders: {label}, {text}, {day_label}, {time}, {message}.

<a data-yb-button data-template="{label} · {text}"
   href="https://yourpractice.yourbooking.au/book">Book Now</a>

Or lead with the exact next time — “Book Now · Friday at 9:40am”:

<a data-yb-button data-template="{label} · {day_label} at {time}"
   href="https://yourpractice.yourbooking.au/book">Book Now</a>

If availability can’t be shown, the button keeps your original label — so it always works.

Option 2: Use the data in your own code

Call the public endpoint and build whatever you like. No key needed; it’s read-only and safe to call straight from the browser.

GET https://yourpractice.yourbooking.au/api/v1/availability/peek

Example — enhance an existing button:

<a id="book" href="https://yourpractice.yourbooking.au/book">Book Now</a>
<script>
fetch('https://yourpractice.yourbooking.au/api/v1/availability/peek')
  .then(function (r) { return r.json(); })
  .then(function (d) {
    if (d.available) {
      document.getElementById('book').textContent =
        'Book Now — new patient appointments ' + d.text;
    }
  })
  .catch(function () {});
</script>

Response

Always returns HTTP 200. When there’s nothing to show, available is false and the other fields are null — hide your dynamic text and keep a plain button.

{
  "available": true,
  "next_date": "2026-06-12",
  "next_time": "9:40am",
  "next_datetime": "2026-06-12T09:40:00+10:00",
  "next_available": "later",
  "day_label": "Thursday 12 June",
  "text": "available from Thursday 12 June",
  "message": "New patient appointments are available from Thursday 12 June",
  "appointment_type": "Comprehensive Eye Exam",
  "booking_url": "https://yourpractice.yourbooking.au/book"
}

Multiple branches

With more than one branch, the button only ever shows one branch's availability: the branch it names. Each button names its branch with data-yb-branch, or another practice with data-yb-tenant, and one page can carry as many as you like:

<button data-yb-open data-yb-button data-yb-branch="yourbusiness-north">Book at North Branch</button>
<button data-yb-open data-yb-button data-yb-branch="yourbusiness-south">Book at South Branch</button>

<script src="https://yourbooking.au/ybpopover.js" data-tenant="yourbusiness"></script>
<script src="https://yourbooking.au/ybbutton.js" data-tenant="yourbusiness" async></script>

With branch switching on, the two toggles are set once for your whole group, and we set them for you. With switching off, each branch sets its own.

A button on your group booking address that names no branch keeps your own wording. So does a Book at my nearest location button, because the nearest branch isn't known until the patient is inside the booking page.

Calling the data yourself? Put the branch on the end of your group address:

GET https://yourbusiness.yourbooking.au/api/v1/availability/peek?branch=yourbusiness-north

Without a branch, your group address answers available: false. A branch's own address (yourbusiness-north.yourbooking.au) always answers for that branch.

Booking Pages for Multiple Branches covers what shows for each layout, and where each button goes.

Good to know