Api праздники сегодня

API-Сервис праздников

Праздники

всего праздников 99

2 3 4 5

Дата Наименование праздника  
01.01 Новый год  
07.01 Рождество Христово  
14.01 Старый Новый год  
19.01 Крещение Господне  
25.01 Татьянин день (день студента)  
31.01 Международный день ювелира  
02.02 День сурка  
08.02 День российской науки  
13.02 Всемирный день радио  
14.02 День святого Валентина (день всех влюбленных)  
14.02.2014 День компьютерщика  
15.02 Сретение Господне  
23.02 День защитника Отечества  
08.03 Международный женский день  
27.03 День МВД  
01.04 День смеха  
20.04.2014 Пасха  
22.04 Международный день Земли  
24.04 День секретаря  
01.05 День весны и труда  

2 3 4 5

Добавить новый праздник:

Формат API-запросов для получения праздников

http://htmlweb.ru/service/api.php?holiday — получить список праздников

Дополнительные параметры:
[&private=0|1] — показать только общие праздниики или только личные
Для получения личных праздников дополнительно используйте параметр API_KEY из профиля
[&type=0-3] — показать праздники только определенного вида: 0-Личный,1-Государственный,2-Церковный,3-Профессиональный
[&country=XX] — показать праздники только определенной страны, по умолчанию все.
[&d_from=ДАТА1] — показать только праздники С даты1 в формате дд.мм.гг или дд.мм или YYYY-MM-DD
[&d_to=ДАТА2] — показать только праздники ПО дату2 в формате дд.мм.гг или дд.мм или YYYY-MM-DD
[&birthday] — включить в список дни рождения из Контактов
[&q=XXX] — выбрать праздники содержащие указанный текст
[&perpage=20] — сколько вывести праздников в пакете, по умолчанию 20
[&p=1] — с какого по счету праздника выводить, по умолчанию с 1-го
[&id=NNN] — показать только праздник с номером NNN.

https://htmlweb.ru/service/api.php?holiday_edit — форма добавления праздника

https://htmlweb.ru/service/api.php?holiday_edit=ID — форма редактирования праздника с номером ID

https://htmlweb.ru/service/api.php?holiday_del=ID — удалить праздник с номером ID

https://htmlweb.ru/service/api.php?holiday_save — добавить новый праздник или отредактировать существующий

Дополнительные параметры:
[&id=NNN] — номер записи, если не указан будет добавлен новый праздник.
&name=НАЗВАНИЕ_ПРАЗДНИКА
Дата праздника указывается одним из следующих полей:
[&date=ДД.ММ.ГГГГ] — дата праздника для одноразовых
[&month=МЕСЯЦ&day=ДЕНЬ] — дата праздника для ежегодных
[&holiday=ММДД]
[&country=RU] — двухбуквенный код страны праздника, по умолчанию RU-Россия. Список стран с кодами.
[&comment=ОПИСАНИЕ_ПРАЗДНИКА]
[&type=0-3] вид праздника 0-Личный, 1-Государственный, 2-Церковный, 3-Профессиональный, 4-Неофициальный(невыходной),

Для получения личных праздников используйте параметр API_KEY из вашего профиля

Где ещё можно взять информацию о праздничных днях, рабочих днях и т.п.:
http://kayaposoft.com/enrico/json/v1.0/?action=getPublicHolidaysForMonth&month=1&year=2014&country=rus
http://www.timeanddate.com/holidays/russia/2014
http://api1.vasha-ats.ru/daytype.php?date=Y-m-d
http://www.calend.ru/img/export/today-holidays.rss — ближайшие праздники на 2 дня

Welcome to the Calendarific Global Holidays API. We cover over 230 countries and 3000 states around
the
world. We are constantly adding new countries and states. Feel free to send us an email if your
country is not included in the list. This document covers how to use our API. Let us know if you have
any questions.

The Calendarific API is built on REST principles. Authenticated users can interact with any of our
URIs by using the specified HTTP request method. We enforce using SSL encryption by issuing requests
through HTTPS.

