Business Days Between
curl --request POST \
--url https://api.fincept.in/quantlib/scheduling/calendar/business-days-between \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"start_date": "2024-01-02",
"end_date": "2024-01-31",
"calendar": "US"
}
'import requests
url = "https://api.fincept.in/quantlib/scheduling/calendar/business-days-between"
payload = {
"start_date": "2024-01-02",
"end_date": "2024-01-31",
"calendar": "US"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({start_date: '2024-01-02', end_date: '2024-01-31', calendar: 'US'})
};
fetch('https://api.fincept.in/quantlib/scheduling/calendar/business-days-between', 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.fincept.in/quantlib/scheduling/calendar/business-days-between",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start_date' => '2024-01-02',
'end_date' => '2024-01-31',
'calendar' => 'US'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fincept.in/quantlib/scheduling/calendar/business-days-between"
payload := strings.NewReader("{\n \"start_date\": \"2024-01-02\",\n \"end_date\": \"2024-01-31\",\n \"calendar\": \"US\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fincept.in/quantlib/scheduling/calendar/business-days-between")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"start_date\": \"2024-01-02\",\n \"end_date\": \"2024-01-31\",\n \"calendar\": \"US\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fincept.in/quantlib/scheduling/calendar/business-days-between")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_date\": \"2024-01-02\",\n \"end_date\": \"2024-01-31\",\n \"calendar\": \"US\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"start_date": "2024-01-02",
"end_date": "2024-01-31",
"business_days": 21,
"calendar": "US"
}
}{
"detail": "Invalid API key"
}{
"detail": "Endpoint requires Basic tier or higher"
}{
"detail": [
{
"loc": [
"body",
"start_date"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}quantlib-scheduling
Business Days Between
Count the number of business days between two dates, excluding weekends and holidays according to the specified calendar. Returns the count excluding the start date but including the end date. Essential for accrual calculations, SLA tracking, and interest period determination. [Tier: FREE, Credits: 0]
POST
/
quantlib
/
scheduling
/
calendar
/
business-days-between
Business Days Between
curl --request POST \
--url https://api.fincept.in/quantlib/scheduling/calendar/business-days-between \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"start_date": "2024-01-02",
"end_date": "2024-01-31",
"calendar": "US"
}
'import requests
url = "https://api.fincept.in/quantlib/scheduling/calendar/business-days-between"
payload = {
"start_date": "2024-01-02",
"end_date": "2024-01-31",
"calendar": "US"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({start_date: '2024-01-02', end_date: '2024-01-31', calendar: 'US'})
};
fetch('https://api.fincept.in/quantlib/scheduling/calendar/business-days-between', 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.fincept.in/quantlib/scheduling/calendar/business-days-between",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start_date' => '2024-01-02',
'end_date' => '2024-01-31',
'calendar' => 'US'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fincept.in/quantlib/scheduling/calendar/business-days-between"
payload := strings.NewReader("{\n \"start_date\": \"2024-01-02\",\n \"end_date\": \"2024-01-31\",\n \"calendar\": \"US\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fincept.in/quantlib/scheduling/calendar/business-days-between")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"start_date\": \"2024-01-02\",\n \"end_date\": \"2024-01-31\",\n \"calendar\": \"US\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fincept.in/quantlib/scheduling/calendar/business-days-between")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_date\": \"2024-01-02\",\n \"end_date\": \"2024-01-31\",\n \"calendar\": \"US\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"start_date": "2024-01-02",
"end_date": "2024-01-31",
"business_days": 21,
"calendar": "US"
}
}{
"detail": "Invalid API key"
}{
"detail": "Endpoint requires Basic tier or higher"
}{
"detail": [
{
"loc": [
"body",
"start_date"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}Authorizations
API key for authentication. Get your key at https://api.fincept.in/auth/register
Body
application/json
Start date in ISO format (YYYY-MM-DD), excluded from count
Example:
"2024-01-02"
End date in ISO format (YYYY-MM-DD), included in count
Example:
"2024-01-31"
Calendar to use for business day calculation. Options: US, UK, TARGET, Japan, Weekend
Available options:
US, UK, TARGET, Japan, Weekend Example:
"US"
⌘I
