{
    "openapi": "3.1.0",
    "info": {
        "title": "AstroDeekssha Panchang API",
        "version": "1.1.0",
        "summary": "Free, read-only Hindu Panchang JSON for New Delhi and eight other Indian cities.",
        "description": "Tithi, nakshatra, yoga, karana with end times, Hindu month, Samvat, sunrise and sunset, Rahu Kaal, Yamaganda, Gulika, Abhijit and Brahma Muhurta, and the festivals of each day, for New Delhi and eight other cities (city parameter). No key. Free to use, also in apps and on commercial sites, with a visible link back to https://astrodeekssha.in/panchang-api. Please do not use it to train AI models.",
        "termsOfService": "https://astrodeekssha.in/panchang-api",
        "license": {
            "name": "Free with a link back, not for AI training",
            "url": "https://astrodeekssha.in/panchang-api"
        }
    },
    "servers": [
        {
            "url": "https://astrodeekssha.in"
        }
    ],
    "paths": {
        "/api/festivals": {
            "get": {
                "operationId": "getFestivals",
                "summary": "Festival, vrat, ekadashi and tithi days of a year (default this year)",
                "tags": [
                    "Festivals"
                ],
                "parameters": [
                    {
                        "name": "year",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "festival",
                                "vrat",
                                "ekadashi",
                                "tithi"
                            ]
                        }
                    },
                    {
                        "name": "major",
                        "in": "query",
                        "required": false,
                        "description": "major=1 keeps the major festivals only.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "1"
                            ]
                        }
                    },
                    {
                        "name": "pretty",
                        "in": "query",
                        "required": false,
                        "description": "Indent the JSON (pretty=1).",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "1"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of days",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Festival"
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/festivals/{year}": {
            "get": {
                "operationId": "getFestivalsByYear",
                "summary": "The same, year in the path",
                "tags": [
                    "Festivals"
                ],
                "parameters": [
                    {
                        "name": "year",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "pretty",
                        "in": "query",
                        "required": false,
                        "description": "Indent the JSON (pretty=1).",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "1"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of days"
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/panchang": {
            "get": {
                "operationId": "getPanchang",
                "summary": "Panchang for a date (default today)",
                "tags": [
                    "Panchang"
                ],
                "parameters": [
                    {
                        "name": "date",
                        "in": "query",
                        "required": false,
                        "description": "YYYY-MM-DD, or today.",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "days",
                        "in": "query",
                        "required": false,
                        "description": "How many consecutive dates to return, starting at date (1 to 31).",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 31,
                            "default": 1
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "required": false,
                        "description": "City slug (see /api/cities). Default delhi (New Delhi). Sunrise, sunset, tithi, nakshatra, yoga and karana end times and the Rahu Kaal group are the city's own; moonrise and moonset are null for a city; the Hindu month, year numbers, season, ayana and Sun and Moon sign are the same for every place on a date.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "delhi",
                                "mumbai",
                                "kolkata",
                                "chennai",
                                "bengaluru",
                                "hyderabad",
                                "ahmedabad",
                                "pune",
                                "lucknow"
                            ],
                            "default": "delhi"
                        }
                    },
                    {
                        "name": "pretty",
                        "in": "query",
                        "required": false,
                        "description": "Indent the JSON (pretty=1).",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "1"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "One date, or a list when days is above 1.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/PanchangDay"
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/panchang/{date}": {
            "get": {
                "operationId": "getPanchangByDate",
                "summary": "Panchang for the date in the path",
                "tags": [
                    "Panchang"
                ],
                "parameters": [
                    {
                        "name": "date",
                        "in": "path",
                        "required": true,
                        "description": "YYYY-MM-DD, or today.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "days",
                        "in": "query",
                        "required": false,
                        "description": "How many consecutive dates to return, starting at date (1 to 31).",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 31,
                            "default": 1
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "required": false,
                        "description": "City slug (see /api/cities). Default delhi (New Delhi). Sunrise, sunset, tithi, nakshatra, yoga and karana end times and the Rahu Kaal group are the city's own; moonrise and moonset are null for a city; the Hindu month, year numbers, season, ayana and Sun and Moon sign are the same for every place on a date.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "delhi",
                                "mumbai",
                                "kolkata",
                                "chennai",
                                "bengaluru",
                                "hyderabad",
                                "ahmedabad",
                                "pune",
                                "lucknow"
                            ],
                            "default": "delhi"
                        }
                    },
                    {
                        "name": "pretty",
                        "in": "query",
                        "required": false,
                        "description": "Indent the JSON (pretty=1).",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "1"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "One date, or a list when days is above 1.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/PanchangDay"
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/cities": {
            "get": {
                "operationId": "getCities",
                "summary": "The cities the city parameter accepts, with the dates each covers",
                "tags": [
                    "Panchang"
                ],
                "parameters": [
                    {
                        "name": "pretty",
                        "in": "query",
                        "required": false,
                        "description": "Indent the JSON (pretty=1).",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "1"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of cities",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/City"
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Festival": {
                "type": "object",
                "properties": {
                    "date": {
                        "type": "string",
                        "format": "date"
                    },
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "name_hi": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string",
                        "enum": [
                            "festival",
                            "vrat",
                            "ekadashi",
                            "tithi"
                        ]
                    },
                    "major": {
                        "type": "boolean"
                    },
                    "panchang": {
                        "type": "string",
                        "format": "uri"
                    }
                }
            },
            "City": {
                "type": "object",
                "properties": {
                    "slug": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "name_hi": {
                        "type": "string"
                    },
                    "latitude": {
                        "type": "number"
                    },
                    "longitude": {
                        "type": "number"
                    },
                    "timezone": {
                        "type": "string"
                    },
                    "available_from": {
                        "type": "string",
                        "format": "date"
                    },
                    "available_to": {
                        "type": "string",
                        "format": "date"
                    },
                    "example": {
                        "type": "string",
                        "format": "uri"
                    }
                }
            },
            "PanchangDay": {
                "type": "object",
                "description": "The Panchang of one date for New Delhi, or for the city asked for.",
                "properties": {
                    "date": {
                        "type": "string",
                        "format": "date"
                    },
                    "weekday": {
                        "type": "string"
                    },
                    "weekday_hi": {
                        "type": "string"
                    },
                    "location": {
                        "type": "object"
                    },
                    "sunrise": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^\\d{2}:\\d{2}$",
                        "description": "24-hour time HH:MM (IST)."
                    },
                    "sunset": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^\\d{2}:\\d{2}$",
                        "description": "24-hour time HH:MM (IST)."
                    },
                    "moonrise": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^\\d{2}:\\d{2}$",
                        "description": "24-hour time HH:MM (IST)."
                    },
                    "moonset": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^\\d{2}:\\d{2}$",
                        "description": "24-hour time HH:MM (IST)."
                    },
                    "tithi": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "name_hi": {
                                    "type": "string"
                                },
                                "ends_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "pattern": "^\\d{2}:\\d{2}$",
                                    "description": "24-hour time HH:MM (IST)."
                                },
                                "ends_next_day": {
                                    "type": "boolean",
                                    "description": "true when ends_at falls on the next calendar day."
                                },
                                "paksha": {
                                    "type": "string",
                                    "enum": [
                                        "Shukla",
                                        "Krishna"
                                    ]
                                },
                                "number": {
                                    "type": "integer",
                                    "description": "1 to 15 inside the paksha."
                                }
                            }
                        }
                    },
                    "nakshatra": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "name_hi": {
                                    "type": "string"
                                },
                                "ends_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "pattern": "^\\d{2}:\\d{2}$",
                                    "description": "24-hour time HH:MM (IST)."
                                },
                                "ends_next_day": {
                                    "type": "boolean",
                                    "description": "true when ends_at falls on the next calendar day."
                                },
                                "pada": {
                                    "type": "integer"
                                }
                            }
                        }
                    },
                    "yoga": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "name_hi": {
                                    "type": "string"
                                },
                                "ends_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "pattern": "^\\d{2}:\\d{2}$",
                                    "description": "24-hour time HH:MM (IST)."
                                },
                                "ends_next_day": {
                                    "type": "boolean",
                                    "description": "true when ends_at falls on the next calendar day."
                                }
                            }
                        }
                    },
                    "karana": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "name_hi": {
                                    "type": "string"
                                },
                                "ends_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "pattern": "^\\d{2}:\\d{2}$",
                                    "description": "24-hour time HH:MM (IST)."
                                },
                                "ends_next_day": {
                                    "type": "boolean",
                                    "description": "true when ends_at falls on the next calendar day."
                                }
                            }
                        }
                    },
                    "hindu_month": {
                        "type": "object"
                    },
                    "vikram_samvat": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "shaka_samvat": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "ritu": {
                        "type": "object"
                    },
                    "ayana": {
                        "type": "object"
                    },
                    "sun_sign": {
                        "type": "object"
                    },
                    "moon_sign": {
                        "type": "object"
                    },
                    "rahu_kaal": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "start": {
                                "type": "string"
                            },
                            "end": {
                                "type": "string"
                            }
                        }
                    },
                    "yamaganda": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "start": {
                                "type": "string"
                            },
                            "end": {
                                "type": "string"
                            }
                        }
                    },
                    "gulika_kaal": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "start": {
                                "type": "string"
                            },
                            "end": {
                                "type": "string"
                            }
                        }
                    },
                    "abhijit_muhurat": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "start": {
                                "type": "string"
                            },
                            "end": {
                                "type": "string"
                            }
                        }
                    },
                    "brahma_muhurta": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "start": {
                                "type": "string"
                            },
                            "end": {
                                "type": "string"
                            }
                        }
                    },
                    "events": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    },
                    "page": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uri",
                        "description": "The Panchang page of that date on the site (New Delhi); null in a city answer."
                    }
                }
            },
            "Error": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "object",
                        "properties": {
                            "code": {
                                "type": "string"
                            },
                            "message": {
                                "type": "string"
                            }
                        }
                    },
                    "docs": {
                        "type": "string"
                    }
                }
            }
        }
    }
}