API Base URL


All requests to our API are supposed to be sent to this endpoint. Below you will find a list of
endpoints that the API supports

https://calendarific.com/api/v2

API Endpoints


Below is a list of API endpoints we currently support. Please note that requests to any of these
endpoints count towards your API hits quota. If you are on the free plan it will count towards your
allotments.

/holidays This provides a list of holidays based on the parameters passed to it. https://calendarific.com/api/v2/holidays
/languages This endpoint provides the list of languages we support. Please note that not all holidays
are specified in the language listed. If a holiday is not available in the specified
language, it defaults to the official language of the country or english in most cases. This
is useful for getting an index of all languages and the ISO codes programmatically.
https://calendarific.com/api/v2/languages
/countries This endpoint provides a list of countries and languages that we support. This is useful for
getting an index of all countries and the ISO codes programmatically.
https://calendarific.com/api/v2/countries

Authentication


An API key is required for every request to the Holiday API. Your API key is used to authenticate you
with our API, and it should be provided as a
api_key URL parameter.

The API key can be retrieved from the account pages. If you do know your API key please signup for a free account key.

?api_key=baa9dc110aa712sd3a9fa2a3dwb6c01d4c875950dc32vs

The api_key should be appended to the url request like in the example below

 curl -G https://calendarific.com/api/v2/holidays?api_key=baa9dc110aa712sd3a9fa2a3dwb6c01d4c875950dc32vs

Holiday API Endpoint Parameters


Queries are made to our API using URL parameters. There are two sets of parameters,
optional and required. For the holidays API. The country, the
year and api_key are required parameters for all holiday API requests.
Requests that do not have the required parameter will receive an error response and cannot be
processed.

Required API Parameters

api_key This is the value of the API that is used to authenticate every request to our API.
You can access this once you sign up and login into your account. This is the only
required parameter for the /countries endpoint.
country The country parameter must be in the iso-3166 format as specified in the document here.
To view a list of countries and regions we support, visit our list of supported countries.
year The year you want to return the holidays. We currently support both historical and
future years until 2049. The year must be specified as a number eg, 2019

Below is an example request for all holidays in the United States for 2019. Be sure to replace
the api_key with a valid value from your account page.

curl 'https://calendarific.com/api/v2/holidays?&api_key=baa9dc110aa712sd3a9fa2a3dwb6c01d4c875950dc32vs&country=US&year=2019'

Below is a shortened API response that executes successfully

{
    "meta": {
        "code": 200
    },
    "response": {
        "holidays": [
            {
                "name": "Name of holiday goes here",
                "description": "Description of holiday goes here",
                "date": {
                    "iso": "2018-12-31",
                    "datetime": {
                        "year": 2018,
                        "month": 12,
                        "day": 31
                    }
                },
                "type": [
                    "Type of Observance goes here"
                ]
            }
        ]
    }
}

Optional Holiday API Endpoint Parameters


Our API has a list of optional parameters that allow users to refine the results that gets
returned. Please note that some of the optional parameters are only limited to paid users. Below
is the complete list of optional parameters

NB: Multiple types can be specified in the request separated by commas.

day Limits the number of holidays to a particular day. Must be passed as the numeric value
of the day [1..31].
month Limits the number of holidays to a particular month. Must be passed as the numeric
value of the month [1..12].
location We support multiple counties, states and regions for all the countries we support.
This optional parameter allows you to limit the holidays to a particular state or
region. The value of field is iso-3166 format of the state. View a list of
supported countries and states. An example is, for
New York state in the United States, it would be us-ny
type We support multiple types of holidays and observances. This parameter allows users to
return only a particular type of holiday or event. By default, the API returns all
holidays. Below is the list of holiday types supported by the API and this is how to
reference them.

  • national — Returns public, federal and bank holidays
  • local — Returns local, regional and state holidays
  • religious — Return religious holidays: buddhism, christian,
    hinduism, muslim, etc
  • observance — Observance, Seasons, Times

Premium Holiday API Endpoint Parameters


