curl --request GET \
--url https://api.opencals.com/storefront/products/{productId}/nearest-availability \
--header 'x-api-key: <api-key>'import requests
url = "https://api.opencals.com/storefront/products/{productId}/nearest-availability"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.opencals.com/storefront/products/{productId}/nearest-availability', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.opencals.com/storefront/products/{productId}/nearest-availability",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.opencals.com/storefront/products/{productId}/nearest-availability"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.opencals.com/storefront/products/{productId}/nearest-availability")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opencals.com/storefront/products/{productId}/nearest-availability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"productId": "123e4567-e89b-12d3-a456-426614174000",
"fromDate": "2026-04-10",
"fromTime": "09:00:00",
"toDate": "2026-04-10",
"toTime": "09:30:00",
"locationId": "123e4567-e89b-12d3-a456-426614174001",
"staffMemberId": "123e4567-e89b-12d3-a456-426614174002"
}Get the nearest available slot for a product
Find the nearest upcoming availability slot for a product. Returns null/204 if no slot exists within the advance schedule window.
curl --request GET \
--url https://api.opencals.com/storefront/products/{productId}/nearest-availability \
--header 'x-api-key: <api-key>'import requests
url = "https://api.opencals.com/storefront/products/{productId}/nearest-availability"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.opencals.com/storefront/products/{productId}/nearest-availability', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.opencals.com/storefront/products/{productId}/nearest-availability",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.opencals.com/storefront/products/{productId}/nearest-availability"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.opencals.com/storefront/products/{productId}/nearest-availability")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.opencals.com/storefront/products/{productId}/nearest-availability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"productId": "123e4567-e89b-12d3-a456-426614174000",
"fromDate": "2026-04-10",
"fromTime": "09:00:00",
"toDate": "2026-04-10",
"toTime": "09:30:00",
"locationId": "123e4567-e89b-12d3-a456-426614174001",
"staffMemberId": "123e4567-e89b-12d3-a456-426614174002"
}Authorizations
Storefront API key (sfk_...)
Path Parameters
ID of the product
"123e4567-e89b-12d3-a456-426614174000"
Response
Nearest available slot
ID of the product this slot belongs to
"123e4567-e89b-12d3-a456-426614174000"
Start date of the slot (YYYY-MM-DD, UTC)
"2026-04-10"
Start time of the slot (HH:MM:SS, UTC)
"09:00:00"
End date of the slot (YYYY-MM-DD, UTC) — differs from fromDate for cross-midnight slots
"2026-04-10"
End time of the slot (HH:MM:SS, UTC)
"09:30:00"
ID of the location this slot is associated with, or null if not location-specific
"123e4567-e89b-12d3-a456-426614174001"
ID of the staff member this slot is associated with, or null if not staff-specific
"123e4567-e89b-12d3-a456-426614174002"
Was this page helpful?