Docs/Business Utils/GET /v1/day-count

GET /v1/day-countDay Count Convention

Business Utils lf-business-utils

Counts the days between two dates under a chosen finance rule and turns that into a fraction of a year. Conventions: act/360, act/365, act/act, 30/360, 30e/360. Returns days, year_fraction, and business_days.

Query Parameters

ParameterTypeRequiredDescription
start_datestringYesStart date YYYY-MM-DD
end_datestringYesEnd date YYYY-MM-DD
conventionstringNoact/360, act/365, act/act, 30/360, 30e/360

Response Schema

days (integer): Calendar days
year_fraction (number): Year fraction per convention
business_days (integer): Business days
convention (string): Convention used

cURL Example

curl 'https://lf-business-utils.laminarforge.dev/v1/day-count?start_date=<start_date>' -H 'Authorization: Bearer lf_YourApiKey'

Python Example

import requests
url = 'https://lf-business-utils.laminarforge.dev/v1/day-count'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'start_date': '<start_date>'}
response = requests.get(url, headers=headers, params=params)
print(response.json())