Our API supports premium parameters which are available to all users of our professional plan
and above. You will receive an error if you use these parameters without the required
subscription.

language Returns the name of the holiday in the official language of the country if available.
This defaults to english. This must be passed as the 2-letter
ISO639 Language Code. An example is to return all the names of france holidays
in french you can just add the parameter like this: &language=fr
uuid Returns a UUID for every holiday returned in the response [true or
false].

HTTP response codes


Every API request returns an appropriate HTTP response code and below is a list of what they
mean
with regards to the API

200 Success Everything went smooth.
401 Unauthorized Missing or incorrect API token in header.
422 Un-processable Entity meaning something with the message isn’t quite right, this
could
be malformed JSON or incorrect fields. In this case, the response body contains JSON
with an API error code and message containing details on what went wrong.
500 Internal Server Error This is an issue with Calendarific’s servers processing your
request. In most cases the message is lost during the process, and we are notified so that
we can investigate the issue.
503 Service Unavailable During planned service outages, Calendarific API services will
return this HTTP response and associated JSON body.
429 Too many requests. API limits reached.

API error codes


Whenever the Calendarific server detects an input error it will return an HTTP 422 status
code
along with a JSON object containing error details:

600 Maintenance The Calendarific API is offline for maintenance.
601 Unauthorized Missing or incorrect API token.
602 Invalid query parameters.
603 Authorized Subscription level required.

JSON Response


We try to automatically detect when someone wants to call our API vs view our website, and
send
back the appropriate JSON response rather than HTML. We do this based on the user agent for
known popular programming languages, tools and frameworks. There are a couple of other ways
to
force a JSON response from us in the cases that it doesn’t happen automatically though. One
is
to add /json to the URL, and the other is to set an accepts header to application/json:

Rate Limits


Free usage of our API is limited to 1,000 API requests per day. If you exceed 1,000 requests
in
a 24 hour period we’ll return a 429 HTTP status code to you. Paid plans come with monthly
limits, and configurable alerts.

JSONP/CORS Requests


JSONP and CORS are supported, allowing you to use Calendarific entirely in client-side code.
For
JSONP You just need to specify the callback parameter, eg.
https://calendarific.com/?callback=callback. Most javascript libraries will
automatically handle this for you though.

Required Request Parameters

country
string

For countries, ISO 3166-1 alpha-2
or ISO 3166-1 alpha-3 format.
For states / provinces (with our States & Provinces plan), ISO 3166-2 format.
Accepts up to 10 comma separated values.

Full list of supported countries and states / provinces.

key
string

Your API key.

year
postive integer

4 digit year in ISO 8601 format.


Optional Request Parameters

month
positive integer

1 or 2 digit month (1-12).

day
positive integer

1 or 2 digit day (1-31 depending on the month). Must be used with month.

public
boolean

Return only public holidays.

subdivisions
boolean

Return state / province holidays alongside countrywide holidays. Available on our States & Provinces plan.

search
string

Search holidays by name. Minimum 5 characters.

language
string

ISO 639-1 format (with exceptions).

Full list of supported languages.

previous
boolean

Return the first day of holidays that occur before the specific date.
month and day are required.
Cannot be used with upcoming.

upcoming
boolean

Return the first day of holidays that occur after the specific date.
month and day are required.
Cannot be used with previous.

format
string

Response format (csv, json, php, tsv, yaml and xml). Defaults to JSON.

pretty
boolean

Prettifies results to be more human-readable.


Return Properties

status
number

Status code for the response.

requests
dictionary

Rate limit information for the current month.

requests.available
integer

The remaining number of API calls you can make for the current month.

requests.used
integer

Total number of API requests you have made during the current month.

requests.resets
datetime string

The date and time that the current rate limits will be reset.

holidays
array of dictionaries

List of holidays based on your request parameters.

holidays.name
string

Name of the holiday or observance.

holidays.date
date

Date that the holiday actually occurs.

holidays.observed
date

Date that the holiday is observed on. Example, some countries move holidays that
land on a weekend to the following Monday. Often times, this value may be the
same as date.

