66API is a simple API built with NestJS to perform various date-related operations, such as calculating age, converting between Gregorian and Shamsi dates, and finding the difference between two dates. The API supports both GET
and POST
requests.
This API can be deployed and run on Vercel.
You can try out the API live at: https://66api.vercel.app/.
$ git clone https://github.com/code3-dev/66api.git
$ cd 66api
$ npm install
$ npm run start
$ npm run start:dev
$ npm run start:prod
$ npm run build
$ node dist/main.js
-
Endpoint (GET):
http://localhost:3000/get/time
Description: Returns the current time.
-
Endpoint (GET):
http://localhost:3000/get/image
Description: Returns the current time as an image.
-
Endpoint (GET):
http://localhost:3000/age/gregorian?birthdate=2005-02-10
Description: Calculates the age based on the provided Gregorian birthdate.
-
Endpoint (POST):
http://localhost:3000/age/gregorian
Request Header:
Content-Type: application/json
Request Body:
{ "birthdate": "2005-02-10" }
-
Endpoint (GET):
http://localhost:3000/age/shamsi?birthdate=1383/11/22
Description: Calculates the age based on the provided Shamsi birthdate.
-
Endpoint (POST):
http://localhost:3000/age/shamsi
Request Header:
Content-Type: application/json
Request Body:
{ "birthdate": "1383/11/22" }
-
Endpoint (GET):
http://localhost:3000/conversion/gregorian-to-shamsi?gregorianDate=2005-02-10
Description: Converts the given Gregorian date to Shamsi.
-
Endpoint (POST):
http://localhost:3000/conversion/gregorian-to-shamsi
Request Header:
Content-Type: application/json
Request Body:
{ "gregorianDate": "2005-02-10" }
-
Endpoint (GET):
http://localhost:3000/conversion/shamsi-to-gregorian?shamsiDate=1383/01/22
Description: Converts the given Shamsi date to Gregorian.
-
Endpoint (POST):
http://localhost:3000/conversion/shamsi-to-gregorian
Request Header:
Content-Type: application/json
Request Body:
{ "shamsiDate": "1383/01/22" }
-
Endpoint (GET):
http://localhost:3000/diff/shamsi?startDate=1402/10/12&endDate=1403/10/12
Description: Calculates the difference between two Shamsi dates.
-
Endpoint (POST):
http://localhost:3000/diff/shamsi
Request Header:
Content-Type: application/json
Request Body:
{ "startDate": "1402/10/01", "endDate": "1403/10/04" }
-
Endpoint (GET):
http://localhost:3000/diff/gregorian?startDate=2024-01-01&endDate=2024-12-25
Description: Calculates the difference between two Gregorian dates.
-
Endpoint (POST):
http://localhost:3000/diff/gregorian
Request Header:
Content-Type: application/json
Request Body:
{ "startDate": "2024-01-01", "endDate": "2024-12-25" }
- All
POST
requests should include theContent-Type: application/json
header. - The date format for Gregorian dates is
YYYY-MM-DD
, and for Shamsi dates, it isYYYY/MM/DD
.
For any queries or issues, please contact:
- Name: Hossein Pira
- Email: h3dev.pira@gmail.com
- Instagram: @h3dev.pira
- Telegram: @h3dev