holidays.public
boolean

Whether or not the holiday or observance is a public holiday.

holidays.country
string

ISO code for the country, state or province that the holiday is for.
For countries, ISO 3166-1 alpha-2.
For states / provinces, ISO 3166-2 format.

holidays.uuid
string

Unique identifier for the holiday.

holidays.weekday
dictionary

Day of the week that the holiday occurs and is observed.

holidays.weekday.date.name
string

Name of the day of the week that the holiday occurs. Corresponds with the date property.

holidays.weekday.date.numeric
string

ISO-8601 numeric representation of the day of the week that the holiday occurs. Corresponds with the date property.

holidays.weekday.observed.name
string

Name of the day of the week that the holiday is observed. Corresponds with the observed property.

holidays.weekday.observed.numeric
string

ISO-8601 numeric representation of the day of the week that the holiday lands on. Corresponds with the date property.


Optional Return Properties

error
string

Textual explanation of the error that ocurred.

warning
string

Additional information about the data that was returned.

holidays.subdivisions
array of strings

List of applicable subdivisions when using the subdivisions request parameter. Empty array denotes all subdivisions are applicable.


Sample Holidays Response
{
    "status": 200,

+ "requests": { ... },

- "requests": { "used": 774, "available": 226, "resets": "2023-03-01 00:00:00" },

+ "holidays": [ ... ]

- "holidays": [ { "name": "New Year's Day", "date": "2015-01-01", "observed": "2015-01-01", "public": true, "country": "US", "uuid": "82f78b8a-019e-479e-a19f-99040275f9bf", "weekday": { "date": { "name": "Thursday", "numeric": 4 }, "observed": { "name": "Thursday", "numeric": 4 } } }, { "name": "Mother's Day", "date": "2015-05-10", "observed": "2015-05-10", "public": false, "country": "US", "uuid": "0746cfc7-6432-4dcc-bc75-dfef56c41086", "weekday": { "date": { "name": "Sunday", "numeric": 7 }, "observed": { "name": "Sunday", "numeric": 7 } } }, { "name": "Independence Day", "date": "2015-07-04", "observed": "2015-07-03", "public": true, "country": "US", "uuid": "88268759-9b90-468c-804f-b729b8418e7c", "weekday": { "date": { "name": "Saturday", "numeric": 6 }, "observed": { "name": "Friday", "numeric": 5 } } } ]

}
Model
date The date of the holiday
localName Local name
name English name
countryCode ISO 3166-1 alpha-2
fixed Is this public holiday every year on the same date
global Is this public holiday in every county (federal state)
counties If it is not global you found here the Federal states (ISO-3166-2)
launchYear The launch year of the public holiday
types The types of the public holiday, several possible

  • Public
  • Bank (Bank holiday, banks and offices are closed)
  • School (School holiday, schools are closed)
  • Authorities (Authorities are closed)
  • Optional (Majority of people take a day off)
  • Observance (Optional festivity, no paid day off)
[
   {
      "date": "2017-01-01",
      "localName": "Neujahr",
      "name": "New Year's Day",
      "countryCode": "AT",
      "fixed": true,
      "global": true,
      "counties": null,
      "launchYear": 1967,
      "types": [
         "Public"
      ]
   },
   {
      "date": "2017-01-06",
      "localName": "Heilige Drei Könige",
      "name": "Epiphany",
      "countryCode": "AT",
      "fixed": true,
      "global": true,
      "counties": null,
      "launchYear": null,
      "types": [
         "Public"
      ]
   },
   {
      "date": "2017-04-17",
      "localName": "Ostermontag",
      "name": "Easter Monday",
      "countryCode": "AT",
      "fixed": false,
      "global": true,
      "counties": null,
      "launchYear": 1642,
      "types": [
         "Public"
      ]
   },
   {
      "date": "2017-05-01",
      "localName": "Staatsfeiertag",
      "name": "National Holiday",
      "countryCode": "AT",
      "fixed": true,
      "global": true,
      "counties": null,
      "launchYear": 1955,
      "types": [
         "Public"
      ]
   },
   {
      "date": "2017-05-25",
      "localName": "Christi Himmelfahrt",
      "name": "Ascension Day",
      "countryCode": "AT",
      "fixed": false,
      "global": true,
      "counties": null,
      "launchYear": null,
      "types": [
         "Public"
      ]
   },
   {
      "date": "2017-06-05",
      "localName": "Pfingstmontag",
      "name": "Whit Monday",
      "countryCode": "AT",
      "fixed": false,
      "global": true,
      "counties": null,
      "launchYear": null,
      "types": [
         "Public"
      ]
   },
   {
      "date": "2017-06-15",
      "localName": "Fronleichnam",
      "name": "Corpus Christi",
      "countryCode": "AT",
      "fixed": false,
      "global": true,
      "counties": null,
      "launchYear": null,
      "types": [
         "Public"
      ]
   },
   {
      "date": "2017-08-15",
      "localName": "Maria Himmelfahrt",
      "name": "Assumption Day",
      "countryCode": "AT",
      "fixed": true,
      "global": true,
      "counties": null,
      "launchYear": null,
      "types": [
         "Public"
      ]
   },
   {
      "date": "2017-10-26",
      "localName": "Nationalfeiertag",
      "name": "National Holiday",
      "countryCode": "AT",
      "fixed": true,
      "global": true,
      "counties": null,
      "launchYear": null,
      "types": [
         "Public"
      ]
   },
   {
      "date": "2017-11-01",
      "localName": "Allerheiligen",
      "name": "All Saints' Day",
      "countryCode": "AT",
      "fixed": true,
      "global": true,
      "counties": null,
      "launchYear": null,
      "types": [
         "Public"
      ]
   },
   {
      "date": "2017-12-08",
      "localName": "Mariä Empfängnis",
      "name": "Immaculate Conception",
      "countryCode": "AT",
      "fixed": true,
      "global": true,
      "counties": null,
      "launchYear": null,
      "types": [
         "Public"
      ]
   },
   {
      "date": "2017-12-25",
      "localName": "Weihnachten",
      "name": "Christmas Day",
      "countryCode": "AT",
      "fixed": true,
      "global": true,
      "counties": null,
      "launchYear": null,
      "types": [
         "Public"
      ]
   },
   {
      "date": "2017-12-26",
      "localName": "Stefanitag",
      "name": "St. Stephen's Day",
      "countryCode": "AT",
      "fixed": true,
      "global": true,
      "counties": null,
      "launchYear": null,
      "types": [
         "Public"
      ]
   }
]

productive-kalendar

Build Status

Russian productive calendar with REST API. Kalendar, because it is written in Kotlin.

productive-kalendar [RU]

Приложение для получения данных из производственного календаря Российской Федерации по REST API.

Run

Docker

Всё становится лучше с Docker

docker build --no-cache -t productive-kalendar .
docker run -it --rm -p 8080:8080 productive-kalendar

После чего приложение доступно по адресу http://localhost:8080/

Локально

Тут всё типично для приложения spring-boot и gradle-wrapper.

Сборка проекта

Сборка проекта без тестов

Запуск статического анализатора

В проекте используется статический анализ и линтинг средствами detekt.

Запуск приложения

API

Обновить информацию в календаре

Информация о выходных днях извлекается из csv-файла, последняя версия которого скачивается с портала открытых данных РФ
(https://data.gov.ru/opendata/7708660670-proizvcalendar). На 2018-08-29 портал предоставляет данные с 1999 г. по 2025 г.,
однако данные 2019-2025 г. ещё не утверждены правительством РФ и являются приблизительными.

POST http://localhost:8080/api/command/parse/gov

RESPONSE обновленный список дат выходных дней в формате json

Запросить информацию из календаря

Далее {date} — это дата в формате гггг-ММ-дд, например 2018-08-18.

В запросах, где предполагается интервал дат, последняя дата не включается. Если даты одинаковые, то в ответе будет 0.
Если одна из дат интервала не указана, то вместо неё будет использоваться текущая дата. Если обе даты не указаны, то
будет возбуждено исключение и получите ошибку 400 «Incorrect request. Start and end together must not be null».

Является ли данная дата выходным днём

GET http://localhost:8080/api/query/is/{date}/holiday

RESPONSE boolean, true — выходной, false — рабочий день

Является ли завтра выходным днём

GET http://localhost:8080/api/query/is/tomorrow/holiday

RESPONSE boolean, true — выходной, false — рабочий день

Получить список всех выходных, которые хранятся в системе

GET http://localhost:8080/api/query/all/holidays

RESPONSE отсортированный по возрастанию список дат

Получить список всех выходных за определенный год

{year} — Int, год в диапазоне [1999, 2100]

GET http://localhost:8080/api/query/{year}/holidays

RESPONSE отсортированный по возрастанию список дат. Если за указанный год в системе нет информации, то вернется пустой
список

Получить количество рабочих дней между датами

Опциональный параметр inclusive типа Boolean определяет, включает ли подсчет дату end в интервал или нет.
По умолчанию false

POST http://localhost:8080/api/query/workdays/between

Content-Type: application/json

{
  "start": "{date}",
  "end": "{date}",
  "inclusive": {true or false(default)}
}

RESPONSE Int — количество рабочих дней между датами

Получить количество выходных дней между датами

Опциональный параметр inclusive типа Boolean определяет, включает ли подсчет дату end в интервал или нет.
По умолчанию false

POST http://localhost:8080/api/query/holidays/between

Content-Type: application/json

{
  "start": "{date}",
  "end": "{date}",
  "inclusive": {true or false(default)}
}

RESPONSE Int — количество выходных дней между датами

Получить весь производственный календарь

GET http://localhost:8080/api/query/productive-calendar

RESPONSE { «holidays»: [‘1999-01-01’, …], «preholidays»: [‘1999-03-07’, …] }

Получить производственный календарь за определенный год

{year} — Int, год в диапазоне [1999, 2100]

GET http://localhost:8080/api/query/{year}/productive-calendar

RESPONSE { «holidays»: [‘2018-01-01’, …], «preholidays»: [‘2018-03-07’, …] }

Получить тип дня

GET http://localhost:8080/api/query/day/{date}/type

RESPONSE одно из значений перечисления: WORKDAY, HOLIDAY, PREHOLIDAY

Получить тип завтрашнего дня

GET http://localhost:8080/api/query/day/tomorrow/type

RESPONSE одно из значений перечисления: WORKDAY, HOLIDAY, PREHOLIDAY

Telegram bot

Есть возможность поднять Telegram-бота, который будет стучаться в календарь.

Для одного проекта мне нужно получать актуальные дни, которые в РФ считаются праздничными. В последующем хочется получать праздники стран СНГ.

Откуда можно получить эти данные для последующей обработки на PHP? Например JSON, XML, серилизованный массив?

Kyubey's user avatar

Kyubey

31.4k18 золотых знаков77 серебряных знаков102 бронзовых знака

задан 8 мая 2015 в 5:41

GrayHoax's user avatar

2

Например, можно воспользоваться этим сайтом.

ответ дан 8 мая 2015 в 5:47

Фомина Виктория's user avatar

Фомина ВикторияФомина Виктория

1,4881 золотой знак10 серебряных знаков21 бронзовый знак

2

Даже вопрошать — «Вас в гугле забанили?» — не хочу.
Вот список праздников. Запихни в массив, сериализуй/в_JSON/преврати_в_XML и сохрани в файлик/БД.
Выдрать можно регуляркой (прям вижу как @Vlad мне медленно голову откручивает за такой совет), а можно любым HTML-парсером.

ответ дан 8 мая 2015 в 5:49

4

Понравилась статья? Поделить с друзьями:
  • Anno 1404 сценарии зодчий
  • Cgi сценарий что это
  • Anno 1404 venice пользовательские сценарии
  • Cgi сценарий пример
  • Among us сценарий дня рождения